Skip to content

Commit

Permalink
UPBGE: Fix unormalized vehicle axis direction.
Browse files Browse the repository at this point in the history
Previously the user was able to specify a unormalized axis direction
for wheel and suspension in a vehicle wrapper, but bullet doesn't handled
it properly and generated odd wheel angles.

To fix this issue we ensure that the axis direction are well normalized.

Fix second part of issue: #593.
  • Loading branch information
panzergame committed Sep 15, 2017
1 parent 830833a commit c24d294
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
Expand Up @@ -221,8 +221,8 @@ class WrapperVehicle : public PHY_IVehicle
float wheelRadius,
bool hasSteering)
{
btWheelInfo& info = m_vehicle->addWheel(ToBullet(connectionPoint), ToBullet(downDirection), ToBullet(axleDirection),
suspensionRestLength, wheelRadius, gTuning, hasSteering);
btWheelInfo& info = m_vehicle->addWheel(ToBullet(connectionPoint), ToBullet(downDirection.normalized()),
ToBullet(axleDirection.normalized()), suspensionRestLength, wheelRadius, gTuning, hasSteering);
info.m_clientInfo = motionState;
}

Expand Down

0 comments on commit c24d294

Please sign in to comment.