What steps will reproduce the problem?
1.
btRaycastVehicle::AddWheel() calls updateWheelTransform(), which references
wheel.m_raycastInfo.m_suspensionLength to set the wheel position in this code:
wheel.m_worldTransform.setOrigin(
wheel.m_raycastInfo.m_hardPointWS + wheel.m_raycastInfo.m_wheelDirectionWS * wheel.m_raycastInfo.m_suspensionLength
);
but wheel.m_raycastInfo is completely uninitialized when a btWheelInfo is
created, so the position is garbage (only 0 if you are lucky)
This is bullet 2.81
Patch is this:
------------------------------
+++ btWheelInfo.h 2013-03-05 15:51:32.579795000 -0800
@@ -40,6 +40,19 @@
{
struct RaycastInfo
{
+ RaycastInfo() :
+ m_contactNormalWS(0.0f,0.0f,0.0f),
+ m_contactPointWS(0.0f,0.0f,0.0f),
+ m_hardPointWS(0.0f,0.0f,0.0f),
+ m_wheelDirectionWS(0.0f,0.0f,0.0f),
+ m_wheelAxleWS(0.0f,0.0f,0.0f),
+ m_suspensionLength(0.0f),
+ m_isInContact(false),
+ m_groundObject(NULL),
+ m_contactMaterial(NULL)
+ {
+ }
+
//set by raycaster
btVector3 m_contactNormalWS;//contactnormal
btVector3 m_contactPointWS;//raycast hitpoint
Original issue reported on code.google.com by chris.ge...@gmail.com on 6 Mar 2013 at 12:19
Original issue reported on code.google.com by
chris.ge...@gmail.com
on 6 Mar 2013 at 12:19