it swings forever once i hit it…  why is it swinging forever?

Software: Away3D 4.x

antonio.lea, Newbie
Posted: 14 July 2012 01:14 AM   Total Posts: 19

once I shoot and hit it, it swings forever and never stops.

what am I doing wrong?.. any input is greatly appreciated.


gravity: -30;


var boxShape : AWPBoxShape;
boxShape = new AWPBoxShape(hangingKey.maxX, hangingKey.maxY, hangingKey.maxZ);
var hangingKeyBody : AWPRigidBody;
var hinge : AWPHingeConstraint;

var wireframegrid : WireframeAxesGrid = new WireframeAxesGrid();
_view.scene.addChild(wireframegrid);

hangingKeyBody = new AWPRigidBody(boxShape, hangingKey, 100);
hangingKeyBody.position = new Vector3D(0, 0, 0);
hangingKeyBody.rotationX = hangingKey.rotationX;
hangingKeyBody.restitution = 1;

physicsWorld.addRigidBody(hangingKeyBody);
hinge = new AWPHingeConstraint(hangingKeyBody, new Vector3D(0, 100, 0), new Vector3D(1, 0, 0));
physicsWorld.addConstraint(hinge);

var ground : Mesh = new Mesh();
ground.geometry = new PlaneGeometry(50000, 50000);
ground.material = new ColorMaterial(0xFF0000);
ground.mouseEnabled = true;
ground.y -= 300;

ground.addEventListener(MouseEvent3D.MOUSE_UP, onMouseUp);
_view.scene.addChild(ground);

 

File Attachments
key.swf  (File Size: 1255KB - Downloads: 306)
   

antonio.lea, Newbie
Posted: 14 July 2012 09:07 AM   Total Posts: 19   [ # 1 ]

Seems like damp property does it..  Is this the legit way?

   

Yang Li, Administrator
Posted: 17 July 2012 12:56 AM   Total Posts: 80   [ # 2 ]

yes, you can set linearDamping and angularDamping.

   

antonio.lea, Newbie
Posted: 17 July 2012 03:42 AM   Total Posts: 19   [ # 3 ]

What is the appropriate use to use angular damping vs linear damping?

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X