init zero gravity to agree with init hover state

This commit is contained in:
Andrew Meadows 2017-05-08 12:47:32 -07:00
parent d9e893ac21
commit e44c2c8da3
2 changed files with 2 additions and 3 deletions

View file

@ -361,6 +361,7 @@ void CharacterController::updateGravity() {
if (_state == State::Hover || collisionGroup == BULLET_COLLISION_GROUP_COLLISIONLESS) {
_gravity = 0.0f;
} else {
const float DEFAULT_CHARACTER_GRAVITY = -5.0f;
_gravity = DEFAULT_CHARACTER_GRAVITY;
}
if (_rigidBody) {

View file

@ -32,8 +32,6 @@ const uint32_t PENDING_FLAG_JUMP = 1U << 3;
const uint32_t PENDING_FLAG_UPDATE_COLLISION_GROUP = 1U << 4;
const float DEFAULT_MIN_FLOOR_NORMAL_DOT_UP = cosf(PI / 3.0f);
const float DEFAULT_CHARACTER_GRAVITY = -5.0f;
class btRigidBody;
class btCollisionWorld;
class btDynamicsWorld;
@ -183,7 +181,7 @@ protected:
bool _stepUpEnabled { true };
bool _hasSupport;
btScalar _gravity { DEFAULT_CHARACTER_GRAVITY };
btScalar _gravity { 0.0f };
btScalar _jumpSpeed;
btScalar _followTime;