raycast vehicle - how wheel connection point and wheel width are defined
-
- Posts: 7
- Joined: Sun Jan 22, 2017 5:41 pm
raycast vehicle - how wheel connection point and wheel width are defined
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.
-
- Posts: 7
- Joined: Sun Jan 22, 2017 5:41 pm
Re: raycast vehicle - how wheel connection point and wheel width are defined
Wheel connection that's a vector from the chasis center to the wheel center. Matrix for the graphics engine is obtained this way:
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.
Code: Select all
btTransform transform = vehicle_->getWheelInfo(wheelNumber).m_worldTransform;
float openglMatrix[16];
transform.getOpenGLMatrix(openglMatrix);
https://ibb.co/hB0ZQFS
To fix that you need to add appropriate translation to the openglMatrix.