How to forbid the Position change
Posted: Tue Nov 12, 2013 8:34 am
Hi.
How can i forbid change position and rotation of the Entity except one Axis (Y) ?
I want to simulate process of opening door by the mouse.
I used RevoluteJoint and Box to create simple door but when i try to grab door by the mouse box is moving (for short distance) and some rotate by another axiss.
If this is not god choice, plz give me advice.
Aaand i used sample of grabber from Bepu demo.
How can i forbid change position and rotation of the Entity except one Axis (Y) ?
I want to simulate process of opening door by the mouse.
I used RevoluteJoint and Box to create simple door but when i try to grab door by the mouse box is moving (for short distance) and some rotate by another axiss.
If this is not god choice, plz give me advice.
Code: Select all
var door = new Box(new Vector3(0, 0.24f,0.5f), 0.3f, 0.5f, 0.02f, 100);
RevoluteJoint revolute = new RevoluteJoint(null, door, door.Position + new Vector3(-0.15f, 0, 0), Vector3.Up);
revolute.Limit.IsActive = true;
revolute.AngularJoint.ConnectionA.BecomeKinematic();
revolute.Limit.Basis.SetWorldAxes(Vector3.Up, Vector3.Right);
revolute.Limit.TestAxis = Vector3.Right;
revolute.Limit.MinimumAngle = -MathHelper.Pi;
revolute.Limit.MaximumAngle = 0;