Joint's Current Distance or angle
Posted: Thu Jun 16, 2011 1:34 am
Hello again. Is there any way to easily and consistently calculate the current distance or angle of an item in respect to a joint?
For example, lets say I have an item with a LineSliderJoint and I have the limits enabled with a minimum of 0 and a maximum of 40, and then I have a motor with a servo activated and it has a goal of 35. I would like to know at any point what the current position of the item is on that line. So that if it starts at 0 I could output the current position in real time as the servo takes it from 0 to 35.
Or let's say I have an item with a RevoluteJoint and I have a similar joint and servo situation as above. I would like to know at any time what the angle is for the joint.
I suppose this calculation could be done by comparing the position or orientation of objectA to the position or orientation of objectB and offset it by the starting position or orientation, but I'm hoping that an easier and neater way to do this is built in to the physics engine.
Thanks!
For example, lets say I have an item with a LineSliderJoint and I have the limits enabled with a minimum of 0 and a maximum of 40, and then I have a motor with a servo activated and it has a goal of 35. I would like to know at any point what the current position of the item is on that line. So that if it starts at 0 I could output the current position in real time as the servo takes it from 0 to 35.
Or let's say I have an item with a RevoluteJoint and I have a similar joint and servo situation as above. I would like to know at any time what the angle is for the joint.
I suppose this calculation could be done by comparing the position or orientation of objectA to the position or orientation of objectB and offset it by the starting position or orientation, but I'm hoping that an easier and neater way to do this is built in to the physics engine.
Thanks!