title: How to prevent the camera from entering a SCNNode - Scenekit iOS
body: <p>I have a problem whit the camera in SceneKit, by default i can move, rotate, zoom my camera whit this line :</p>
  
  <pre><code>myView.allowsCameraControl = YES;
  </code></pre>
  
  <p>But my camera can pass through walls and floor (which allows me to see the underside of the stage ) .</p>
  
  <p>My first request: is it possible to apply constraints to the camera (position, rotation) ?</p>
  
  <p>My second request: I thought making a cube encompassing stage and do my collision detection between my cube and my camera, but it does not work ...</p>
  
  <p>code for viewDidLoad:</p>
  
  <pre><code>SCNView *myView = (SCNView *)self.view3D;
  myView.scene = [SCNScene sceneNamed:@"art.scnassets/Pointe Marrin 3 def 3 def 2.dae"];
  myView.scene.physicsWorld.contactDelegate = self;
  myView.scene.physicsWorld.gravity = SCNVector3Make(0, 0, 0);
  cubeLimite = [myView.scene.rootNode childNodeWithName:@"Cube" recursively:YES];
  camera = [myView.scene.rootNode childNodeWithName:@"Caméra" recursively:YES];
  cubeLimite.physicsBody = [SCNPhysicsBody bodyWithType:SCNPhysicsBodyTypeDynamic shape:nil];
  cubeLimite.physicsBody.mass = 0;
  cubeLimite.categoryBitMask = SCNPhysicsCollisionCategoryDefault;
  cubeLimite.physicsBody.collisionBitMask = SCNPhysicsCollisionCategoryAll;
  
  
  //test camera
  CGFloat boxSide = 0.001;
  SCNBox *box = [SCNBox boxWithWidth:boxSide
                              height:boxSide
                              length:boxSide
                       chamferRadius:0];
  SCNNode *boxNode = [SCNNode nodeWithGeometry:box];
  SCNPhysicsShape *shape = [SCNPhysicsShape shapeWithGeometry:boxNode.geometry options:nil];
  camera.physicsBody = [SCNPhysicsBody bodyWithType:SCNPhysicsBodyTypeDynamic shape:shape];
  camera.physicsBody.mass = 0;
  camera.categoryBitMask = SCNPhysicsCollisionCategoryDefault;
  camera.physicsBody.collisionBitMask = SCNPhysicsCollisionCategoryAll;
  </code></pre>
  
  <p>Code for delegate :</p>
  
  <pre><code>- (void)physicsWorld:(SCNPhysicsWorld *)world
   didBeginContact:(SCNPhysicsContact *)contact{
  NSLog(@"Contact debut");
  }
  - (void)physicsWorld:(SCNPhysicsWorld *)world
   didUpdateContact:(SCNPhysicsContact *)contact{
  NSLog(@"Contact milieu");
  }
  - (void)physicsWorld:(SCNPhysicsWorld *)world didEndContact:(SCNPhysicsContact *)contact{
  NSLog(@"Contact fin");
  }
  </code></pre>
  
  <p>The delegate :
      SCNPhysicsContactDelegate
  is declared in the .h file</p>
  
  <p>Ideas ?
  thank you beforehand</p>