I notice that in the joint limit, you can specify minimum and maximum angle. I just cannot for the life of me figure out how to retrieve the current angle of the joint. I have tried to calculate this by using the joint error and servo goal. This works somewhat, the the value gets kind of wacky when you initially move the joint. It smooths out after a frame or two.
FYI, this is an example of how I am currently attempting to do this. I have tried many variations on the following...
Code: Select all
float errorMult = 1.0f; float errorMin = -4.0f; float errorMax = 4.0f; myAngle = MathHelper.WrapAngle(revJoint.Motor.Settings.Servo.Goal - MathHelper.Clamp(revJoint.Motor.Error * errorMult, errorMin, errorMax))
Many thanks and I really love this engine!!