Advertisement

PhysX, how PxVec3 mutiply rotate ?

Started by April 24, 2020 02:42 PM
0 comments, last by bluesteaik 4 years, 9 months ago

I want to shot with PxVec3(Direction) + 45 degree upper direction.

my code is

auto PxDir = PxVec3( pvDir->x, pvDir->y, pvDir->z );
PxQuat q( D3DXToRadian(45), PxVec3(1,0,0));
auto PxDir45 = q.rotate( PxDir );
pBox->setLinearVelocity( PxDir45 * 300 );

but It's not work correctly.

Just work in only d3dxvector3(0,0,1).

and In the other direction, not 45 degree.

Please help…

This topic is closed to new replies.

Advertisement