I'm working on a vehicle sim in which I need to know what surface the vehicle's wheels are touching. After some searching I found the m_groundObject member of the m_rayCastInfo of the btWheelInfo. In the vehicle's rayCast method I see that this pointer is currently being set to a dummy object:
wheel.m_raycastInfo.m_groundObject = &s_fixedObject;///@todo for driving on dynamic/movable objects!;
//wheel.m_raycastInfo.m_groundObject = object;
(Line 189 of btRaycastVehicle.cpp)
in stead of the object returned by the castRay call.
If I comment out the first line and uncomment the second, I can do what I want (check later to see which of my scene's rigid bodies is a pointer to the m_groundObject).
My question is - is this a good idea? Would it be smarter to leave this code as-is and redo the raycast to get a pointer to the object the wheel is touching when I do my checking code? The change doesn't seem to have caused any problems in my particular case.