Transformation based on another body's axis

bindumol
Posts: 15
Joined: Thu May 08, 2008 9:55 am
Location: India, Kerala

Transformation based on another body's axis

Post by bindumol »

Hi all,
I am trying an application which uses Irrlicht and bullet physics. I want to rotate a group of bodies based on one axis, which is the axis for the transform at the time of creation, now i want to group another set of bodies and it should be rotate with axis of one body..
irr::core::aabbox3d<irr::f32> tt;
tt = mSceneNode->getTransformedBoundingBox();
vector3df vec;
vec = tt.getCenter();
mTPosition1.setX(vec.X);
mTPosition1.setY(vec.Y);
mTPosition1.setZ(vec.Z);

trans = body2->getWorldTransform();
trans.setOrigin(mTPosition1); //Not sets the actual one
trans.setRotation(btQuaternion(btVector3(1,0,0), (btScalar)i*0.0174));
body2->proceedToTransform(trans);
Please help me................