jeudi 1 janvier 2015

I'm trying to understand how SCNPhysicsHingeJoint works

I'm trying to figure out how the new PhysicsBehavior works. Specifically SCNPhysicsHingeJoint ... I have this example code here


var joint = SCNPhysicsHingeJoint(bodyA: boxNode.physicsBody!, axisA: SCNVector3(x: 0, y: 0, z: 1), anchorA: SCNVector3(x: 0, y: 1, z: 0), bodyB: cubeNode.physicsBody!, axisB: SCNVector3(x: 0, y: 0, z: 1), anchorB: SCNVector3(x: 0, y: 1, z: 0))


scene.physicsWorld.addBehavior(joint)


Ater adding this joint I get a crazy behaivor where the cubeNode shake a lot on movement. What I'm wanting to do is have the boxNode have the cubeNode attach to it and on movement then have the cubeNode move along with the boxNode but still have some wiggle.


Any ideas or suggestions??


Thanks in advance!




Aucun commentaire:

Enregistrer un commentaire