How should I get the contact state of a BulletWheel?

If have been tracing this in the Bullet source code (btRaycastVehicle.cpp):

void* object = m_vehicleRaycaster->castRay(source,target,rayResults);
wheel.m_raycastInfo.m_groundObject = 0;
if (object)
{
  ...
  wheel.m_raycastInfo.m_groundObject = &getFixedBody();
  //wheel.m_raycastInfo.m_groundObject = object;
}

...

btRigidBody& btActionInterface::getFixedBody()
{
  static btRigidBody s_fixed(0, 0,0);
  s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.)));
  return s_fixed;
}

Seems like the “old” implementation (that is setting groundObject to object) has been replaced by a “new” implementation which simply returns a (static) dummy rigid body. This dummy rigid body does not have a Panda3D object associated with it, and hence the crash.

I don’t know why this Bullet feature has changed. The new implementation is useless, since it doesn’t provide any information about the object the vehicle is driving on.

What should we do?

  1. Remove the method from the Panda3D interface. This would be the “clean” solution.
  2. Leave it there, so people who compile Bullet (and then Panda3D) themselves can change the Bullet source code back to the old implementation. Just uncomment the commented line and comment the other one.