title: how do I achieve a rotational "spring back" effect in SceneKit?
body: <p>I am trying to achieve the effect of the wooden rod in this animation, using SceneKit:</p>
  
  <p><a href="https://www.instagram.com/p/BkzqpHHgKb1/" rel="nofollow noreferrer">https://www.instagram.com/p/BkzqpHHgKb1/</a></p>
  
  <p>The rod can spin around it's center, and then snaps back to it's original position. </p>
  
  <p>I have an elongated Scenekit SCNBox representing the rod. I'm using SCNPhysicsHingeJoint on the rod's physics body to give it the ability to rotate around it's center:</p>
  
  <pre><code> let joint = SCNPhysicsHingeJoint(body: (rod.physicsBody!), axis:SCNVector3(x: 0, y: 0, z: 1) , anchor: SCNVector3(x: 0.0, y: 0.0, z: 0))
   scnView.scene?.physicsWorld.addBehavior(joint)
  </code></pre>
  
  <p>Is there a way to make the rod spring back into it's original position by manipulating the physics properties such as restitution, angularDamping, etc? Can I achieve this with an SCNPhysicsField.spring() ? </p>
  
  <p>Or, do I just manually animate the rod back to it's original position? </p>
  
  <p>I've set up a lot of this in the SceneKit editor so there's not a lot of code, but I could rewrite as code if that is useful for this question.</p>