1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 20:02:40 +01:00

Prevent Rhino's front wheels from changing steering angle

This commit is contained in:
vflyson 2017-03-04 01:29:33 -05:00 committed by Daniel Evans
parent 57ad566681
commit a0beb47c5d

View File

@ -275,11 +275,12 @@ void ObjectRenderer::renderVehicle(VehicleObject* vehicle,
auto& wi = vehicle->physVehicle->getWheelInfo(w);
// Construct our own matrix so we can use the local transform
vehicle->physVehicle->updateWheelTransform(w, false);
bool isRhino = (vehicle->getVehicle()->vehiclename_ == "RHINO");
auto up = -wi.m_wheelDirectionCS;
auto right = wi.m_wheelAxleCS;
auto fwd = up.cross(right);
btQuaternion steerQ(up, wi.m_steering);
btQuaternion steerQ(up, (isRhino) ? 0.f : wi.m_steering);
btQuaternion rollQ(right, -wi.m_rotation);
btMatrix3x3 basis(right[0], fwd[0], up[0], right[1], fwd[1], up[1],
right[2], fwd[2], up[2]);