raycast vehicle - how wheel connection point and wheel width are defined

Post Reply
Tadek
Posts: 7
Joined: Sun Jan 22, 2017 5:41 pm

raycast vehicle - how wheel connection point and wheel width are defined

Post by Tadek » Sat Feb 09, 2019 2:40 pm

I create a raycast vehicle with a simple rectangular chassis rigid body. Box dimensions: [1, 1, 3]. btRaycastVehicle has addWheel function which has wheelConnectionPoint parameter. How it is defined ? Is it a position calculated from chassis rigid body center ? I also wonder how to define a wheel width. addWheel function doesn't take any parameter which allow to define wheel width.

Tadek
Posts: 7
Joined: Sun Jan 22, 2017 5:41 pm

Re: raycast vehicle - how wheel connection point and wheel width are defined

Post by Tadek » Sun Feb 10, 2019 8:54 pm

Wheel connection that's a vector from the chasis center to the wheel center. Matrix for the graphics engine is obtained this way:

Code: Select all

btTransform transform = vehicle_->getWheelInfo(wheelNumber).m_worldTransform;
float openglMatrix[16];
transform.getOpenGLMatrix(openglMatrix);
Raycast vehicle doesn't define wheel width, for the part of the wheel outside wheelConnection point (wheel center) collision will not be detected:

https://ibb.co/hB0ZQFS


To fix that you need to add appropriate translation to the openglMatrix.

Post Reply