Sign in to follow this  

physX actor from .xfile with rotation

This topic is 3597 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello, i need a physX actor to use for my moving stuff like items ... now i gave up to use complex meshes and use only ageia boxes which works very good. i have a ID3DXMesh* and a 1) local box 2) its rotate/translate/scale matrix now to create a AgeiaBox i first need the half-length / half width/ half height of the box so i compute this by:: D3DXVECTOR3 minVec; minVec.x = minBox.maxPt.x - minBox.center().x; minVec.y = minBox.maxPt.y - minBox.center().y; minVec.z = minBox.maxPt.z - minBox.center().z; minBox is the local box with a minPoint a maxPoint and a center function after this i have the required stats but since my model is scaled and rotated i ahve to do this with my box too. So i do this: D3DXVec3TransformCoord(&minVec, &minVec, &this->GetScaleRotate()); i multiply the vector with my rotate*scale matrix. Now if my rotation is 0/0/0 this works perfect but if its e.g. 90/0/0 everything is messed up and i dont know why. The last step i do is: actorDesc.globalPose.t = NxVec3(baseMesh->pos.x, baseMesh->pos.y, baseMesh->pos.z); to give Ageia the global pos of my ID3DXMesh* in world space. It must be a rotation problem. If i have a box with e.g. length 2 height 1 and width 1 then, and if i dont use ageia and just draw ith with a 90/0/0 rotation it looks like this: --------- --------- --------- now if i give ageia the box and apply the rotation to it and later when i draw it receive the rotation matrix from ageia it looks like this: ----- ----- ----- ----- ----- it rotates around althought both times i use the same rotation, and i dont know why. Thx for any help

Share this post


Link to post
Share on other sites

This topic is 3597 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this