title: SceneKit Swift - PhysicsBody not precise
body: <p>Hello,</p>
  
  <p>I'm making a game with <code>SceneKit</code> in <code>Swift</code>.
  In this game I have first <code>cube1</code> that is on a second <code>cube2</code> (that is the ground).</p>
  
  <hr>
  
  <p><strong>PROBLEM 1</strong></p>
  
  <p>The <code>cube1</code>'s <code>PhysicsBodyType</code> is <code>Kinematic</code>, while the second is <code>Static</code>.
  I used <code>Kinematic</code> for the first cube because when I use <code>Dynamic</code>, the PhysicsBody is not precise as you can see on the image :</p>
  
  <p><img src="https://i.stack.imgur.com/mRsYM.png" alt="game preview 1"></p>
  
  <p>While when I use <code>Kinematic</code>, the <code>PhysicsBody</code> is right :</p>
  
  <p><img src="https://i.stack.imgur.com/gvwas.png" alt="game preview 2"></p>
  
  <p>Do you know why the <code>PhysicsBody</code> is not precise ?</p>
  
  <hr>
  
  <p><strong>PROBLEM 2</strong></p>
  
  <p>I want to apply vertical force (y) to the <code>cube1</code> but it is impossible to do with <code>Kinematic</code> type, so I tried to use <code>SCNAction.moveBy</code> but the movement is not smooth.</p>
  
  <p>Have you a solution for this ?</p>
  
  <p><strong>CODE</strong></p>
  
  <p>CUBE 1 :</p>
  
  <pre><code>let cubeGeometry = SCNBox(width: cubeSize, height: cubeSize, length: cubeSize, chamferRadius: 0.0)
  cubeGeometry.firstMaterial?.diffuse.contents = UIColor(netHex: 0xF1C40F)
  cubeNode = SCNNode(geometry: cubeGeometry)
  cubeNode.position = SCNVector3(x: 0.0, y: 0.0, z: 0.0)
  
  let cubeShape = SCNPhysicsShape(geometry: cubeGeometry, options: nil)
  cubeNode.physicsBody = SCNPhysicsBody(type: SCNPhysicsBodyType.Dynamic, shape: cubeShape)
  cubeNode.physicsBody?.angularVelocityFactor = SCNVector3(0.0, 1.0, 0.0)
  scene.rootNode.addChildNode(cubeNode)
  </code></pre>
  
  <p>CUBE 2 :</p>
  
  <pre><code>for index in 0...10 {
  
      let cubeGeometry = SCNBox(width: cubeSize, height: cubeSize, length: cubeSize, chamferRadius: 0.0)
  
      let randomColor = Int(arc4random_uniform(UInt32(colorsArray.count)))
  
      cubeGeometry.firstMaterial?.diffuse.contents = colorsArray[randomColor]
  
      let cubeGround = SCNNode(geometry: cubeGeometry)
      cubeGround.position = SCNVector3(x: 0.0, y: -Float(cubeSize), z: Float(index) * -Float(cubeSize))
      cubeGround.physicsBody = SCNPhysicsBody(type: SCNPhysicsBodyType.Static, shape: SCNPhysicsShape(node: cubeGround, options: nil))
      cubeGround.physicsBody?.angularVelocityFactor = SCNVector3(0.0, 0.0, 0.0)
      scene.rootNode.addChildNode(cubeGround)
  </code></pre>
  
  <p>}</p>