Vehicle: what are the wheels touching - m_groundObject

chucksspencer
Posts: 35
Joined: Wed Jun 25, 2008 2:52 pm

Vehicle: what are the wheels touching - m_groundObject

Post by chucksspencer »

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:

Code: Select all

	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.
RJNelson68
Posts: 73
Joined: Tue Oct 06, 2009 3:19 pm

Re: Vehicle: what are the wheels touching - m_groundObject

Post by RJNelson68 »

I was curious to know this as well.
drakes
Posts: 1
Joined: Sun Oct 25, 2009 2:51 am

Re: Vehicle: what are the wheels touching - m_groundObject

Post by drakes »

I'm trying to do something similiar. And s_fixedObject is nowhere else changed or used. So I'll change it to the second one in this version, but a note: they added a comment in 2.75:

Code: Select all

wheel.m_raycastInfo.m_groundObject = &s_fixedObject;///@todo for driving on dynamic/movable objects!;
//wheel.m_raycastInfo.m_groundObject = object;
I don't know what is meant, but it's working for me, when I uncomment the second line.