mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 17:35:45 +02:00
Fix flying bug.
This commit is contained in:
parent
108e8b9994
commit
4301d74df5
1 changed files with 2 additions and 8 deletions
|
@ -3434,7 +3434,7 @@ glm::vec3 MyAvatar::calculateScaledDirection(){
|
|||
if (state == CharacterController::State::Hover ||
|
||||
_characterController.computeCollisionMask() == BULLET_COLLISION_MASK_COLLISIONLESS) {
|
||||
glm::vec3 up = (getDriveKey(TRANSLATE_Y)) * IDENTITY_UP;
|
||||
up /= glm::length(up);
|
||||
//up /= glm::length(up);
|
||||
direction += up;
|
||||
}
|
||||
|
||||
|
@ -3464,12 +3464,6 @@ void MyAvatar::updateActionMotor(float deltaTime) {
|
|||
float directionLength = glm::length(direction);
|
||||
_isPushing = directionLength > EPSILON;
|
||||
|
||||
//if (_isPushing) {
|
||||
// direction;
|
||||
//} else {
|
||||
// direction = Vectors::ZERO;
|
||||
//}
|
||||
|
||||
if (!_isPushing) {
|
||||
direction = Vectors::ZERO;
|
||||
}
|
||||
|
@ -3486,7 +3480,7 @@ void MyAvatar::updateActionMotor(float deltaTime) {
|
|||
const float maxBoostSpeed = sensorToWorldScale * MAX_BOOST_SPEED;
|
||||
|
||||
if (_isPushing) {
|
||||
direction /= direction;
|
||||
direction /= directionLength;
|
||||
if (motorSpeed < maxBoostSpeed) {
|
||||
// an active action motor should never be slower than this
|
||||
float boostCoefficient = (maxBoostSpeed - motorSpeed) / maxBoostSpeed;
|
||||
|
|
Loading…
Reference in a new issue