Page 1 of 1

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

Posted: Sat Feb 09, 2019 2:40 pm
by Tadek
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.

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

Posted: Sun Feb 10, 2019 8:54 pm
by Tadek
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.