Questions about setAngularVelocity
Posted: Sun Dec 09, 2018 5:41 am
I have created a rigid body in a world without gravity and created a sphere shape. I assign a vector3 as a way point and use applyForce in the direction of the way point. This is working and my model is moving around. My questions are about how to rotate toward the destination while force is being applied. The end result should be if I give the body a way point it applies force and rotates around until facing the direction of the way point while moving forward the whole time.
The only example of this I could find was viewtopic.php?f=9&t=12309&p=41319&hilit ... ile#p41319.
I was unable to find a getLocalInverseZAxis method in my graphics engine. I don't understand what it should do either.
I tried
but the result was a constant rotation around the one axis I used setAngularVelocity on.
My cosAngle is never greater than 0.99. I had to set to 'if (cosAngle > 0.09)' to get the rotation I am getting.
The only example of this I could find was viewtopic.php?f=9&t=12309&p=41319&hilit ... ile#p41319.
I was unable to find a getLocalInverseZAxis method in my graphics engine. I don't understand what it should do either.
Code: Select all
ENG_Vector4D missileDirection = missileProperties.getNode().getLocalInverseZAxis();
Code: Select all
btVector3 missileDirection = newMissileDirection - mShipNode->getPosition());
My cosAngle is never greater than 0.99. I had to set to 'if (cosAngle > 0.09)' to get the rotation I am getting.