mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 04:42:20 +02:00
Fix code and warnings
This commit is contained in:
parent
015d1951fc
commit
6e4d1bde8e
4 changed files with 19 additions and 19 deletions
|
@ -6227,10 +6227,6 @@ void MyAvatar::setSitDriveKeysStatus(bool enabled) {
|
|||
}
|
||||
|
||||
void MyAvatar::beginSit(const glm::vec3& position, const glm::quat& rotation) {
|
||||
const QString ANIMATION_URL = PathUtils::defaultScriptsLocation().toString() + "/resources/animations/sittingIdle.fbx";
|
||||
const int ANIMATION_FPS = 30;
|
||||
const int ANIMATION_FIRST_FRAME = 1;
|
||||
const int ANIMATION_LAST_FRAME = 350;
|
||||
_characterController.setSeated(true);
|
||||
setCollisionsEnabled(false);
|
||||
setHMDLeanRecenterEnabled(false);
|
||||
|
@ -6241,20 +6237,19 @@ void MyAvatar::beginSit(const glm::vec3& position, const glm::quat& rotation) {
|
|||
clearPinOnJoint(hipIndex);
|
||||
goToLocation(position, true, rotation, false, false);
|
||||
pinJoint(hipIndex, position, rotation);
|
||||
_isSeated = true;
|
||||
}
|
||||
|
||||
void MyAvatar::endSit(const glm::vec3& position, const glm::quat& rotation) {
|
||||
clearPinOnJoint(getJointIndex("Hips"));
|
||||
_characterController.setSeated(false);
|
||||
_characterController.updateState();
|
||||
setCollisionsEnabled(true);
|
||||
setHMDLeanRecenterEnabled(true);
|
||||
centerBody();
|
||||
float STANDUP_BUMP = 0.225f;
|
||||
glm::vec3 currentPosition = getWorldPosition();
|
||||
currentPosition.y = currentPosition.y + STANDUP_BUMP;
|
||||
setWorldPosition(currentPosition);
|
||||
// Enable movement again
|
||||
setSitDriveKeysStatus(true);
|
||||
if (_characterController.getSeated()) {
|
||||
clearPinOnJoint(getJointIndex("Hips"));
|
||||
_characterController.setSeated(false);
|
||||
setCollisionsEnabled(true);
|
||||
setHMDLeanRecenterEnabled(true);
|
||||
centerBody();
|
||||
setWorldPosition(position);
|
||||
setWorldOrientation(rotation);
|
||||
// Enable movement again
|
||||
setSitDriveKeysStatus(true);
|
||||
}
|
||||
|
||||
}
|
|
@ -2554,7 +2554,6 @@ private:
|
|||
bool _isBeingPushed { false };
|
||||
bool _isBraking { false };
|
||||
bool _isAway { false };
|
||||
bool _isSeated { false };
|
||||
|
||||
float _boomLength { ZOOM_DEFAULT };
|
||||
float _yawSpeed; // degrees/sec
|
||||
|
|
|
@ -806,7 +806,7 @@ void CharacterController::updateState() {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case State::Hover:
|
||||
case State::Hover: {
|
||||
btScalar horizontalSpeed = (velocity - velocity.dot(_currentUp) * _currentUp).length();
|
||||
bool flyingFast = horizontalSpeed > (MAX_WALKING_SPEED * 0.75f);
|
||||
if (!_zoneFlyingAllowed) {
|
||||
|
@ -819,6 +819,11 @@ void CharacterController::updateState() {
|
|||
SET_STATE(State::Ground, "touching ground");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case State::Seated: {
|
||||
SET_STATE(State::Ground, "Standing up");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -137,6 +137,7 @@ public:
|
|||
|
||||
void setPendingFlagsUpdateCollisionMask(){ _pendingFlags |= PENDING_FLAG_UPDATE_COLLISION_MASK; }
|
||||
void setSeated(bool isSeated) { _isSeated = isSeated; }
|
||||
bool getSeated() { return _isSeated; }
|
||||
|
||||
protected:
|
||||
#ifdef DEBUG_STATE_CHANGE
|
||||
|
|
Loading…
Reference in a new issue