Avoid using unitialized values.
m_gravity was used before it was initialized. Simplest way to avoid it is to call any method first after all values are initialized.
This commit is contained in:
@@ -137,8 +137,6 @@ btKinematicCharacterController::btKinematicCharacterController (btPairCachingGho
|
|||||||
m_ghostObject = ghostObject;
|
m_ghostObject = ghostObject;
|
||||||
m_up.setValue(0.0f, 0.0f, 1.0f);
|
m_up.setValue(0.0f, 0.0f, 1.0f);
|
||||||
m_jumpAxis.setValue(0.0f, 0.0f, 1.0f);
|
m_jumpAxis.setValue(0.0f, 0.0f, 1.0f);
|
||||||
setUp(up);
|
|
||||||
setStepHeight(stepHeight);
|
|
||||||
m_addedMargin = 0.02;
|
m_addedMargin = 0.02;
|
||||||
m_walkDirection.setValue(0.0,0.0,0.0);
|
m_walkDirection.setValue(0.0,0.0,0.0);
|
||||||
m_AngVel.setValue(0.0, 0.0, 0.0);
|
m_AngVel.setValue(0.0, 0.0, 0.0);
|
||||||
@@ -156,13 +154,16 @@ btKinematicCharacterController::btKinematicCharacterController (btPairCachingGho
|
|||||||
m_wasOnGround = false;
|
m_wasOnGround = false;
|
||||||
m_wasJumping = false;
|
m_wasJumping = false;
|
||||||
m_interpolateUp = true;
|
m_interpolateUp = true;
|
||||||
setMaxSlope(btRadians(45.0));
|
|
||||||
m_currentStepOffset = 0.0;
|
m_currentStepOffset = 0.0;
|
||||||
m_maxPenetrationDepth = 0.2;
|
m_maxPenetrationDepth = 0.2;
|
||||||
full_drop = false;
|
full_drop = false;
|
||||||
bounce_fix = false;
|
bounce_fix = false;
|
||||||
m_linearDamping = btScalar(0.0);
|
m_linearDamping = btScalar(0.0);
|
||||||
m_angularDamping = btScalar(0.0);
|
m_angularDamping = btScalar(0.0);
|
||||||
|
|
||||||
|
setUp(up);
|
||||||
|
setStepHeight(stepHeight);
|
||||||
|
setMaxSlope(btRadians(45.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
btKinematicCharacterController::~btKinematicCharacterController ()
|
btKinematicCharacterController::~btKinematicCharacterController ()
|
||||||
|
|||||||
Reference in New Issue
Block a user