This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func createPhysicsBody(for node: SCNNode){ | |
let boxGeomtery = SCNBox(width: 0.2, height: 0.2, length: 0.2, chamferRadius: 0) | |
let physicsShape = SCNPhysicsShape(geometry: boxGeomtery, options: nil) | |
let physicsBody = SCNPhysicsBody(type: .kinematic, shape: physicsShape) | |
node.physicsBody = physicsBody | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func moveNode(node: SCNNode){ | |
let moveAction = SCNAction.move(to: SCNVector3(0.1, 0.1, 0.1), duration: 0.25) | |
node.runAction(moveAction) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func createNode(){ | |
let boxGeometry = SCNBox(width: 0.2, height: 0.2, length: 0.2, chamferRadius: 0) | |
let node = SCNNode(geometry: boxGeometry) | |
sceneView.scene.rootNode.addChildNode(node) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) { | |
//Check that anchor is plane anchor that represents planar surfaces | |
guard let planeAnchor = anchor as? ARPlaneAnchor else { return } | |
//Create node using anchor position | |
let boxNode = createNode(with: planeAnchor) | |
//Add boxNode as a child node to newly found node | |
node.addChildNode(boxNode) | |
} | |
func createNode(with anchor: ARPlaneAnchor) -> SCNNode{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import ARKit | |
import SceneKit | |
class ARViewController: UIViewController{ | |
// First we create instances of ARSCNView, ARSession and ARWorldTracking configuration | |
let sceneView: ARSCNView = { | |
let scene = ARSCNView() | |
scene.translatesAutoresizingMaskIntoConstraints = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\Routing\Annotation\Route; | |
// … | |
/* | |
* @Route(“/tag/show/{id}”, name=”show_tag”) | |
* @param Request $request | |
* @param $id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$tagListing = new \Pimcore\Model\Element\Tag\Listing(); | |
$tagListing->addConditionParam(‘name LIKE :term’, [‘term’ => ‘%’ . $term . ’%’]); | |
$objectList = []; | |
foreach ($tagListing as $tag) { | |
$taggedObjects = \Pimcore\Model\Element\Tag::getElementsForTag($tag, ‘object’); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$tag = new \Pimcore\Model\Element\Tag(); | |
$tag->setName(‘keyword’)->save(); | |
\Pimcore\Model\Element\Tag::addTagToElement(‘object’, 156, $tag); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$objects = \Pimcore\Model\Element\Tag::getElementsForTag($tag, ‘object’); | |
$availableObjects = []; | |
foreach ($objects as $object) { | |
$availableObjects[] = $object; | |
} |