# physX actor from .xfile with rotation

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

## 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

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 15
• 11
• 11
• ### Forum Statistics

• Total Topics
634149
• Total Posts
3015832
×