mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 06:19:02 +02:00
21384: Initial Disable Flying
This commit is contained in:
parent
15a5464bab
commit
53fe5736d8
2 changed files with 14 additions and 3 deletions
|
@ -590,7 +590,7 @@ void MyAvatar::simulate(float deltaTime) {
|
||||||
auto entityTreeRenderer = qApp->getEntities();
|
auto entityTreeRenderer = qApp->getEntities();
|
||||||
EntityTreePointer entityTree = entityTreeRenderer ? entityTreeRenderer->getTree() : nullptr;
|
EntityTreePointer entityTree = entityTreeRenderer ? entityTreeRenderer->getTree() : nullptr;
|
||||||
if (entityTree) {
|
if (entityTree) {
|
||||||
bool flyingAllowed = true;
|
bool flyingAllowed = true && _enableFlying;
|
||||||
bool collisionlessAllowed = true;
|
bool collisionlessAllowed = true;
|
||||||
entityTree->withWriteLock([&] {
|
entityTree->withWriteLock([&] {
|
||||||
std::shared_ptr<ZoneEntityItem> zone = entityTreeRenderer->myAvatarZone();
|
std::shared_ptr<ZoneEntityItem> zone = entityTreeRenderer->myAvatarZone();
|
||||||
|
@ -2467,6 +2467,14 @@ void MyAvatar::updateMotionBehaviorFromMenu() {
|
||||||
setCollisionsEnabled(menu->isOptionChecked(MenuOption::EnableAvatarCollisions));
|
setCollisionsEnabled(menu->isOptionChecked(MenuOption::EnableAvatarCollisions));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyAvatar::setFlyingEnabled(bool enabled) {
|
||||||
|
if (QThread::currentThread() != thread()) {
|
||||||
|
QMetaObject::invokeMethod(this, "setFlyingEnabled", Q_ARG(bool, enabled));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_enableFlying = enabled;
|
||||||
|
}
|
||||||
void MyAvatar::setCollisionsEnabled(bool enabled) {
|
void MyAvatar::setCollisionsEnabled(bool enabled) {
|
||||||
|
|
||||||
if (QThread::currentThread() != thread()) {
|
if (QThread::currentThread() != thread()) {
|
||||||
|
|
|
@ -491,6 +491,8 @@ public:
|
||||||
|
|
||||||
bool hasDriveInput() const;
|
bool hasDriveInput() const;
|
||||||
|
|
||||||
|
Q_INVOKABLE void setFlyingEnabled(bool enabled);
|
||||||
|
|
||||||
Q_INVOKABLE void setCollisionsEnabled(bool enabled);
|
Q_INVOKABLE void setCollisionsEnabled(bool enabled);
|
||||||
Q_INVOKABLE bool getCollisionsEnabled();
|
Q_INVOKABLE bool getCollisionsEnabled();
|
||||||
Q_INVOKABLE void setCharacterControllerEnabled(bool enabled); // deprecated
|
Q_INVOKABLE void setCharacterControllerEnabled(bool enabled); // deprecated
|
||||||
|
@ -552,7 +554,8 @@ public slots:
|
||||||
void setEnableDebugDrawSensorToWorldMatrix(bool isEnabled);
|
void setEnableDebugDrawSensorToWorldMatrix(bool isEnabled);
|
||||||
void setEnableDebugDrawIKTargets(bool isEnabled);
|
void setEnableDebugDrawIKTargets(bool isEnabled);
|
||||||
void setEnableDebugDrawIKConstraints(bool isEnabled);
|
void setEnableDebugDrawIKConstraints(bool isEnabled);
|
||||||
void setEnableDebugDrawIKChains(bool isEnabled);
|
void setEnableDebugDrawIKChains(bool isEnabled);
|
||||||
|
|
||||||
bool getEnableMeshVisible() const { return _skeletonModel->isVisible(); }
|
bool getEnableMeshVisible() const { return _skeletonModel->isVisible(); }
|
||||||
void setEnableMeshVisible(bool isEnabled);
|
void setEnableMeshVisible(bool isEnabled);
|
||||||
void setUseAnimPreAndPostRotations(bool isEnabled);
|
void setUseAnimPreAndPostRotations(bool isEnabled);
|
||||||
|
@ -625,6 +628,7 @@ private:
|
||||||
std::array<float, MAX_DRIVE_KEYS> _driveKeys;
|
std::array<float, MAX_DRIVE_KEYS> _driveKeys;
|
||||||
std::bitset<MAX_DRIVE_KEYS> _disabledDriveKeys;
|
std::bitset<MAX_DRIVE_KEYS> _disabledDriveKeys;
|
||||||
|
|
||||||
|
bool _enableFlying { true };
|
||||||
bool _wasPushing { false };
|
bool _wasPushing { false };
|
||||||
bool _isPushing { false };
|
bool _isPushing { false };
|
||||||
bool _isBeingPushed { false };
|
bool _isBeingPushed { false };
|
||||||
|
@ -767,7 +771,6 @@ private:
|
||||||
ThreadSafeValueCache<controller::Pose> _rightArmControllerPoseInSensorFrameCache{ controller::Pose() };
|
ThreadSafeValueCache<controller::Pose> _rightArmControllerPoseInSensorFrameCache{ controller::Pose() };
|
||||||
|
|
||||||
bool _hmdLeanRecenterEnabled = true;
|
bool _hmdLeanRecenterEnabled = true;
|
||||||
|
|
||||||
AnimPose _prePhysicsRoomPose;
|
AnimPose _prePhysicsRoomPose;
|
||||||
std::mutex _holdActionsMutex;
|
std::mutex _holdActionsMutex;
|
||||||
std::vector<AvatarActionHold*> _holdActions;
|
std::vector<AvatarActionHold*> _holdActions;
|
||||||
|
|
Loading…
Reference in a new issue