Jump to content
  • Advertisement
Sign in to follow this  
of_ownage

physX actor from .xfile with rotation

This topic is 3760 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!