Local Orientation Transformation Matching Between Objects

kurisusan

04-03-2012 13:06:17

Hi,

I have a little bit of a strange question so I will try and explain it fully.

Basically what I am trying to achieve is I have a 5x5x1 rigid body (a flat base), which can move and rotate in any direction. I also have a 1x5x1 rigid body (pole) which will sit on the base. What I want is when the base moves or rotates, the pole moves with it to simulate a joint.. and the reason I haven't used a joint in this instance is that I want the pole to also be able to move independently around the base while the base has its own movement. This would simulate a type of platform that rotates etc but the object on it stays planted to the ground. Currently how I do this is to set the orientation of the pole to match the base every frame, and also move the pole by however much the base has moved since the last frame.

To add to this issue, I don't want the pole to be able to go outside the bounds of the base. To do this without rotation I can just get the NxActor's Global Position and check it against the bases min and max x,y and z but when the base starts to move obviously this will not work anymore.

I am pretty sure to solve this I will have to perform some orientation matrix calculations but for the life of me I don't really know where to start.

Any help would be very much appreciated.

If you have any questions please ask as this probably sounds quite confusing :P