Some damping
Posted: Thu Dec 26, 2013 11:11 am
Hi !
I try to create some damping to the door. Door is - RevoluteJoint + Box with offset,
So, the door is openning by right click + change mouse position :
(Not real code, only simple vers).
Soo. And a question is : has a way to reallize damping after some mouse acceleration when the right click release ?
I try to create some damping to the door. Door is - RevoluteJoint + Box with offset,
So, the door is openning by right click + change mouse position :
Code: Select all
float dY = mouseState.Y - Camera.Viewport.Height * 0.5f;
dY = dY * Camera.Speed * dt;
float total = currDoor.GetJointSide() == Vector3.Right ? -dY : dY;
currDoor.ConvexHull.AngularVelocity = new Vector3(0, total, 0);
if (mouseState.RightButton == ButtonState.Released)
currDoor.ConvexHull.AngularVelocity = Vector3.Zero;
Soo. And a question is : has a way to reallize damping after some mouse acceleration when the right click release ?