Best way to manually set a raycast vehicle's direction ?

gleemer
Posts: 15
Joined: Sat Nov 29, 2008 6:34 am

Best way to manually set a raycast vehicle's direction ?

Post by gleemer »

So far I have thought of using a rotation matrix and multiplying against a btRaycastVehicle's chassis body matrix.

Adding this function to the btRaycastVehicle's class -

Code: Select all

  void btRaycastVehicle::Rotate(float* mtx) {
		float worldMat[16];
		float out[16];  
		
		m_chassisBody->getCenterOfMassTransform().getOpenGLMatrix(worldMat);
		MatrixMult( worldMat, mtx, out);
		m_chassisBody->getWorldTransform().setFromOpenGLMatrix((btScalar*)out);
		
} //
This does the trick for me, wondering if there is already a defined way to do the same thing ??? :o

Thanx