Code: Select all
Box boxOne = new Box(new Vector3(0, 0,0) , 1, 1, 1, 5);
boxOne.Orientation = Quaternion.CreateFromAxisAngle(Vector3.Forward, 0);
Box boxTwo = new Box(new Vector3(0, 5, 0), 1, 1, 1, 5);
boxTwo.Orientation = Quaternion.CreateFromAxisAngle(Vector3.Forward, 0);
boxOne.Material = new Material(.3f,.2f,.2f);
boxTwo.Material = new Material(.3f, .2f, .2f);
RevoluteAngularJoint bsj;
AngularMotor am;
Space.Add(boxOne);
Space.Add(boxTwo);
bsj = new RevoluteAngularJoint(boxOne, boxTwo, new Vector3(0,2.5f,0));
am = new AngularMotor(boxOne, boxTwo);
am.Settings.Mode = MotorMode.VelocityMotor;
am.IsActive = true;
bsj.IsActive = true;
EllipseSwingLimit swingLimit = new EllipseSwingLimit(boxOne, boxTwo, Vector3.Up, MathHelper.PiOver4, MathHelper.PiOver2);
bsj.GalLimit = swingLimit;
bsj.GalMotor = am;
Space.Add(swingLimit);
Space.Add(am);
Space.Add(bsj);
Any input on why this doesn't work?