mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-06 10:23:38 +02:00
remove hover-friendly behavior
This commit is contained in:
parent
b37384d759
commit
f804b2311d
3 changed files with 2 additions and 15 deletions
|
@ -1457,7 +1457,4 @@ void MyAvatar::relayDriveKeysToCharacterController() {
|
|||
if (_driveKeys[UP] > 0.0f) {
|
||||
_characterController.jump();
|
||||
}
|
||||
if (_driveKeys[DOWN] > 0.0f) {
|
||||
_characterController.stopHover();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ const uint32_t PENDING_FLAG_ADD_TO_SIMULATION = 1U << 0;
|
|||
const uint32_t PENDING_FLAG_REMOVE_FROM_SIMULATION = 1U << 1;
|
||||
const uint32_t PENDING_FLAG_UPDATE_SHAPE = 1U << 2;
|
||||
const uint32_t PENDING_FLAG_JUMP = 1U << 3;
|
||||
const uint32_t PENDING_FLAG_STOP_HOVER = 1U << 4;
|
||||
|
||||
// static helper method
|
||||
static btVector3 getNormalizedVector(const btVector3& v) {
|
||||
|
@ -363,18 +362,15 @@ void CharacterController::scanDown(btCollisionWorld* world) {
|
|||
|
||||
btVector3 start = _currentPosition;
|
||||
const btScalar MAX_SCAN_HEIGHT = 20.0f + _halfHeight + _radius; // closest possible floor for disabling hover
|
||||
const btScalar MIN_HOVER_HEIGHT = 2.0f + _halfHeight + _radius; // distance to floor for enabling hover
|
||||
const btScalar MIN_HOVER_HEIGHT = 3.0f + _halfHeight + _radius; // distance to floor for enabling hover
|
||||
btVector3 end = start - MAX_SCAN_HEIGHT * _currentUp;
|
||||
|
||||
world->rayTest(start, end, callback);
|
||||
if (!callback.hasHit()) {
|
||||
_isHovering = true;
|
||||
} else if (_isHovering &&
|
||||
callback.m_closestHitFraction * MAX_SCAN_HEIGHT < MIN_HOVER_HEIGHT &&
|
||||
(_pendingFlags & PENDING_FLAG_STOP_HOVER)) {
|
||||
} else if (_isHovering && callback.m_closestHitFraction * MAX_SCAN_HEIGHT < MIN_HOVER_HEIGHT) {
|
||||
_isHovering = false;
|
||||
}
|
||||
_pendingFlags &= ~ PENDING_FLAG_STOP_HOVER;
|
||||
}
|
||||
|
||||
void CharacterController::stepUp(btCollisionWorld* world) {
|
||||
|
@ -711,10 +707,6 @@ void CharacterController::jump() {
|
|||
}
|
||||
}
|
||||
|
||||
void CharacterController::stopHover() {
|
||||
_pendingFlags |= PENDING_FLAG_STOP_HOVER;
|
||||
}
|
||||
|
||||
void CharacterController::setGravity(btScalar gravity) {
|
||||
_gravity = gravity;
|
||||
}
|
||||
|
|
|
@ -148,8 +148,6 @@ public:
|
|||
virtual void jump();
|
||||
virtual bool onGround() const;
|
||||
|
||||
void stopHover();
|
||||
|
||||
void setMaxFallSpeed(btScalar speed);
|
||||
void setJumpSpeed(btScalar jumpSpeed);
|
||||
void setMaxJumpHeight(btScalar maxJumpHeight);
|
||||
|
|
Loading…
Reference in a new issue