From 52acfc9333cb527dc97d940d65da976d1af1ab76 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Fri, 8 Nov 2019 14:22:04 -0800 Subject: [PATCH 01/22] Speculative fix for infinite loop in SafeLanding This PR containts two fixes. 1) Tightening up the locks in the SafeLanding class to prevent race conditions. By inspection there are cases where variables are read and modified outside of locks. 2) A check to help prevent an infinite loop in the _sequenceNumber std::distance calculation. This is the main issue, in some cases backtrace is reporting the main thread as deadlocked. The stacktrace points to an issue with the std::distance() calculation. If the EntityQueryInitialResultsComplete is delayed signficantly, there could be a rare case where the _sequenceNumber map grows large enough for the wraparound less then operator will no longer function correctly. This will cause the std::distance calculation to never complete. I've added a guard to prevent this from happening and some logs to help diagnose this issue in the future. --- interface/src/octree/SafeLanding.cpp | 77 ++++++++++++++++------------ interface/src/octree/SafeLanding.h | 4 +- 2 files changed, 46 insertions(+), 35 deletions(-) diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index fbc35f2732..bcf345bae8 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -39,6 +39,7 @@ bool SafeLanding::SequenceLessThan::operator()(const OCTREE_PACKET_SEQUENCE& a, void SafeLanding::startTracking(QSharedPointer entityTreeRenderer) { if (!entityTreeRenderer.isNull()) { + qCDebug(interfaceapp) << "SafeLanding has started tracking"; auto entityTree = entityTreeRenderer->getTree(); if (entityTree && !_trackingEntities) { Locker lock(_lock); @@ -104,47 +105,55 @@ void SafeLanding::updateTracking() { return; } - { - Locker lock(_lock); - bool enableInterstitial = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); - auto entityMapIter = _trackedEntities.begin(); - while (entityMapIter != _trackedEntities.end()) { - auto entity = entityMapIter->second; - bool isVisuallyReady = true; - if (enableInterstitial) { - auto entityRenderable = _entityTreeRenderer->renderableForEntityId(entityMapIter->first); - if (!entityRenderable) { - _entityTreeRenderer->addingEntity(entityMapIter->first); - } - isVisuallyReady = entity->isVisuallyReady() || (!entityRenderable && !entity->isParentPathComplete()); - } - if (isEntityPhysicsReady(entity) && isVisuallyReady) { - entityMapIter = _trackedEntities.erase(entityMapIter); - } else { - entityMapIter++; - } - } + Locker lock(_lock); + + bool enableInterstitial = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); + auto entityMapIter = _trackedEntities.begin(); + while (entityMapIter != _trackedEntities.end()) { + auto entity = entityMapIter->second; + bool isVisuallyReady = true; if (enableInterstitial) { - _trackedEntityStabilityCount++; + auto entityRenderable = _entityTreeRenderer->renderableForEntityId(entityMapIter->first); + if (!entityRenderable) { + _entityTreeRenderer->addingEntity(entityMapIter->first); + } + isVisuallyReady = entity->isVisuallyReady() || (!entityRenderable && !entity->isParentPathComplete()); } + if (isEntityPhysicsReady(entity) && isVisuallyReady) { + entityMapIter = _trackedEntities.erase(entityMapIter); + } else { + entityMapIter++; + } + } + if (enableInterstitial) { + _trackedEntityStabilityCount++; } if (_trackedEntities.empty()) { // no more tracked entities --> check sequenceNumbers if (_sequenceStart != SafeLanding::INVALID_SEQUENCE) { bool shouldStop = false; - { - Locker lock(_lock); - auto sequenceSize = _sequenceEnd - _sequenceStart; // this works even in rollover case - auto startIter = _sequenceNumbers.find(_sequenceStart); - auto endIter = _sequenceNumbers.find(_sequenceEnd - 1); + auto sequenceSize = _sequenceEnd - _sequenceStart; // this works even in rollover case + auto startIter = _sequenceNumbers.find(_sequenceStart); + auto endIter = _sequenceNumbers.find(_sequenceEnd - 1); - bool missingSequenceNumbers = qApp->isMissingSequenceNumbers(); - shouldStop = (sequenceSize == 0 || + bool missingSequenceNumbers = qApp->isMissingSequenceNumbers(); + + // If the EntityQueryInitialResultsComplete packet is really late due to packet loss, the + // _sequenceNumbers map will be filled with unnecessary sequence numbers. This can cause + // the main thread to enter an infinite loop in the std::distance() calculation. + // Try to guard against this. This might cause physics to be enabled too soon, but + // that is preferable to locking up. + bool tooManySequenceNumbers = _sequenceNumbers.size() >= (std::numeric_limits::max() / 2); + + qCDebug(interfaceapp) << "SafeLanding has no more tracked entities and" << _sequenceNumbers.size() << "sequence numbers"; + + shouldStop = (sequenceSize == 0 || (startIter != _sequenceNumbers.end() && endIter != _sequenceNumbers.end() && + !tooManySequenceNumbers && ((distance(startIter, endIter) == sequenceSize - 1) || !missingSequenceNumbers))); - } + if (shouldStop) { stopTracking(); } @@ -153,6 +162,8 @@ void SafeLanding::updateTracking() { } void SafeLanding::stopTracking() { + qCDebug(interfaceapp) << "SafeLanding has stopped tracking"; + Locker lock(_lock); if (_trackingEntities) { _trackingEntities = false; @@ -169,6 +180,7 @@ void SafeLanding::stopTracking() { } void SafeLanding::reset() { + Locker lock(_lock); _trackingEntities = false; _trackedEntities.clear(); _maxTrackedEntityCount = 0; @@ -177,6 +189,7 @@ void SafeLanding::reset() { } bool SafeLanding::trackingIsComplete() const { + Locker lock(_lock); return !_trackingEntities && (_sequenceStart != SafeLanding::INVALID_SEQUENCE); } @@ -241,10 +254,8 @@ void SafeLanding::debugDumpSequenceIDs() const { ++itr; while (itr != _sequenceNumbers.end()) { OCTREE_PACKET_SEQUENCE s = *itr; - if (s != p + 1) { - qCDebug(interfaceapp) << "Gap from" << (int32_t)p << "to" << (int32_t)s << "(exclusive)"; - p = s; - } + qCDebug(interfaceapp) << " " << (int32_t)s; + p = s; ++itr; } if (p != SafeLanding::INVALID_SEQUENCE) { diff --git a/interface/src/octree/SafeLanding.h b/interface/src/octree/SafeLanding.h index 00473f6fc8..d3131752bf 100644 --- a/interface/src/octree/SafeLanding.h +++ b/interface/src/octree/SafeLanding.h @@ -51,8 +51,8 @@ private: bool isEntityPhysicsReady(const EntityItemPointer& entity); void debugDumpSequenceIDs() const; - std::mutex _lock; - using Locker = std::lock_guard; + mutable std::recursive_mutex _lock; + using Locker = std::lock_guard; bool _trackingEntities { false }; QSharedPointer _entityTreeRenderer; using EntityMap = std::map; From 365b132c30ae394ef8066753ea6ba6a56337d4ef Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Tue, 12 Nov 2019 15:33:41 -0800 Subject: [PATCH 02/22] Bugfix for t-pose avatar when moving The android specific optimized IK animation graph was out of date, it was referencing animations that have been deleted, hence the t-pose. This PR updates and renames the android/optimized ik animation graph to the latest. --- .../avatar/avatar-animation-optimized-ik.json | 6665 +++++++++++++++++ .../avatar-animation_withSplineIKNode.json | 2229 ------ interface/src/avatar/MyAvatar.cpp | 2 +- 3 files changed, 6666 insertions(+), 2230 deletions(-) create mode 100644 interface/resources/avatar/avatar-animation-optimized-ik.json delete mode 100644 interface/resources/avatar/avatar-animation_withSplineIKNode.json diff --git a/interface/resources/avatar/avatar-animation-optimized-ik.json b/interface/resources/avatar/avatar-animation-optimized-ik.json new file mode 100644 index 0000000000..c69863b190 --- /dev/null +++ b/interface/resources/avatar/avatar-animation-optimized-ik.json @@ -0,0 +1,6665 @@ +{ + "root": { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + ], + "data": { + }, + "id": "defaultPose", + "type": "defaultPose" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 0, + "loopFlag": true, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/hydra_pose_open_right.fbx" + }, + "id": "rightHandGraspOpen", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 0, + "loopFlag": true, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/hydra_pose_closed_right.fbx" + }, + "id": "rightHandGraspClosed", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "rightHandGraspAlpha" + }, + "id": "rightHandGrasp", + "type": "blendLinear" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 15, + "loopFlag": true, + "startFrame": 15, + "timeScale": 1, + "url": "qrc:///avatar/animations/touch_point_open_right.fbx" + }, + "id": "rightIndexPointOpen", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 15, + "loopFlag": true, + "startFrame": 15, + "timeScale": 1, + "url": "qrc:///avatar/animations/touch_point_closed_right.fbx" + }, + "id": "rightIndexPointClosed", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "rightHandGraspAlpha" + }, + "id": "rightIndexPoint", + "type": "blendLinear" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 15, + "loopFlag": true, + "startFrame": 15, + "timeScale": 1, + "url": "qrc:///avatar/animations/touch_thumb_open_right.fbx" + }, + "id": "rightThumbRaiseOpen", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 15, + "loopFlag": true, + "startFrame": 15, + "timeScale": 1, + "url": "qrc:///avatar/animations/touch_thumb_closed_right.fbx" + }, + "id": "rightThumbRaiseClosed", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "rightHandGraspAlpha" + }, + "id": "rightThumbRaise", + "type": "blendLinear" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 15, + "loopFlag": true, + "startFrame": 15, + "timeScale": 1, + "url": "qrc:///avatar/animations/touch_thumb_point_open_right.fbx" + }, + "id": "rightIndexPointAndThumbRaiseOpen", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 15, + "loopFlag": true, + "startFrame": 15, + "timeScale": 1, + "url": "qrc:///avatar/animations/touch_thumb_point_closed_right.fbx" + }, + "id": "rightIndexPointAndThumbRaiseClosed", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "rightHandGraspAlpha" + }, + "id": "rightIndexPointAndThumbRaise", + "type": "blendLinear" + } + ], + "data": { + "currentState": "rightHandGrasp", + "states": [ + { + "id": "rightHandGrasp", + "interpDuration": 3, + "interpTarget": 3, + "transitions": [ + { + "state": "rightIndexPoint", + "var": "isRightIndexPoint" + }, + { + "state": "rightThumbRaise", + "var": "isRightThumbRaise" + }, + { + "state": "rightIndexPointAndThumbRaise", + "var": "isRightIndexPointAndThumbRaise" + } + ] + }, + { + "id": "rightIndexPoint", + "interpDuration": 3, + "interpTarget": 15, + "transitions": [ + { + "state": "rightHandGrasp", + "var": "isRightHandGrasp" + }, + { + "state": "rightThumbRaise", + "var": "isRightThumbRaise" + }, + { + "state": "rightIndexPointAndThumbRaise", + "var": "isRightIndexPointAndThumbRaise" + } + ] + }, + { + "id": "rightThumbRaise", + "interpDuration": 3, + "interpTarget": 15, + "transitions": [ + { + "state": "rightHandGrasp", + "var": "isRightHandGrasp" + }, + { + "state": "rightIndexPoint", + "var": "isRightIndexPoint" + }, + { + "state": "rightIndexPointAndThumbRaise", + "var": "isRightIndexPointAndThumbRaise" + } + ] + }, + { + "id": "rightIndexPointAndThumbRaise", + "interpDuration": 3, + "interpTarget": 15, + "transitions": [ + { + "state": "rightHandGrasp", + "var": "isRightHandGrasp" + }, + { + "state": "rightIndexPoint", + "var": "isRightIndexPoint" + }, + { + "state": "rightThumbRaise", + "var": "isRightThumbRaise" + } + ] + } + ] + }, + "id": "rightHandStateMachine", + "type": "stateMachine" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 0, + "loopFlag": true, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/hydra_pose_open_left.fbx" + }, + "id": "leftHandGraspOpen", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 10, + "loopFlag": true, + "startFrame": 10, + "timeScale": 1, + "url": "qrc:///avatar/animations/hydra_pose_closed_left.fbx" + }, + "id": "leftHandGraspClosed", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "leftHandGraspAlpha" + }, + "id": "leftHandGrasp", + "type": "blendLinear" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 15, + "loopFlag": true, + "startFrame": 15, + "timeScale": 1, + "url": "qrc:///avatar/animations/touch_point_open_left.fbx" + }, + "id": "leftIndexPointOpen", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 15, + "loopFlag": true, + "startFrame": 15, + "timeScale": 1, + "url": "qrc:///avatar/animations/touch_point_closed_left.fbx" + }, + "id": "leftIndexPointClosed", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "leftHandGraspAlpha" + }, + "id": "leftIndexPoint", + "type": "blendLinear" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 15, + "loopFlag": true, + "startFrame": 15, + "timeScale": 1, + "url": "qrc:///avatar/animations/touch_thumb_open_left.fbx" + }, + "id": "leftThumbRaiseOpen", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 15, + "loopFlag": true, + "startFrame": 15, + "timeScale": 1, + "url": "qrc:///avatar/animations/touch_thumb_closed_left.fbx" + }, + "id": "leftThumbRaiseClosed", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "leftHandGraspAlpha" + }, + "id": "leftThumbRaise", + "type": "blendLinear" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 15, + "loopFlag": true, + "startFrame": 15, + "timeScale": 1, + "url": "qrc:///avatar/animations/touch_thumb_point_open_left.fbx" + }, + "id": "leftIndexPointAndThumbRaiseOpen", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 15, + "loopFlag": true, + "startFrame": 15, + "timeScale": 1, + "url": "qrc:///avatar/animations/touch_thumb_point_closed_left.fbx" + }, + "id": "leftIndexPointAndThumbRaiseClosed", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "leftHandGraspAlpha" + }, + "id": "leftIndexPointAndThumbRaise", + "type": "blendLinear" + } + ], + "data": { + "currentState": "leftHandGrasp", + "states": [ + { + "id": "leftHandGrasp", + "interpDuration": 3, + "interpTarget": 3, + "transitions": [ + { + "state": "leftIndexPoint", + "var": "isLeftIndexPoint" + }, + { + "state": "leftThumbRaise", + "var": "isLeftThumbRaise" + }, + { + "state": "leftIndexPointAndThumbRaise", + "var": "isLeftIndexPointAndThumbRaise" + } + ] + }, + { + "id": "leftIndexPoint", + "interpDuration": 3, + "interpTarget": 15, + "transitions": [ + { + "state": "leftHandGrasp", + "var": "isLeftHandGrasp" + }, + { + "state": "leftThumbRaise", + "var": "isLeftThumbRaise" + }, + { + "state": "leftIndexPointAndThumbRaise", + "var": "isLeftIndexPointAndThumbRaise" + } + ] + }, + { + "id": "leftThumbRaise", + "interpDuration": 3, + "interpTarget": 15, + "transitions": [ + { + "state": "leftHandGrasp", + "var": "isLeftHandGrasp" + }, + { + "state": "leftIndexPoint", + "var": "isLeftIndexPoint" + }, + { + "state": "leftIndexPointAndThumbRaise", + "var": "isLeftIndexPointAndThumbRaise" + } + ] + }, + { + "id": "leftIndexPointAndThumbRaise", + "interpDuration": 3, + "interpTarget": 15, + "transitions": [ + { + "state": "leftHandGrasp", + "var": "isLeftHandGrasp" + }, + { + "state": "leftIndexPoint", + "var": "isLeftIndexPoint" + }, + { + "state": "leftThumbRaise", + "var": "isLeftThumbRaise" + } + ] + } + ] + }, + "id": "leftHandStateMachine", + "type": "stateMachine" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 271, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_talk02.fbx" + }, + "id": "seatedTalk02", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 252, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_talk03.fbx" + }, + "id": "seatedTalk03", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 442, + "loopFlag": true, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_talk04.fbx" + }, + "id": "seatedTalk04", + "type": "clip" + } + ], + "data": { + "currentState": "seatedTalk02", + "randomSwitchTimeMax": 12, + "randomSwitchTimeMin": 7, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "seatedTalk02", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": 1, + "resume": true, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedTalk03", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": 1, + "resume": true, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedTalk04", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": 1, + "resume": true, + "transitions": [ + ] + } + ], + "triggerRandomSwitch": "seatedTalkSwitch" + }, + "id": "seatedTalk", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 800, + "loopFlag": true, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle.fbx" + }, + "id": "seatedIdle01", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 800, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle02.fbx" + }, + "id": "seatedIdle02", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 800, + "loopFlag": true, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle03.fbx" + }, + "id": "seatedIdle03", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 800, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle04.fbx" + }, + "id": "seatedIdle04", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 332, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle05.fbx" + }, + "id": "seatedIdle05", + "type": "clip" + } + ], + "data": { + "currentState": "seatedIdle01", + "endFrame": 30, + "randomSwitchTimeMax": 40, + "randomSwitchTimeMin": 10, + "startFrame": 10, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "seatedIdle01", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": 1, + "resume": true, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedIdle02", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": 1, + "resume": true, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedIdle03", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": 1, + "resume": true, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedIdle04", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": 1, + "resume": true, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedIdle05", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": 1, + "resume": true, + "transitions": [ + ] + } + ], + "timeScale": 1, + "triggerRandomSwitch": "seatedIdleSwitch", + "triggerTimeMax": 10 + }, + "id": "masterSeatedIdle", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 744, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_once_shifting.fbx" + }, + "id": "seatedFidgetShifting", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 420, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_once_lookfidget.fbx" + }, + "id": "seatedFidgetLookFidget", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 282, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_once_shiftweight.fbx" + }, + "id": "seatedFidgetShiftWeight", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 428, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_once_fidget.fbx" + }, + "id": "seatedFidgeting", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 324, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_once_lookaround.fbx" + }, + "id": "seatedFidgetLookAround", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 120, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_once_lookleftright.fbx" + }, + "id": "seatedFidgetLookLeftRight", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 178, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_once_leanforward.fbx" + }, + "id": "seatedFidgetLeanForward", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 140, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_once_shakelegs.fbx" + }, + "id": "seatedFidgetShakeLegs", + "type": "clip" + } + ], + "data": { + "currentState": "seatedFidgetShifting", + "states": [ + { + "easingType": "easeInOutQuad", + "id": "seatedFidgetShifting", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedFidgetLookFidget", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedFidgetShiftWeight", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedFidgeting", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedFidgetLookAround", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedFidgetLookLeftRight", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedFidgetLeanForward", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedFidgetShakeLegs", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + } + ] + }, + "id": "seatedFidget", + "type": "randomSwitchStateMachine" + } + ], + "data": { + "currentState": "masterSeatedIdle", + "randomSwitchTimeMax": 20, + "randomSwitchTimeMin": 10, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "masterSeatedIdle", + "interpDuration": 20, + "interpTarget": 20, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedFidget", + "var": "timeToSeatedFidget" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedFidget", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": -1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "masterSeatedIdle", + "var": "seatedFidgetShiftingOnDone" + }, + { + "randomSwitchState": "masterSeatedIdle", + "var": "seatedFidgetLookFidgetOnDone" + }, + { + "randomSwitchState": "masterSeatedIdle", + "var": "seatedFidgetShiftWeightOnDone" + }, + { + "randomSwitchState": "masterSeatedIdle", + "var": "seatedFidgetingOnDone" + }, + { + "randomSwitchState": "masterSeatedIdle", + "var": "seatedFidgetLookAroundOnDone" + }, + { + "randomSwitchState": "masterSeatedIdle", + "var": "seatedFidgetLookLeftRightOnDone" + }, + { + "randomSwitchState": "masterSeatedIdle", + "var": "seatedFidgetLeanForwardOnDone" + }, + { + "randomSwitchState": "masterSeatedIdle", + "var": "seatedFidgetShakeLegsOnDone" + } + ] + } + ], + "transitionVar": "timeToSeatedFidget", + "triggerRandomSwitch": "", + "triggerTimeMax": 45, + "triggerTimeMin": 10 + }, + "id": "seatedIdle", + "type": "randomSwitchStateMachine" + } + ], + "data": { + "alpha": 1, + "alphaVar": "talkOverlayAlpha", + "boneSet": "upperBody" + }, + "id": "seatedTalkOverlay", + "type": "overlay" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 44, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_agree_headnod.fbx" + }, + "id": "seatedReactionPositiveHeadNod", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 78, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_agree_headnodyes.fbx" + }, + "id": "seatedReactionPositiveHeadNodYes", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 65, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_agree_longheadnod.fbx" + }, + "id": "seatedReactionPositiveLongHeadNod", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 78, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_agree_cheer.fbx" + }, + "id": "seatedReactionPositiveCheer", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 64, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_agree_acknowledge.fbx" + }, + "id": "seatedReactionPositiveAcknowledge", + "type": "clip" + } + ], + "data": { + "currentState": "seatedReactionPositiveHeadNod", + "endFrame": 30, + "loopFlag": false, + "randomSwitchTimeMax": 12, + "randomSwitchTimeMin": 7, + "startFrame": 0, + "states": [ + { + "id": "seatedReactionPositiveHeadNod", + "interpDuration": 1, + "interpTarget": 1, + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "id": "seatedReactionPositiveHeadNodYes", + "interpDuration": 1, + "interpTarget": 1, + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "id": "seatedReactionPositiveLongHeadNod", + "interpDuration": 1, + "interpTarget": 1, + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "id": "seatedReactionPositiveCheer", + "interpDuration": 1, + "interpTarget": 1, + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "id": "seatedReactionPositiveAcknowledge", + "interpDuration": 1, + "interpTarget": 1, + "priority": 1, + "resume": false, + "transitions": [ + ] + } + ], + "timeScale": 1, + "triggerRandomSwitch": "", + "url": "qrc:///avatar/animations/sitting_idle.fbx" + }, + "id": "seatedReactionPositive", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 64, + "loopFlag": false, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_disagree_headshake.fbx" + }, + "id": "seatedReactionNegativeDisagreeHeadshake", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 99, + "loopFlag": false, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_disagree_drophead.fbx" + }, + "id": "seatedReactionNegativeDisagreeDropHead", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 124, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_disagree_disbelief.fbx" + }, + "id": "seatedReactionNegativeDisagreeDisbelief", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 70, + "loopFlag": false, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_disagree_dismiss.fbx" + }, + "id": "seatedReactionNegativeDisagreeDismiss", + "type": "clip" + } + ], + "data": { + "currentState": "seatedReactionNegativeDisagreeHeadshake", + "endFrame": 30, + "loopFlag": false, + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "startFrame": 0, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "seatedReactionNegativeDisagreeHeadshake", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionNegativeDisagreeDropHead", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionNegativeDisagreeDisbelief", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionNegativeDisagreeDismiss", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + } + ], + "timeScale": 1, + "triggerRandomSwitch": "", + "url": "qrc:///avatar/animations/sitting_idle.fbx" + }, + "id": "seatedReactionNegative", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 32, + "loopFlag": false, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_raisehand_all.fbx" + }, + "id": "seatedReactionRaiseHandIntro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 345, + "loopFlag": true, + "startFrame": 32, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_raisehand_all.fbx" + }, + "id": "seatedReactionRaiseHandLoop", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 400, + "loopFlag": false, + "startFrame": 345, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_raisehand_all.fbx" + }, + "id": "seatedReactionRaiseHandOutro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 18, + "loopFlag": false, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_raisehand02_all.fbx" + }, + "id": "seatedReactionRaiseHand02Intro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 378, + "loopFlag": true, + "startFrame": 18, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_raisehand02_all.fbx" + }, + "id": "seatedReactionRaiseHand02Loop", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 435, + "loopFlag": false, + "startFrame": 378, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_raisehand02_all.fbx" + }, + "id": "seatedReactionRaiseHand02Outro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 15, + "loopFlag": false, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_raisehand03_all.fbx" + }, + "id": "seatedReactionRaiseHand03Intro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 233, + "loopFlag": true, + "mirrorFlag": false, + "startFrame": 15, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_raisehand03_all.fbx" + }, + "id": "seatedReactionRaiseHand03Loop", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 296, + "loopFlag": false, + "mirrorFlag": false, + "startFrame": 233, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_raisehand03_all.fbx" + }, + "id": "seatedReactionRaiseHand03Outro", + "type": "clip" + } + ], + "data": { + "currentState": "seatedReactionRaiseHandIntro", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "seatedReactionRaiseHandIntro", + "interpDuration": 8, + "interpTarget": 9, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionRaiseHandLoop", + "var": "seatedReactionRaiseHandIntroOnDone" + } + ] + }, + { + "id": "seatedReactionRaiseHandLoop", + "interpDuration": 1, + "interpTarget": 1, + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionRaiseHandOutro", + "var": "reactionRaiseHandDisabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionRaiseHandOutro", + "interpDuration": 12, + "interpTarget": 12, + "interpType": "evaluateBoth", + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionRaiseHandLoop", + "var": "reactionRaiseHandEnabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionRaiseHand02Intro", + "interpDuration": 8, + "interpTarget": 8, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionRaiseHand02Loop", + "var": "seatedReactionRaiseHand02IntroOnDone" + } + ] + }, + { + "id": "seatedReactionRaiseHand02Loop", + "interpDuration": 1, + "interpTarget": 1, + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionRaiseHand02Outro", + "var": "reactionRaiseHandDisabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionRaiseHand02Outro", + "interpDuration": 12, + "interpTarget": 12, + "interpType": "evaluateBoth", + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionRaiseHand02Loop", + "var": "reactionRaiseHandEnabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionRaiseHand03Intro", + "interpDuration": 8, + "interpTarget": 8, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionRaiseHand03Loop", + "var": "seatedReactionRaiseHand03IntroOnDone" + } + ] + }, + { + "id": "seatedReactionRaiseHand03Loop", + "interpDuration": 1, + "interpTarget": 1, + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionRaiseHand03Outro", + "var": "reactionRaiseHandDisabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionRaiseHand03Outro", + "interpDuration": 12, + "interpTarget": 12, + "interpType": "evaluateBoth", + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionRaiseHand03Loop", + "var": "reactionRaiseHandEnabled" + } + ] + } + ], + "triggerRandomSwitch": "" + }, + "id": "seatedReactionRaiseHand", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 12, + "loopFlag": false, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_clap_all.fbx" + }, + "id": "seatedReactionApplaudIntro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 76, + "loopFlag": true, + "startFrame": 12, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_clap_all.fbx" + }, + "id": "seatedReactionApplaudLoop", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 99, + "loopFlag": false, + "startFrame": 76, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_clap_all.fbx" + }, + "id": "seatedReactionApplaudOutro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 12, + "loopFlag": false, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_clap02_all.fbx" + }, + "id": "seatedReactionApplaud02Intro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 112, + "loopFlag": true, + "startFrame": 12, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_clap02_all.fbx" + }, + "id": "seatedReactionApplaud02Loop", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 132, + "loopFlag": false, + "startFrame": 112, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_clap02_all.fbx" + }, + "id": "seatedReactionApplaud02Outro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 17, + "loopFlag": false, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_clap03_all.fbx" + }, + "id": "seatedReactionApplaud03Intro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 111, + "loopFlag": true, + "startFrame": 17, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_clap03_all.fbx" + }, + "id": "seatedReactionApplaud03Loop", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 136, + "loopFlag": false, + "startFrame": 111, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_clap03_all.fbx" + }, + "id": "seatedReactionApplaud03Outro", + "type": "clip" + } + ], + "data": { + "currentState": "seatedReactionApplaudIntro", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "seatedReactionApplaudIntro", + "interpDuration": 8, + "interpTarget": 8, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionApplaudLoop", + "var": "seatedReactionApplaudIntroOnDone" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionApplaudLoop", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionApplaudOutro", + "var": "reactionApplaudDisabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionApplaudOutro", + "interpDuration": 12, + "interpTarget": 12, + "interpType": "evaluateBoth", + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionApplaudLoop", + "var": "reactionApplaudEnabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionApplaud02Intro", + "interpDuration": 8, + "interpTarget": 8, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionApplaud02Loop", + "var": "seatedReactionApplaud02IntroOnDone" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionApplaud02Loop", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionApplaud02Outro", + "var": "reactionApplaudDisabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionApplaud02Outro", + "interpDuration": 12, + "interpTarget": 12, + "interpType": "evaluateBoth", + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionApplaud02Loop", + "var": "reactionApplaudEnabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionApplaud03Intro", + "interpDuration": 8, + "interpTarget": 8, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionApplaud03Loop", + "var": "seatedReactionApplaud03IntroOnDone" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionApplaud03Loop", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionApplaud03Outro", + "var": "reactionApplaudDisabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionApplaud03Outro", + "interpDuration": 12, + "interpTarget": 12, + "interpType": "evaluateBoth", + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionApplaud03Loop", + "var": "reactionApplaudEnabled" + } + ] + } + ], + "triggerRandomSwitch": "" + }, + "id": "seatedReactionApplaud", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 21, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_point_all.fbx" + }, + "id": "seatedReactionPointIntro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 100, + "loopFlag": true, + "startFrame": 21, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_point_all.fbx" + }, + "id": "seatedReactionPointLoop", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 134, + "loopFlag": false, + "mirrorFlag": false, + "startFrame": 100, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_point_all.fbx" + }, + "id": "seatedReactionPointOutro", + "type": "clip" + } + ], + "data": { + "currentState": "seatedReactionPointIntro", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "seatedReactionPointIntro", + "interpDuration": 18, + "interpTarget": 18, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionPointLoop", + "var": "seatedReactionPointIntroOnDone" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionPointLoop", + "interpDuration": 18, + "interpTarget": 18, + "interpType": "evaluateBoth", + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionPointOutro", + "var": "reactionPointDisabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionPointOutro", + "interpDuration": 18, + "interpTarget": 18, + "interpType": "evaluateBoth", + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "seatedReactionPointLoop", + "var": "reactionPointEnabled" + } + ] + } + ], + "triggerRandomSwitch": "" + }, + "id": "seatedReactionPoint", + "type": "randomSwitchStateMachine" + } + ], + "data": { + "alpha": 0, + "alphaVar": "seatedPointBlendAlpha", + "blendType": "addAbsolute" + }, + "id": "seatedReactionPointBase", + "type": "blendLinear" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 11, + "loopFlag": true, + "startFrame": 11, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx" + }, + "id": "seatedPointLeft", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 30, + "loopFlag": true, + "startFrame": 30, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx" + }, + "id": "seatedPointRight", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 50, + "loopFlag": true, + "startFrame": 50, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx" + }, + "id": "seatedPointUp", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 70, + "loopFlag": true, + "startFrame": 70, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx" + }, + "id": "seatedPointDown", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 90, + "loopFlag": true, + "startFrame": 90, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx" + }, + "id": "seatedPointUpLeft", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 110, + "loopFlag": true, + "startFrame": 110, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx" + }, + "id": "seatedPointUpRight", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 130, + "loopFlag": true, + "startFrame": 130, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx" + }, + "id": "seatedPointDownLeft", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 150, + "loopFlag": true, + "startFrame": 150, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx" + }, + "id": "seatedPointDownRight", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 3, + "loopFlag": true, + "startFrame": 3, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_emote_point_aimoffsets.fbx" + }, + "id": "seatedPointCenter", + "type": "clip" + } + ], + "data": { + "alpha": [ + 0, + 0, + 0 + ], + "alphaVar": "pointAroundAlpha", + "centerId": "seatedPointCenter", + "downId": "seatedPointDown", + "downLeftId": "seatedPointDownLeft", + "downRightId": "seatedPointDownRight", + "leftId": "seatedPointLeft", + "rightId": "seatedPointRight", + "upId": "seatedPointUp", + "upLeftId": "seatedPointUpLeft", + "upRightId": "seatedPointUpRight" + }, + "id": "seatedPointAround", + "type": "blendDirectional" + } + ], + "data": { + "alpha": 0, + "alphaVar": "pointBlendAlpha", + "blendType": "addAbsolute" + }, + "id": "seatedReactionPoint", + "type": "blendLinear" + } + ], + "data": { + "currentState": "seatedTalkOverlay", + "states": [ + { + "easingType": "easeInOutQuad", + "id": "seatedTalkOverlay", + "interpDuration": 25, + "interpTarget": 25, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "seatedReactionPositive", + "var": "reactionPositiveTrigger" + }, + { + "state": "seatedReactionNegative", + "var": "reactionNegativeTrigger" + }, + { + "state": "seatedReactionRaiseHand", + "var": "reactionRaiseHandEnabled" + }, + { + "state": "seatedReactionApplaud", + "var": "reactionApplaudEnabled" + }, + { + "state": "seatedReactionPoint", + "var": "reactionPointEnabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionPositive", + "interpDuration": 12, + "interpTarget": 12, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "seatedTalkOverlay", + "var": "seatedReactionPositiveHeadNodOnDone" + }, + { + "state": "seatedTalkOverlay", + "var": "seatedReactionPositiveHeadNodYesOnDone" + }, + { + "state": "seatedTalkOverlay", + "var": "seatedReactionPositiveLongHeadNodOnDone" + }, + { + "state": "seatedTalkOverlay", + "var": "seatedReactionPositiveCheerOnDone" + }, + { + "state": "seatedTalkOverlay", + "var": "seatedReactionPositiveAcknowledgeOnDone" + }, + { + "state": "seatedReactionNegative", + "var": "reactionNegativeTrigger" + }, + { + "state": "seatedReactionRaiseHand", + "var": "reactionRaiseHandEnabled" + }, + { + "state": "seatedReactionApplaud", + "var": "reactionApplaudEnabled" + }, + { + "state": "seatedReactionPoint", + "var": "reactionPointEnabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionNegative", + "interpDuration": 12, + "interpTarget": 12, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "seatedReactionPositive", + "var": "reactionPositiveTrigger" + }, + { + "state": "seatedTalkOverlay", + "var": "seatedReactionNegativeDisagreeHeadshakeOnDone" + }, + { + "state": "seatedTalkOverlay", + "var": "seatedReactionNegativeDisagreeDropHeadOnDone" + }, + { + "state": "seatedTalkOverlay", + "var": "seatedReactionNegativeDisagreeDisbeliefOnDone" + }, + { + "state": "seatedTalkOverlay", + "var": "seatedReactionNegativeDisagreeDismissOnDone" + }, + { + "state": "seatedReactionRaiseHand", + "var": "reactionRaiseHandEnabled" + }, + { + "state": "seatedReactionApplaud", + "var": "reactionApplaudEnabled" + }, + { + "state": "seatedReactionPoint", + "var": "reactionPointEnabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionRaiseHand", + "interpDuration": 12, + "interpTarget": 12, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "seatedReactionNegative", + "var": "reactionNegativeTrigger" + }, + { + "state": "seatedReactionPositive", + "var": "reactionPositiveTrigger" + }, + { + "state": "seatedTalkOverlay", + "var": "reactionRaiseHandDisabled" + }, + { + "state": "seatedReactionApplaud", + "var": "reactionApplaudEnabled" + }, + { + "state": "seatedReactionPoint", + "var": "reactionPointEnabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionApplaud", + "interpDuration": 12, + "interpTarget": 12, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "seatedReactionNegative", + "var": "reactionNegativeTrigger" + }, + { + "state": "seatedReactionPositive", + "var": "reactionPositiveTrigger" + }, + { + "state": "seatedReactionRaiseHand", + "var": "reactionRaiseHandEnabled" + }, + { + "state": "seatedTalkOverlay", + "var": "reactionApplaudDisabled" + }, + { + "state": "seatedReactionPoint", + "var": "reactionPointEnabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "seatedReactionPoint", + "interpDuration": 12, + "interpTarget": 12, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "seatedReactionNegative", + "var": "reactionNegativeTrigger" + }, + { + "state": "seatedReactionPositive", + "var": "reactionPositiveTrigger" + }, + { + "state": "seatedReactionRaiseHand", + "var": "reactionRaiseHandEnabled" + }, + { + "state": "seatedReactionApplaud", + "var": "reactionApplaudEnabled" + }, + { + "state": "seatedTalkOverlay", + "var": "reactionPointDisabled" + } + ] + } + ] + }, + "id": "seatedSM", + "type": "stateMachine" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 11, + "loopFlag": true, + "startFrame": 11, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx" + }, + "id": "seatedLookLeft", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 30, + "loopFlag": true, + "startFrame": 30, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx" + }, + "id": "seatedLookRight", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 50, + "loopFlag": true, + "startFrame": 50, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx" + }, + "id": "seatedLookUp", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 70, + "loopFlag": true, + "startFrame": 70, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx" + }, + "id": "seatedLookDown", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 97, + "loopFlag": true, + "startFrame": 97, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx" + }, + "id": "seatedLookUpLeft", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 110, + "loopFlag": true, + "startFrame": 110, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx" + }, + "id": "seatedLookUpRight", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 130, + "loopFlag": true, + "startFrame": 130, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx" + }, + "id": "seatedLookDownLeft", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 150, + "loopFlag": true, + "startFrame": 150, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx" + }, + "id": "seatedLookDownRight", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 3, + "loopFlag": true, + "startFrame": 3, + "timeScale": 1, + "url": "qrc:///avatar/animations/sitting_idle_aimoffsets.fbx" + }, + "id": "seatedLookCenter", + "type": "clip" + } + ], + "data": { + "alpha": [ + 0, + 0, + 0 + ], + "alphaVar": "lookAroundAlpha", + "centerId": "seatedLookCenter", + "downId": "seatedLookDown", + "downLeftId": "seatedLookDownLeft", + "downRightId": "seatedLookDownRight", + "leftId": "seatedLookLeft", + "rightId": "seatedLookRight", + "upId": "seatedLookUp", + "upLeftId": "seatedLookUpLeft", + "upRightId": "seatedLookUpRight" + }, + "id": "seatedLookAroundBlend", + "type": "blendDirectional" + } + ], + "data": { + "alpha": 0, + "alphaVar": "seatedLookBlendAlpha", + "blendType": "addAbsolute" + }, + "id": "seated", + "type": "blendLinear" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 500, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/talk.fbx" + }, + "id": "talk", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 325, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/talk02.fbx" + }, + "id": "talk02", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 300, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/talk03.fbx" + }, + "id": "talk03", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 500, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/talk04.fbx" + }, + "id": "talk04", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 215, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/talk_armsdown.fbx" + }, + "id": "talk_armsdown", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 500, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/talk_lefthand.fbx" + }, + "id": "talk_lefthand", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 502, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/talk_righthand.fbx" + }, + "id": "talk_righthand", + "type": "clip" + } + ], + "data": { + "currentState": "talk", + "randomSwitchTimeMax": 12, + "randomSwitchTimeMin": 7, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "talk", + "interpDuration": 20, + "interpTarget": 20, + "interpType": "evaluateBoth", + "priority": 0.33, + "resume": true, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "talk02", + "interpDuration": 20, + "interpTarget": 20, + "interpType": "evaluateBoth", + "priority": 0.33, + "resume": true, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "talk03", + "interpDuration": 20, + "interpTarget": 20, + "interpType": "evaluateBoth", + "priority": 0.33, + "resume": true, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "talk04", + "interpDuration": 20, + "interpTarget": 20, + "interpType": "evaluateBoth", + "priority": 0.33, + "resume": true, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "talk_armsdown", + "interpDuration": 20, + "interpTarget": 20, + "interpType": "evaluateBoth", + "priority": 0.33, + "resume": true, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "talk_lefthand", + "interpDuration": 20, + "interpTarget": 20, + "interpType": "evaluateBoth", + "priority": 0.33, + "resume": true, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "talk_righthand", + "interpDuration": 20, + "interpTarget": 20, + "interpType": "evaluateBoth", + "priority": 0.33, + "resume": true, + "transitions": [ + ] + } + ], + "triggerRandomSwitch": "idleTalkSwitch" + }, + "id": "idleTalk", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 300, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle.fbx" + }, + "id": "masterIdle1", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 400, + "loopFlag": true, + "startFrame": 1, + "timeScale": 0.75, + "url": "qrc:///avatar/animations/idle02.fbx" + }, + "id": "masterIdle2", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 800, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle03.fbx" + }, + "id": "masterIdle3", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 902, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle04.fbx" + }, + "id": "masterIdle4", + "type": "clip" + } + ], + "data": { + "currentState": "masterIdle1", + "randomSwitchTimeMax": 30, + "randomSwitchTimeMin": 10, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "masterIdle1", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": 0.25, + "resume": true, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "masterIdle2", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": 0.25, + "resume": true, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "masterIdle3", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": 0.25, + "resume": true, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "masterIdle4", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": 0.25, + "resume": true, + "transitions": [ + ] + } + ], + "triggerRandomSwitch": "masterIdleSwitch" + }, + "id": "masterIdle", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 91, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_once_slownod.fbx" + }, + "id": "idle_once_slownod", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 154, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_once_headtilt.fbx" + }, + "id": "idle_once_headtilt", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 491, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_once_shiftheelpivot.fbx" + }, + "id": "idle_once_shiftheelpivot", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 1620, + "loopFlag": false, + "startFrame": 1, + "timeScale": 0.7, + "url": "qrc:///avatar/animations/idleWS_all.fbx" + }, + "id": "idleWS_all", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 324, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_once_lookaround.fbx" + }, + "id": "idle_once_lookaround", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 169, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_once_neckstretch.fbx" + }, + "id": "idle_once_neckstretch", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 375, + "loopFlag": false, + "startFrame": 1, + "timeScale": 0.7, + "url": "qrc:///avatar/animations/idle_once_lookleftright.fbx" + }, + "id": "idle_once_lookleftright", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 429, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_once_fidget.fbx" + }, + "id": "idle_once_fidget", + "type": "clip" + } + ], + "data": { + "currentState": "idle_once_slownod", + "states": [ + { + "easingType": "easeInOutQuad", + "id": "idle_once_slownod", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "evaluateBoth", + "priority": 0.2, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "idle_once_headtilt", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "evaluateBoth", + "priority": 0.2, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "idle_once_shiftheelpivot", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "evaluateBoth", + "priority": 0.2, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "idleWS_all", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "evaluateBoth", + "priority": 0.2, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "idle_once_lookaround", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "evaluateBoth", + "priority": 0.2, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "idle_once_neckstretch", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "evaluateBoth", + "priority": 0.2, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "idle_once_lookleftright", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "evaluateBoth", + "priority": 0.2, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "idle_once_fidget", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "evaluateBoth", + "priority": 0.2, + "resume": false, + "transitions": [ + ] + } + ] + }, + "id": "movement", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 80, + "loopFlag": false, + "startFrame": 1, + "startFrameVar": "", + "timeScale": 0.65, + "url": "qrc:///avatar/animations/idle_LFF_all.fbx" + }, + "id": "transitionToAltIdle1", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 80, + "loopFlag": false, + "startFrame": 1, + "timeScale": 0.65, + "url": "qrc:///avatar/animations/idle_RFF_all.fbx" + }, + "id": "transitionToAltIdle2", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 388, + "loopFlag": true, + "startFrame": 80, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_LFF_all.fbx" + }, + "id": "altIdle1", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 388, + "loopFlag": true, + "startFrame": 80, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_RFF_all.fbx" + }, + "id": "altIdle2", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 472, + "loopFlag": false, + "startFrame": 388, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_LFF_all.fbx" + }, + "id": "alt1ToMasterIdle", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 453, + "loopFlag": false, + "startFrame": 388, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_RFF_all.fbx" + }, + "id": "alt2ToMasterIdle", + "type": "clip" + } + ], + "data": { + "currentState": "transitionToAltIdle1", + "states": [ + { + "easingType": "easeInOutQuad", + "id": "transitionToAltIdle1", + "interpDuration": 20, + "interpTarget": 20, + "interpType": "evaluateBoth", + "priority": 0.5, + "resume": false, + "transitions": [ + { + "randomSwitchState": "altIdle1", + "var": "transitionToAltIdle1OnDone" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "transitionToAltIdle2", + "interpDuration": 20, + "interpTarget": 20, + "interpType": "evaluateBoth", + "priority": 0.5, + "resume": false, + "transitions": [ + { + "randomSwitchState": "altIdle2", + "var": "transitionToAltIdle2OnDone" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "altIdle1", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": -1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "alt1ToMasterIdle", + "var": "finishAltIdle2" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "altIdle2", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": -1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "alt2ToMasterIdle", + "var": "finishAltIdle2" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "alt1ToMasterIdle", + "interpDuration": 24, + "interpTarget": 24, + "interpType": "evaluateBoth", + "priority": -1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "alt2ToMasterIdle", + "interpDuration": 24, + "interpTarget": 24, + "interpType": "evaluateBoth", + "priority": -1, + "resume": false, + "transitions": [ + ] + } + ], + "transitionVar": "finishAltIdle2", + "triggerTimeMax": 60, + "triggerTimeMin": 10 + }, + "id": "alternateIdle", + "type": "randomSwitchStateMachine" + } + ], + "data": { + "currentState": "movement", + "states": [ + { + "easingType": "easeInOutQuad", + "id": "movement", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": 0.6, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "alternateIdle", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": 0.4, + "resume": false, + "transitions": [ + ] + } + ] + }, + "id": "fidget", + "type": "randomSwitchStateMachine" + } + ], + "data": { + "currentState": "masterIdle", + "states": [ + { + "easingType": "easeInOutQuad", + "id": "masterIdle", + "interpDuration": 30, + "interpTarget": 30, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "fidget", + "var": "timeToFidget" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "fidget", + "interpDuration": 20, + "interpTarget": 20, + "interpType": "evaluateBoth", + "priority": -1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "masterIdle", + "var": "idle_once_slownodOnDone" + }, + { + "randomSwitchState": "masterIdle", + "var": "idle_once_headtiltOnDone" + }, + { + "randomSwitchState": "masterIdle", + "var": "idle_once_shiftheelpivotOnDone" + }, + { + "randomSwitchState": "masterIdle", + "var": "idleWS_allOnDone" + }, + { + "randomSwitchState": "masterIdle", + "var": "idle_once_lookaroundOnDone" + }, + { + "randomSwitchState": "masterIdle", + "var": "idle_once_neckstretchOnDone" + }, + { + "randomSwitchState": "masterIdle", + "var": "idle_once_lookleftrightOnDone" + }, + { + "randomSwitchState": "masterIdle", + "var": "idle_once_fidgetOnDone" + }, + { + "randomSwitchState": "masterIdle", + "var": "alt1ToMasterIdleOnDone" + }, + { + "randomSwitchState": "masterIdle", + "var": "alt2ToMasterIdleOnDone" + } + ] + } + ], + "transitionVar": "timeToFidget", + "triggerTimeMax": 50, + "triggerTimeMin": 10 + }, + "id": "idleStand", + "type": "randomSwitchStateMachine" + } + ], + "data": { + "alpha": 1, + "alphaVar": "talkOverlayAlpha", + "boneSet": "upperBody" + }, + "id": "idleTalkOverlay", + "type": "overlay" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 64, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_agree_acknowledge.fbx" + }, + "id": "positiveAcknowledge", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 55, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_agree_headnod.fbx" + }, + "id": "positiveHeadNod", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 94, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_agree_headnodyes.fbx" + }, + "id": "positiveHeadNodYes", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 68, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_agree_longheadnod.fbx" + }, + "id": "positiveLongHeadNod", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 84, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_agree_thoughtfulheadnod.fbx" + }, + "id": "positiveThoughtfulHeadNod", + "type": "clip" + } + ], + "data": { + "currentState": "positiveAcknowledge", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "positiveAcknowledge", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "positiveHeadNod", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "positiveHeadNodYes", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "positiveLongHeadNod", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "positiveThoughtfulHeadNod", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 0.33, + "resume": false, + "transitions": [ + ] + } + ], + "triggerRandomSwitch": "" + }, + "id": "reactionPositive", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 72, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_disagree_annoyedheadshake.fbx" + }, + "id": "negativeAnnoyedHeadshake", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 84, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_disagree_thoughtfulheadshake.fbx" + }, + "id": "negativeThoughtfulHeadshake", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 100, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_disagree_drophead.fbx" + }, + "id": "negativeDropHead", + "type": "clip" + } + ], + "data": { + "currentState": "negativeAnnoyedHeadshake", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "negativeAnnoyedHeadshake", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "negativeThoughtfulHeadshake", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "negativeDropHead", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + } + ] + }, + "id": "reactionNegative", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 18, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_raisehand01_all.fbx" + }, + "id": "raiseHand01Intro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 378, + "loopFlag": true, + "startFrame": 18, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_raisehand01_all.fbx" + }, + "id": "raiseHand01Loop", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 435, + "loopFlag": false, + "startFrame": 378, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_raisehand01_all.fbx" + }, + "id": "raiseHand01Outro", + "type": "clip" + } + ], + "data": { + "currentState": "raiseHand01Intro", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "raiseHand01Intro", + "interpDuration": 10, + "interpTarget": 10, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "raiseHand01Loop", + "var": "raiseHand01IntroOnDone" + } + ] + }, + { + "id": "raiseHand01Loop", + "interpDuration": 1, + "interpTarget": 1, + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "raiseHand01Outro", + "var": "reactionRaiseHandDisabled" + } + ] + }, + { + "id": "raiseHand01Outro", + "interpDuration": 6, + "interpTarget": 6, + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "raiseHand01Loop", + "var": "reactionRaiseHandEnabled" + } + ] + } + ], + "triggerRandomSwitch": "" + }, + "id": "raiseHand01", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 19, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_raisehand03_all.fbx" + }, + "id": "raiseHand03Intro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 237, + "loopFlag": true, + "startFrame": 19, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_raisehand03_all.fbx" + }, + "id": "raiseHand03Loop", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 300, + "loopFlag": false, + "startFrame": 237, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_raisehand03_all.fbx" + }, + "id": "raiseHand03Outro", + "type": "clip" + } + ], + "data": { + "currentState": "raiseHand03Intro", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "raiseHand03Intro", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "raiseHand03Loop", + "var": "raiseHand03IntroOnDone" + } + ] + }, + { + "id": "raiseHand03Loop", + "interpDuration": 1, + "interpTarget": 1, + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "raiseHand03Outro", + "var": "reactionRaiseHandDisabled" + } + ] + }, + { + "id": "raiseHand03Outro", + "interpDuration": 6, + "interpTarget": 6, + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "raiseHand03Loop", + "var": "reactionRaiseHandEnabled" + } + ] + } + ], + "triggerRandomSwitch": "" + }, + "id": "raiseHand03", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 32, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_raisehand04_all.fbx" + }, + "id": "raiseHand04Intro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 345, + "loopFlag": true, + "startFrame": 32, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_raisehand04_all.fbx" + }, + "id": "raiseHand04Loop", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 400, + "loopFlag": false, + "startFrame": 345, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_raisehand04_all.fbx" + }, + "id": "raiseHand04Outro", + "type": "clip" + } + ], + "data": { + "currentState": "raiseHand04Intro", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "raiseHand04Intro", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "raiseHand04Loop", + "var": "raiseHand04IntroOnDone" + } + ] + }, + { + "id": "raiseHand04Loop", + "interpDuration": 1, + "interpTarget": 1, + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "raiseHand04Outro", + "var": "reactionRaiseHandDisabled" + } + ] + }, + { + "id": "raiseHand04Outro", + "interpDuration": 6, + "interpTarget": 6, + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "raiseHand04Loop", + "var": "reactionRaiseHandEnabled" + } + ] + } + ], + "triggerRandomSwitch": "" + }, + "id": "raiseHand04", + "type": "randomSwitchStateMachine" + } + ], + "data": { + "currentState": "raiseHand01", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "raiseHand01", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "raiseHand03", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "raiseHand04", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + } + ] + }, + "id": "reactionRaiseHand", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 17, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_clap01_all.fbx" + }, + "id": "applaudClap01Intro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 111, + "loopFlag": true, + "startFrame": 17, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_clap01_all.fbx" + }, + "id": "applaudClap01Loop", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 160, + "loopFlag": false, + "startFrame": 111, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_clap01_all.fbx" + }, + "id": "applaudClap01Outro", + "type": "clip" + } + ], + "data": { + "currentState": "applaudClap01Intro", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "applaudClap01Intro", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "applaudClap01Loop", + "var": "applaudClap01IntroOnDone" + } + ] + }, + { + "id": "applaudClap01Loop", + "interpDuration": 1, + "interpTarget": 1, + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "applaudClap01Outro", + "var": "reactionApplaudDisabled" + } + ] + }, + { + "id": "applaudClap01Outro", + "interpDuration": 6, + "interpTarget": 6, + "interpType": "evaluateBoth", + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "applaudClap01Loop", + "var": "reactionApplaudEnabled" + } + ] + } + ], + "triggerRandomSwitch": "" + }, + "id": "applaudClap01", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 14, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_clap02_all.fbx" + }, + "id": "applaudClap02Intro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 78, + "loopFlag": true, + "startFrame": 14, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_clap02_all.fbx" + }, + "id": "applaudClap02Loop", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 115, + "loopFlag": false, + "startFrame": 78, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_clap02_all.fbx" + }, + "id": "applaudClap02Outro", + "type": "clip" + } + ], + "data": { + "currentState": "applaudClap02Intro", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "applaudClap02Intro", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "applaudClap02Loop", + "var": "applaudClap02IntroOnDone" + } + ] + }, + { + "id": "applaudClap02Loop", + "interpDuration": 1, + "interpTarget": 1, + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "applaudClap02Outro", + "var": "reactionApplaudDisabled" + } + ] + }, + { + "id": "applaudClap02Outro", + "interpDuration": 6, + "interpTarget": 6, + "interpType": "evaluateBoth", + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "applaudClap02Loop", + "var": "reactionApplaudEnabled" + } + ] + } + ], + "triggerRandomSwitch": "" + }, + "id": "applaudClap02", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 14, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_clap03_all.fbx" + }, + "id": "applaudClap03Intro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 100, + "loopFlag": true, + "startFrame": 14, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_clap03_all.fbx" + }, + "id": "applaudClap03Loop", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 149, + "loopFlag": false, + "startFrame": 100, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_clap03_all.fbx" + }, + "id": "applaudClap03Outro", + "type": "clip" + } + ], + "data": { + "currentState": "applaudClap03Intro", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "applaudClap03Intro", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "applaudClap03Loop", + "var": "applaudClap03IntroOnDone" + } + ] + }, + { + "id": "applaudClap03Loop", + "interpDuration": 1, + "interpTarget": 1, + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "applaudClap03Outro", + "var": "reactionApplaudDisabled" + } + ] + }, + { + "id": "applaudClap03Outro", + "interpDuration": 6, + "interpTarget": 6, + "interpType": "evaluateBoth", + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "applaudClap03Loop", + "var": "reactionApplaudEnabled" + } + ] + } + ], + "triggerRandomSwitch": "" + }, + "id": "applaudClap03", + "type": "randomSwitchStateMachine" + } + ], + "data": { + "currentState": "applaudClap01", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "applaudClap01", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "applaudClap02", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "applaudClap03", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + } + ] + }, + "id": "reactionApplaud", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 21, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_point01_all.fbx" + }, + "id": "reactionPointIntro", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 100, + "loopFlag": true, + "startFrame": 21, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_point01_all.fbx" + }, + "id": "reactionPointLoop", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 134, + "loopFlag": false, + "startFrame": 100, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_point01_all.fbx" + }, + "id": "reactionPointOutro", + "type": "clip" + } + ], + "data": { + "currentState": "reactionPointIntro", + "randomSwitchTimeMax": 10, + "randomSwitchTimeMin": 1, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "reactionPointIntro", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + { + "randomSwitchState": "reactionPointLoop", + "var": "reactionPointIntroOnDone" + } + ] + }, + { + "id": "reactionPointLoop", + "interpDuration": 1, + "interpTarget": 1, + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "reactionPointOutro", + "var": "reactionPointDisabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "reactionPointOutro", + "interpDuration": 6, + "interpTarget": 6, + "interpType": "evaluateBoth", + "priority": 0, + "resume": false, + "transitions": [ + { + "randomSwitchState": "reactionPointLoop", + "var": "reactionPointEnabled" + } + ] + } + ], + "triggerRandomSwitch": "" + }, + "id": "reactionPoint", + "type": "randomSwitchStateMachine" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 11, + "loopFlag": true, + "startFrame": 11, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx" + }, + "id": "idlePointLeft", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 30, + "loopFlag": true, + "startFrame": 30, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx" + }, + "id": "idlePointRight", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 50, + "loopFlag": true, + "startFrame": 50, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx" + }, + "id": "idlePointUp", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 70, + "loopFlag": true, + "startFrame": 70, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx" + }, + "id": "idlePointDown", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 90, + "loopFlag": true, + "startFrame": 90, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx" + }, + "id": "idlePointUpLeft", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 110, + "loopFlag": true, + "startFrame": 110, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx" + }, + "id": "idlePointUpRight", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 130, + "loopFlag": true, + "startFrame": 130, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx" + }, + "id": "idlePointDownLeft", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 150, + "loopFlag": true, + "startFrame": 150, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx" + }, + "id": "idlePointDownRight", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 3, + "loopFlag": true, + "startFrame": 3, + "timeScale": 1, + "url": "qrc:///avatar/animations/emote_point01_aimoffsets.fbx" + }, + "id": "idlePointCenter", + "type": "clip" + } + ], + "data": { + "alpha": [ + 0, + 0, + 0 + ], + "alphaVar": "pointAroundAlpha", + "centerId": "idlePointCenter", + "downId": "idlePointDown", + "downLeftId": "idlePointDownLeft", + "downRightId": "idlePointDownRight", + "leftId": "idlePointLeft", + "rightId": "idlePointRight", + "upId": "idlePointUp", + "upLeftId": "idlePointUpLeft", + "upRightId": "idlePointUpRight" + }, + "id": "idlePointAround", + "type": "blendDirectional" + } + ], + "data": { + "alpha": 0, + "alphaVar": "pointBlendAlpha", + "blendType": "addAbsolute" + }, + "id": "reactionPoint", + "type": "blendLinear" + } + ], + "data": { + "currentState": "idleTalkOverlay", + "states": [ + { + "easingType": "easeInOutQuad", + "id": "idleTalkOverlay", + "interpDuration": 25, + "interpTarget": 25, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "reactionPositive", + "var": "reactionPositiveTrigger" + }, + { + "state": "reactionNegative", + "var": "reactionNegativeTrigger" + }, + { + "state": "reactionRaiseHand", + "var": "reactionRaiseHandEnabled" + }, + { + "state": "reactionApplaud", + "var": "reactionApplaudEnabled" + }, + { + "state": "reactionPoint", + "var": "reactionPointEnabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "reactionPositive", + "interpDuration": 18, + "interpTarget": 18, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "idleTalkOverlay", + "var": "positiveAcknowledgeOnDone" + }, + { + "state": "idleTalkOverlay", + "var": "positiveHeadNodOnDone" + }, + { + "state": "idleTalkOverlay", + "var": "positiveHeadNodYesOnDone" + }, + { + "state": "idleTalkOverlay", + "var": "positiveLongHeadNodOnDone" + }, + { + "state": "idleTalkOverlay", + "var": "positiveThoughtfulHeadNodOnDone" + }, + { + "state": "reactionNegative", + "var": "reactionNegativeTrigger" + }, + { + "state": "reactionRaiseHand", + "var": "reactionRaiseHandEnabled" + }, + { + "state": "reactionApplaud", + "var": "reactionApplaudEnabled" + }, + { + "state": "reactionPoint", + "var": "reactionPointEnabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "reactionNegative", + "interpDuration": 18, + "interpTarget": 18, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "reactionPositive", + "var": "reactionPositiveTrigger" + }, + { + "state": "idleTalkOverlay", + "var": "negativeAnnoyedHeadshakeOnDone" + }, + { + "state": "idleTalkOverlay", + "var": "negativeThoughtfulHeadshakeOnDone" + }, + { + "state": "idleTalkOverlay", + "var": "negativeDropHeadOnDone" + }, + { + "state": "reactionRaiseHand", + "var": "reactionRaiseHandEnabled" + }, + { + "state": "reactionApplaud", + "var": "reactionApplaudEnabled" + }, + { + "state": "reactionPoint", + "var": "reactionPointEnabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "reactionRaiseHand", + "interpDuration": 18, + "interpTarget": 18, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "reactionNegative", + "var": "reactionNegativeTrigger" + }, + { + "state": "reactionPositive", + "var": "reactionPositiveTrigger" + }, + { + "state": "idleTalkOverlay", + "var": "reactionRaiseHandDisabled" + }, + { + "state": "reactionApplaud", + "var": "reactionApplaudEnabled" + }, + { + "state": "reactionPoint", + "var": "reactionPointEnabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "reactionApplaud", + "interpDuration": 18, + "interpTarget": 18, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "reactionNegative", + "var": "reactionNegativeTrigger" + }, + { + "state": "reactionPositive", + "var": "reactionPositiveTrigger" + }, + { + "state": "reactionRaiseHand", + "var": "reactionRaiseHandEnabled" + }, + { + "state": "idleTalkOverlay", + "var": "reactionApplaudDisabled" + }, + { + "state": "reactionPoint", + "var": "reactionPointEnabled" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "reactionPoint", + "interpDuration": 10, + "interpTarget": 10, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "reactionNegative", + "var": "reactionNegativeTrigger" + }, + { + "state": "reactionPositive", + "var": "reactionPositiveTrigger" + }, + { + "state": "reactionRaiseHand", + "var": "reactionRaiseHandEnabled" + }, + { + "state": "reactionApplaud", + "var": "reactionApplaudEnabled" + }, + { + "state": "idleTalkOverlay", + "var": "reactionPointDisabled" + } + ] + } + ] + }, + "id": "idle", + "type": "stateMachine" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 40, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/walk_short_fwd.fbx" + }, + "id": "walkFwdShort_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 30, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/walk_fwd.fbx" + }, + "id": "walkFwdNormal_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 26, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/walk_fwd_fast.fbx" + }, + "id": "walkFwdFast_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 18, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/jog_fwd.fbx" + }, + "id": "walkFwdJog_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 19, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/run_fast_fwd.fbx" + }, + "id": "walkFwdRun_c", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "moveForwardAlpha", + "characteristicSpeeds": [ + 0.5, + 1.8, + 2.5, + 3.55, + 5.675 + ], + "desiredSpeed": 1.4, + "desiredSpeedVar": "moveForwardSpeed" + }, + "id": "WALKFWD", + "type": "blendLinearMove" + }, + { + "children": [ + ], + "data": { + "endFrame": 13, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_to_walk.fbx" + }, + "id": "idleToWalkFwd", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 59, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/settle_to_idle_small.fbx" + }, + "id": "idleSettle", + "type": "clip" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 37, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/walk_bwd.fbx" + }, + "id": "walkBwdShort_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 28, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/walk_bwd_fast.fbx" + }, + "id": "walkBwdFast_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 20, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/jog_bwd.fbx" + }, + "id": "jogBwd_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 14, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/run_bwd.fbx" + }, + "id": "runBwd_c", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "moveBackwardAlpha", + "characteristicSpeeds": [ + 0.6, + 1.6, + 2.8, + 4.5 + ], + "desiredSpeed": 1.4, + "desiredSpeedVar": "moveBackwardSpeed" + }, + "id": "WALKBWD", + "type": "blendLinearMove" + }, + { + "children": [ + ], + "data": { + "endFrame": 33, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/turn_left.fbx" + }, + "id": "turnLeft", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 31, + "loopFlag": true, + "mirrorFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/turn_right.fbx" + }, + "id": "turnRight", + "type": "clip" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 35, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/walk_left.fbx" + }, + "id": "strafeLeftWalk_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 21, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/walk_left_fast.fbx" + }, + "id": "strafeLeftWalkFast_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 20, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/jog_left.fbx" + }, + "id": "strafeLeftJog_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 19, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/run_fast_left.fbx" + }, + "id": "strafeLeftRun_c", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "moveLateralAlpha", + "characteristicSpeeds": [ + 1, + 2.55, + 3.35, + 5.25 + ], + "desiredSpeed": 1.4, + "desiredSpeedVar": "moveLateralSpeed" + }, + "id": "STRAFELEFT", + "type": "blendLinearMove" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 35, + "loopFlag": true, + "mirrorFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/walk_right.fbx" + }, + "id": "strafeRightWalk_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 21, + "loopFlag": true, + "mirrorFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/walk_right_fast.fbx" + }, + "id": "strafeRightFast_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 20, + "loopFlag": true, + "mirrorFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/jog_right.fbx" + }, + "id": "strafeRightJog_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 19, + "loopFlag": true, + "mirrorFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/run_fast_right.fbx" + }, + "id": "strafeRightRun_c", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "moveLateralAlpha", + "characteristicSpeeds": [ + 1, + 2.55, + 3.4, + 5.25 + ], + "desiredSpeed": 1.4, + "desiredSpeedVar": "moveLateralSpeed" + }, + "id": "STRAFERIGHT", + "type": "blendLinearMove" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 30, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/side_step_short_left.fbx" + }, + "id": "stepLeftShort_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 20, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/side_step_left.fbx" + }, + "id": "stepLeft_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 16, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/side_step_left_fast.fbx" + }, + "id": "strafeLeftAnim_c", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "moveLateralAlpha", + "characteristicSpeeds": [ + 0, + 0.5, + 2.5 + ], + "desiredSpeed": 1.4, + "desiredSpeedVar": "moveLateralSpeed" + }, + "id": "strafeLeftHmd", + "type": "blendLinearMove" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 30, + "loopFlag": true, + "mirrorFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/side_step_short_left.fbx" + }, + "id": "stepRightShort_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 20, + "loopFlag": true, + "mirrorFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/side_step_left.fbx" + }, + "id": "stepRight_c", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 16, + "loopFlag": true, + "mirrorFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/side_step_left_fast.fbx" + }, + "id": "strafeRightAnim_c", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "moveLateralAlpha", + "characteristicSpeeds": [ + 0, + 0.5, + 2.5 + ], + "desiredSpeed": 1.4, + "desiredSpeedVar": "moveLateralSpeed" + }, + "id": "strafeRightHmd", + "type": "blendLinearMove" + }, + { + "children": [ + ], + "data": { + "endFrame": 79, + "loopFlag": true, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/fly.fbx" + }, + "id": "fly", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 16, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/jump_standing_launch_all.fbx" + }, + "id": "takeoffStand", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 15, + "loopFlag": false, + "startFrame": 4, + "timeScale": 1, + "url": "qrc:///avatar/animations/jump_running_launch_land_all.fbx" + }, + "id": "TAKEOFFRUN", + "type": "clip" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 1, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/jump_standing_apex_all.fbx" + }, + "id": "inAirStandPreApex", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 2, + "loopFlag": false, + "startFrame": 2, + "timeScale": 1, + "url": "qrc:///avatar/animations/jump_standing_apex_all.fbx" + }, + "id": "inAirStandApex", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 3, + "loopFlag": false, + "startFrame": 3, + "timeScale": 1, + "url": "qrc:///avatar/animations/jump_standing_apex_all.fbx" + }, + "id": "inAirStandPostApex", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "inAirAlpha" + }, + "id": "inAirStand", + "type": "blendLinear" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "endFrame": 16, + "loopFlag": false, + "startFrame": 16, + "timeScale": 1, + "url": "qrc:///avatar/animations/jump_running_launch_land_all.fbx" + }, + "id": "inAirRunPreApex", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 22, + "loopFlag": false, + "startFrame": 22, + "timeScale": 1, + "url": "qrc:///avatar/animations/jump_running_launch_land_all.fbx" + }, + "id": "inAirRunApex", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 33, + "loopFlag": false, + "startFrame": 33, + "timeScale": 1, + "url": "qrc:///avatar/animations/jump_running_launch_land_all.fbx" + }, + "id": "inAirRunPostApex", + "type": "clip" + } + ], + "data": { + "alpha": 0, + "alphaVar": "inAirAlpha" + }, + "id": "INAIRRUN", + "type": "blendLinear" + }, + { + "children": [ + ], + "data": { + "endFrame": 6, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/jump_standing_land_settle_all.fbx" + }, + "id": "landStandImpact", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 68, + "loopFlag": false, + "startFrame": 6, + "timeScale": 1, + "url": "qrc:///avatar/animations/jump_standing_land_settle_all.fbx" + }, + "id": "landStand", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 40, + "loopFlag": false, + "startFrame": 29, + "timeScale": 1, + "url": "qrc:///avatar/animations/jump_running_launch_land_all.fbx" + }, + "id": "LANDRUN", + "type": "clip" + } + ], + "data": { + "currentState": "idle", + "outputJoints": [ + "LeftFoot", + "RightFoot" + ], + "states": [ + { + "easingType": "easeInOutQuad", + "id": "seated", + "interpDuration": 6, + "interpTarget": 6, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "idle", + "var": "isNotSeated" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "idle", + "interpDuration": 15, + "interpTarget": 20, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "WALKFWD", + "var": "isInputForward" + }, + { + "state": "WALKBWD", + "var": "isInputBackward" + }, + { + "state": "STRAFERIGHT", + "var": "isInputRight" + }, + { + "state": "STRAFELEFT", + "var": "isInputLeft" + }, + { + "state": "turnRight", + "var": "isTurningRight" + }, + { + "state": "turnLeft", + "var": "isTurningLeft" + }, + { + "state": "fly", + "var": "isFlying" + }, + { + "state": "takeoffStand", + "var": "isTakeoffStand" + }, + { + "state": "TAKEOFFRUN", + "var": "isTakeoffRun" + }, + { + "state": "inAirStand", + "var": "isInAirStand" + }, + { + "state": "INAIRRUN", + "var": "isInAirRun" + }, + { + "state": "strafeRightHmd", + "var": "isMovingRightHmd" + }, + { + "state": "strafeLeftHmd", + "var": "isMovingLeftHmd" + }, + { + "state": "seated", + "var": "isSeated" + } + ] + }, + { + "id": "idleToWalkFwd", + "interpDuration": 8, + "interpTarget": 12, + "transitions": [ + { + "state": "WALKFWD", + "var": "idleToWalkFwdOnDone" + }, + { + "state": "idle", + "var": "isNotInput" + }, + { + "state": "WALKBWD", + "var": "isInputBackward" + }, + { + "state": "STRAFERIGHT", + "var": "isInputRight" + }, + { + "state": "STRAFELEFT", + "var": "isInputLeft" + }, + { + "state": "turnRight", + "var": "isTurningRight" + }, + { + "state": "turnLeft", + "var": "isTurningLeft" + }, + { + "state": "fly", + "var": "isFlying" + }, + { + "state": "takeoffStand", + "var": "isTakeoffStand" + }, + { + "state": "TAKEOFFRUN", + "var": "isTakeoffRun" + }, + { + "state": "inAirStand", + "var": "isInAirStand" + }, + { + "state": "INAIRRUN", + "var": "isInAirRun" + }, + { + "state": "strafeRightHmd", + "var": "isMovingRightHmd" + }, + { + "state": "strafeLeftHmd", + "var": "isMovingLeftHmd" + }, + { + "state": "seated", + "var": "isSeated" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "idleSettle", + "interpDuration": 13, + "interpTarget": 14, + "interpType": "snapshotPrev", + "transitions": [ + { + "state": "idle", + "var": "idleSettleOnDone" + }, + { + "state": "idle", + "var": "reactionPositiveTrigger" + }, + { + "state": "idle", + "var": "reactionNegativeTrigger" + }, + { + "state": "idle", + "var": "reactionRaiseHandEnabled" + }, + { + "state": "idle", + "var": "reactionApplaudEnabled" + }, + { + "state": "idle", + "var": "reactionPointEnabled" + }, + { + "state": "WALKFWD", + "var": "isInputForward" + }, + { + "state": "WALKBWD", + "var": "isInputBackward" + }, + { + "state": "STRAFERIGHT", + "var": "isInputRight" + }, + { + "state": "STRAFELEFT", + "var": "isInputLeft" + }, + { + "state": "strafeRightHmd", + "var": "isMovingRightHmd" + }, + { + "state": "strafeLeftHmd", + "var": "isMovingLeftHmd" + }, + { + "state": "turnRight", + "var": "isTurningRight" + }, + { + "state": "turnLeft", + "var": "isTurningLeft" + }, + { + "state": "fly", + "var": "isFlying" + }, + { + "state": "takeoffStand", + "var": "isTakeoffStand" + }, + { + "state": "TAKEOFFRUN", + "var": "isTakeoffRun" + }, + { + "state": "inAirStand", + "var": "isInAirStand" + }, + { + "state": "INAIRRUN", + "var": "isInAirRun" + }, + { + "state": "seated", + "var": "isSeated" + } + ] + }, + { + "id": "WALKFWD", + "interpDuration": 15, + "interpTarget": 35, + "interpType": "snapshotPrev", + "transitions": [ + { + "state": "idleSettle", + "var": "isNotInputSlow" + }, + { + "state": "WALKBWD", + "var": "isInputBackward" + }, + { + "state": "STRAFERIGHT", + "var": "isInputRight" + }, + { + "state": "STRAFELEFT", + "var": "isInputLeft" + }, + { + "state": "turnRight", + "var": "isTurningRight" + }, + { + "state": "turnLeft", + "var": "isTurningLeft" + }, + { + "state": "fly", + "var": "isFlying" + }, + { + "state": "takeoffStand", + "var": "isTakeoffStand" + }, + { + "state": "TAKEOFFRUN", + "var": "isTakeoffRun" + }, + { + "state": "inAirStand", + "var": "isInAirStand" + }, + { + "state": "INAIRRUN", + "var": "isInAirRun" + }, + { + "state": "strafeRightHmd", + "var": "isMovingRightHmd" + }, + { + "state": "strafeLeftHmd", + "var": "isMovingLeftHmd" + }, + { + "state": "seated", + "var": "isSeated" + } + ] + }, + { + "id": "WALKBWD", + "interpDuration": 15, + "interpTarget": 35, + "interpType": "snapshotPrev", + "transitions": [ + { + "state": "idleSettle", + "var": "isNotInputSlow" + }, + { + "state": "WALKFWD", + "var": "isInputForward" + }, + { + "state": "STRAFERIGHT", + "var": "isInputRight" + }, + { + "state": "STRAFELEFT", + "var": "isInputLeft" + }, + { + "state": "turnRight", + "var": "isTurningRight" + }, + { + "state": "turnLeft", + "var": "isTurningLeft" + }, + { + "state": "fly", + "var": "isFlying" + }, + { + "state": "takeoffStand", + "var": "isTakeoffStand" + }, + { + "state": "TAKEOFFRUN", + "var": "isTakeoffRun" + }, + { + "state": "inAirStand", + "var": "isInAirStand" + }, + { + "state": "INAIRRUN", + "var": "isInAirRun" + }, + { + "state": "strafeRightHmd", + "var": "isMovingRightHmd" + }, + { + "state": "strafeLeftHmd", + "var": "isMovingLeftHmd" + }, + { + "state": "seated", + "var": "isSeated" + } + ] + }, + { + "id": "STRAFERIGHT", + "interpDuration": 15, + "interpTarget": 25, + "interpType": "snapshotPrev", + "transitions": [ + { + "state": "idleSettle", + "var": "isNotInputSlow" + }, + { + "state": "WALKFWD", + "var": "isInputForward" + }, + { + "state": "WALKBWD", + "var": "isInputBackward" + }, + { + "state": "STRAFELEFT", + "var": "isMovingLeft" + }, + { + "state": "turnRight", + "var": "isTurningRight" + }, + { + "state": "turnLeft", + "var": "isTurningLeft" + }, + { + "state": "fly", + "var": "isFlying" + }, + { + "state": "takeoffStand", + "var": "isTakeoffStand" + }, + { + "state": "TAKEOFFRUN", + "var": "isTakeoffRun" + }, + { + "state": "inAirStand", + "var": "isInAirStand" + }, + { + "state": "INAIRRUN", + "var": "isInAirRun" + }, + { + "state": "strafeRightHmd", + "var": "isMovingRightHmd" + }, + { + "state": "strafeLeftHmd", + "var": "isMovingLeftHmd" + }, + { + "state": "seated", + "var": "isSeated" + } + ] + }, + { + "id": "STRAFELEFT", + "interpDuration": 15, + "interpTarget": 25, + "interpType": "snapshotPrev", + "transitions": [ + { + "state": "idleSettle", + "var": "isNotInputSlow" + }, + { + "state": "WALKFWD", + "var": "isInputForward" + }, + { + "state": "WALKBWD", + "var": "isInputBackward" + }, + { + "state": "STRAFERIGHT", + "var": "isMovingRight" + }, + { + "state": "turnRight", + "var": "isTurningRight" + }, + { + "state": "turnLeft", + "var": "isTurningLeft" + }, + { + "state": "fly", + "var": "isFlying" + }, + { + "state": "takeoffStand", + "var": "isTakeoffStand" + }, + { + "state": "TAKEOFFRUN", + "var": "isTakeoffRun" + }, + { + "state": "inAirStand", + "var": "isInAirStand" + }, + { + "state": "INAIRRUN", + "var": "isInAirRun" + }, + { + "state": "strafeRightHmd", + "var": "isMovingRightHmd" + }, + { + "state": "strafeLeftHmd", + "var": "isMovingLeftHmd" + }, + { + "state": "seated", + "var": "isSeated" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "turnRight", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "idle", + "var": "isNotTurning" + }, + { + "state": "WALKFWD", + "var": "isInputForward" + }, + { + "state": "WALKBWD", + "var": "isInputBackward" + }, + { + "state": "STRAFERIGHT", + "var": "isInputRight" + }, + { + "state": "STRAFELEFT", + "var": "isInputLeft" + }, + { + "state": "turnLeft", + "var": "isTurningLeft" + }, + { + "state": "fly", + "var": "isFlying" + }, + { + "state": "takeoffStand", + "var": "isTakeoffStand" + }, + { + "state": "TAKEOFFRUN", + "var": "isTakeoffRun" + }, + { + "state": "inAirStand", + "var": "isInAirStand" + }, + { + "state": "INAIRRUN", + "var": "isInAirRun" + }, + { + "state": "strafeRightHmd", + "var": "isMovingRightHmd" + }, + { + "state": "strafeLeftHmd", + "var": "isMovingLeftHmd" + }, + { + "state": "seated", + "var": "isSeated" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "turnLeft", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "idle", + "var": "isNotTurning" + }, + { + "state": "WALKFWD", + "var": "isInputForward" + }, + { + "state": "WALKBWD", + "var": "isInputBackward" + }, + { + "state": "STRAFERIGHT", + "var": "isInputRight" + }, + { + "state": "STRAFELEFT", + "var": "isInputLeft" + }, + { + "state": "turnRight", + "var": "isTurningRight" + }, + { + "state": "fly", + "var": "isFlying" + }, + { + "state": "takeoffStand", + "var": "isTakeoffStand" + }, + { + "state": "TAKEOFFRUN", + "var": "isTakeoffRun" + }, + { + "state": "inAirStand", + "var": "isInAirStand" + }, + { + "state": "INAIRRUN", + "var": "isInAirRun" + }, + { + "state": "strafeRightHmd", + "var": "isMovingRightHmd" + }, + { + "state": "strafeLeftHmd", + "var": "isMovingLeftHmd" + }, + { + "state": "seated", + "var": "isSeated" + } + ] + }, + { + "id": "strafeRightHmd", + "interpDuration": 8, + "interpTarget": 8, + "interpType": "snapshotPrev", + "transitions": [ + { + "state": "idleSettle", + "var": "isNotInput" + }, + { + "state": "WALKFWD", + "var": "isInputForward" + }, + { + "state": "WALKBWD", + "var": "isInputBackward" + }, + { + "state": "strafeLeftHmd", + "var": "isMovingLeftHmd" + }, + { + "state": "STRAFERIGHT", + "var": "isInputRight" + }, + { + "state": "STRAFELEFT", + "var": "isInputLeft" + }, + { + "state": "turnRight", + "var": "isTurningRight" + }, + { + "state": "turnLeft", + "var": "isTurningLeft" + }, + { + "state": "fly", + "var": "isFlying" + }, + { + "state": "takeoffStand", + "var": "isTakeoffStand" + }, + { + "state": "TAKEOFFRUN", + "var": "isTakeoffRun" + }, + { + "state": "inAirStand", + "var": "isInAirStand" + }, + { + "state": "INAIRRUN", + "var": "isInAirRun" + }, + { + "state": "seated", + "var": "isSeated" + } + ] + }, + { + "id": "strafeLeftHmd", + "interpDuration": 8, + "interpTarget": 8, + "interpType": "snapshotPrev", + "transitions": [ + { + "state": "idleSettle", + "var": "isNotInput" + }, + { + "state": "WALKFWD", + "var": "isInputForward" + }, + { + "state": "WALKBWD", + "var": "isInputBackward" + }, + { + "state": "strafeRightHmd", + "var": "isMovingRightHmd" + }, + { + "state": "STRAFERIGHT", + "var": "isInputRight" + }, + { + "state": "STRAFELEFT", + "var": "isInputLeft" + }, + { + "state": "turnRight", + "var": "isTurningRight" + }, + { + "state": "turnLeft", + "var": "isTurningLeft" + }, + { + "state": "fly", + "var": "isFlying" + }, + { + "state": "takeoffStand", + "var": "isTakeoffStand" + }, + { + "state": "TAKEOFFRUN", + "var": "isTakeoffRun" + }, + { + "state": "inAirStand", + "var": "isInAirStand" + }, + { + "state": "INAIRRUN", + "var": "isInAirRun" + }, + { + "state": "seated", + "var": "isSeated" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "fly", + "interpDuration": 24, + "interpTarget": 24, + "interpType": "evaluateBoth", + "transitions": [ + { + "state": "idleSettle", + "var": "isNotFlying" + } + ] + }, + { + "id": "takeoffStand", + "interpDuration": 2, + "interpTarget": 2, + "transitions": [ + { + "state": "inAirStand", + "var": "isNotTakeoff" + } + ] + }, + { + "id": "TAKEOFFRUN", + "interpDuration": 2, + "interpTarget": 2, + "transitions": [ + { + "state": "INAIRRUN", + "var": "isNotTakeoff" + } + ] + }, + { + "id": "inAirStand", + "interpDuration": 3, + "interpTarget": 3, + "interpType": "snapshotPrev", + "transitions": [ + { + "state": "landStandImpact", + "var": "isNotInAir" + } + ] + }, + { + "id": "INAIRRUN", + "interpDuration": 3, + "interpTarget": 3, + "interpType": "snapshotPrev", + "transitions": [ + { + "state": "WALKFWD", + "var": "isNotInAir" + } + ] + }, + { + "id": "landStandImpact", + "interpDuration": 1, + "interpTarget": 1, + "transitions": [ + { + "state": "fly", + "var": "isFlying" + }, + { + "state": "takeoffStand", + "var": "isTakeoffStand" + }, + { + "state": "TAKEOFFRUN", + "var": "isTakeoffRun" + }, + { + "state": "landStand", + "var": "landStandImpactOnDone" + } + ] + }, + { + "id": "landStand", + "interpDuration": 1, + "interpTarget": 1, + "transitions": [ + { + "state": "WALKFWD", + "var": "isInputForward" + }, + { + "state": "WALKBWD", + "var": "isInputBackward" + }, + { + "state": "STRAFERIGHT", + "var": "isInputRight" + }, + { + "state": "STRAFELEFT", + "var": "isInputLeft" + }, + { + "state": "turnRight", + "var": "isTurningRight" + }, + { + "state": "turnLeft", + "var": "isTurningLeft" + }, + { + "state": "fly", + "var": "isFlying" + }, + { + "state": "takeoffStand", + "var": "isTakeoffStand" + }, + { + "state": "TAKEOFFRUN", + "var": "isTakeoffRun" + }, + { + "state": "inAirStand", + "var": "isInAirStand" + }, + { + "state": "INAIRRUN", + "var": "isInAirRun" + }, + { + "state": "idle", + "var": "landStandOnDone" + }, + { + "state": "strafeRightHmd", + "var": "isMovingRightHmd" + }, + { + "state": "strafeLeftHmd", + "var": "isMovingLeftHmd" + }, + { + "state": "seated", + "var": "isSeated" + } + ] + }, + { + "id": "LANDRUN", + "interpDuration": 2, + "interpTarget": 2, + "transitions": [ + { + "state": "fly", + "var": "isFlying" + }, + { + "state": "takeoffStand", + "var": "isTakeoffStand" + }, + { + "state": "TAKEOFFRUN", + "var": "isTakeoffRun" + }, + { + "state": "WALKFWD", + "var": "landRunOnDone" + } + ] + } + ] + }, + "id": "mainStateMachine", + "type": "stateMachine" + }, + { + "children": [ + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 11, + "loopFlag": true, + "startFrame": 11, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_aimoffsets.fbx" + }, + "id": "lookLeft", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 30, + "loopFlag": true, + "startFrame": 30, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_aimoffsets.fbx" + }, + "id": "lookRight", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 50, + "loopFlag": true, + "startFrame": 50, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_aimoffsets.fbx" + }, + "id": "lookUp", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 70, + "loopFlag": true, + "startFrame": 70, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_aimoffsets.fbx" + }, + "id": "lookDown", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 97, + "loopFlag": true, + "startFrame": 97, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_aimoffsets.fbx" + }, + "id": "lookUpLeft", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 110, + "loopFlag": true, + "startFrame": 110, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_aimoffsets.fbx" + }, + "id": "lookUpRight", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 130, + "loopFlag": true, + "startFrame": 130, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_aimoffsets.fbx" + }, + "id": "lookDownLeft", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 150, + "loopFlag": true, + "startFrame": 150, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_aimoffsets.fbx" + }, + "id": "lookDownRight", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "baseFrame": 1, + "baseURL": "qrc:///avatar/animations/idle_aimoffsets.fbx", + "blendType": "addAbsolute", + "endFrame": 3, + "loopFlag": true, + "startFrame": 3, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle_aimoffsets.fbx" + }, + "id": "lookCenter", + "type": "clip" + } + ], + "data": { + "alpha": [ + 0, + 0, + 0 + ], + "alphaVar": "lookAroundAlpha", + "centerId": "lookCenter", + "downId": "lookDown", + "downLeftId": "lookDownLeft", + "downRightId": "lookDownRight", + "leftId": "lookLeft", + "rightId": "lookRight", + "upId": "lookUp", + "upLeftId": "lookUpLeft", + "upRightId": "lookUpRight" + }, + "id": "lookAroundBlend", + "type": "blendDirectional" + } + ], + "data": { + "alpha": 0, + "alphaVar": "lookBlendAlpha", + "blendType": "addAbsolute" + }, + "id": "lookAround", + "type": "blendLinear" + } + ], + "data": { + "alpha": 0, + "alphaVar": "leftHandOverlayAlpha", + "boneSet": "leftHand" + }, + "id": "leftHandOverlay", + "type": "overlay" + } + ], + "data": { + "alpha": 0, + "alphaVar": "rightHandOverlayAlpha", + "boneSet": "rightHand" + }, + "id": "rightHandOverlay", + "type": "overlay" + } + ], + "data": { + "alpha": 0, + "alphaVar": "defaultPoseOverlayAlpha", + "boneSet": "fullBody", + "boneSetVar": "defaultPoseOverlayBoneSet" + }, + "id": "defaultPoseOverlay", + "type": "overlay" + } + ], + "data": { + "alpha": 1, + "alphaVar": "splineIKAlpha", + "baseJointName": "Hips", + "basePositionVar": "hipsPosition", + "baseRotationVar": "hipsRotation", + "enabled": false, + "enabledVar": "splineIKEnabled", + "interpDuration": 15, + "midJointName": "Spine2", + "midPositionVar": "spine2Position", + "midRotationVar": "spine2Rotation", + "midTargetFlexCoefficients": [ + 1, + 1, + 1 + ], + "tipJointName": "Head", + "tipPositionVar": "headPosition", + "tipRotationVar": "headRotation", + "tipTargetFlexCoefficients": [ + 1, + 1, + 1, + 1, + 1 + ] + }, + "id": "userSplineIK", + "type": "splineIK" + } + ], + "data": { + "alpha": 1, + "alphaVar": "leftHandIKAlpha", + "baseJointName": "LeftArm", + "enabled": false, + "enabledVar": "leftHandIKEnabled", + "endEffectorPositionVarVar": "leftHandIKPositionVar", + "endEffectorRotationVarVar": "leftHandIKRotationVar", + "interpDuration": 15, + "midHingeAxis": [ + 0, + 0, + 1 + ], + "midJointName": "LeftForeArm", + "tipJointName": "LeftHand" + }, + "id": "leftHandIK", + "type": "twoBoneIK" + } + ], + "data": { + "baseJointName": "LeftArm", + "enabled": false, + "enabledVar": "leftHandPoleVectorEnabled", + "midJointName": "LeftForeArm", + "poleVectorVar": "leftHandPoleVector", + "referenceVector": [ + 1, + 0, + 0 + ], + "tipJointName": "LeftHand" + }, + "id": "leftHandPoleVector", + "type": "poleVectorConstraint" + } + ], + "data": { + "alpha": 1, + "alphaVar": "rightHandIKAlpha", + "baseJointName": "RightArm", + "enabled": false, + "enabledVar": "rightHandIKEnabled", + "endEffectorPositionVarVar": "rightHandIKPositionVar", + "endEffectorRotationVarVar": "rightHandIKRotationVar", + "interpDuration": 15, + "midHingeAxis": [ + 0, + 0, + -1 + ], + "midJointName": "RightForeArm", + "tipJointName": "RightHand" + }, + "id": "rightHandIK", + "type": "twoBoneIK" + } + ], + "data": { + "baseJointName": "RightArm", + "enabled": false, + "enabledVar": "rightHandPoleVectorEnabled", + "midJointName": "RightForeArm", + "poleVectorVar": "rightHandPoleVector", + "referenceVector": [ + -1, + 0, + 0 + ], + "tipJointName": "RightHand" + }, + "id": "rightHandPoleVector", + "type": "poleVectorConstraint" + } + ], + "data": { + "alpha": 1, + "alphaVar": "leftFootIKAlpha", + "baseJointName": "LeftUpLeg", + "enabled": false, + "enabledVar": "leftFootIKEnabled", + "endEffectorPositionVarVar": "leftFootIKPositionVar", + "endEffectorRotationVarVar": "leftFootIKRotationVar", + "interpDuration": 15, + "midHingeAxis": [ + -1, + 0, + 0 + ], + "midJointName": "LeftLeg", + "tipJointName": "LeftFoot" + }, + "id": "leftFootIK", + "type": "twoBoneIK" + } + ], + "data": { + "baseJointName": "LeftUpLeg", + "enabled": false, + "enabledVar": "leftFootPoleVectorEnabled", + "midJointName": "LeftLeg", + "poleVectorVar": "leftFootPoleVector", + "referenceVector": [ + 0, + 0, + 1 + ], + "tipJointName": "LeftFoot" + }, + "id": "leftFootPoleVector", + "type": "poleVectorConstraint" + } + ], + "data": { + "alpha": 1, + "alphaVar": "rightFootIKAlpha", + "baseJointName": "RightUpLeg", + "enabled": false, + "enabledVar": "rightFootIKEnabled", + "endEffectorPositionVarVar": "rightFootIKPositionVar", + "endEffectorRotationVarVar": "rightFootIKRotationVar", + "interpDuration": 15, + "midHingeAxis": [ + -1, + 0, + 0 + ], + "midJointName": "RightLeg", + "tipJointName": "RightFoot" + }, + "id": "rightFootIK", + "type": "twoBoneIK" + } + ], + "data": { + "baseJointName": "RightUpLeg", + "enabled": false, + "enabledVar": "rightFootPoleVectorEnabled", + "midJointName": "RightLeg", + "poleVectorVar": "rightFootPoleVector", + "referenceVector": [ + 0, + 0, + 1 + ], + "tipJointName": "RightFoot" + }, + "id": "userAnimNone", + "type": "poleVectorConstraint" + }, + { + "children": [ + ], + "data": { + "endFrame": 90, + "loopFlag": true, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle.fbx" + }, + "id": "userAnimA", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 90, + "loopFlag": true, + "startFrame": 0, + "timeScale": 1, + "url": "qrc:///avatar/animations/idle.fbx" + }, + "id": "userAnimB", + "type": "clip" + } + ], + "data": { + "currentState": "userAnimNone", + "states": [ + { + "id": "userAnimNone", + "interpDuration": 6, + "interpTarget": 6, + "transitions": [ + { + "state": "userAnimA", + "var": "userAnimA" + }, + { + "state": "userAnimB", + "var": "userAnimB" + } + ] + }, + { + "id": "userAnimA", + "interpDuration": 6, + "interpTarget": 6, + "transitions": [ + { + "state": "userAnimNone", + "var": "userAnimNone" + }, + { + "state": "userAnimB", + "var": "userAnimB" + } + ] + }, + { + "id": "userAnimB", + "interpDuration": 6, + "interpTarget": 6, + "transitions": [ + { + "state": "userAnimNone", + "var": "userAnimNone" + }, + { + "state": "userAnimA", + "var": "userAnimA" + } + ] + } + ] + }, + "id": "userAnimStateMachine", + "type": "stateMachine" + }, + "version": "1.1" +} diff --git a/interface/resources/avatar/avatar-animation_withSplineIKNode.json b/interface/resources/avatar/avatar-animation_withSplineIKNode.json deleted file mode 100644 index b1f198c52c..0000000000 --- a/interface/resources/avatar/avatar-animation_withSplineIKNode.json +++ /dev/null @@ -1,2229 +0,0 @@ -{ - "version": "1.1", - "root": { - "id": "userAnimStateMachine", - "type": "stateMachine", - "data": { - "currentState": "userAnimNone", - "states": [ - { - "id": "userAnimNone", - "interpTarget": 6, - "interpDuration": 6, - "transitions": [ - { - "var": "userAnimA", - "state": "userAnimA" - }, - { - "var": "userAnimB", - "state": "userAnimB" - } - ] - }, - { - "id": "userAnimA", - "interpTarget": 6, - "interpDuration": 6, - "transitions": [ - { - "var": "userAnimNone", - "state": "userAnimNone" - }, - { - "var": "userAnimB", - "state": "userAnimB" - } - ] - }, - { - "id": "userAnimB", - "interpTarget": 6, - "interpDuration": 6, - "transitions": [ - { - "var": "userAnimNone", - "state": "userAnimNone" - }, - { - "var": "userAnimA", - "state": "userAnimA" - } - ] - } - ] - }, - "children": [ - { - "id": "userAnimNone", - "type": "poleVectorConstraint", - "data": { - "enabled": false, - "referenceVector": [ 0, 0, 1 ], - "baseJointName": "RightUpLeg", - "midJointName": "RightLeg", - "tipJointName": "RightFoot", - "enabledVar": "rightFootPoleVectorEnabled", - "poleVectorVar": "rightFootPoleVector" - }, - "children": [ - { - "id": "rightFootIK", - "type": "twoBoneIK", - "data": { - "alpha": 1.0, - "enabled": false, - "interpDuration": 15, - "baseJointName": "RightUpLeg", - "midJointName": "RightLeg", - "tipJointName": "RightFoot", - "midHingeAxis": [ -1, 0, 0 ], - "alphaVar": "rightFootIKAlpha", - "enabledVar": "rightFootIKEnabled", - "endEffectorRotationVarVar": "rightFootIKRotationVar", - "endEffectorPositionVarVar": "rightFootIKPositionVar" - }, - "children": [ - { - "id": "leftFootPoleVector", - "type": "poleVectorConstraint", - "data": { - "enabled": false, - "referenceVector": [ 0, 0, 1 ], - "baseJointName": "LeftUpLeg", - "midJointName": "LeftLeg", - "tipJointName": "LeftFoot", - "enabledVar": "leftFootPoleVectorEnabled", - "poleVectorVar": "leftFootPoleVector" - }, - "children": [ - { - "id": "leftFootIK", - "type": "twoBoneIK", - "data": { - "alpha": 1.0, - "enabled": false, - "interpDuration": 15, - "baseJointName": "LeftUpLeg", - "midJointName": "LeftLeg", - "tipJointName": "LeftFoot", - "midHingeAxis": [ -1, 0, 0 ], - "alphaVar": "leftFootIKAlpha", - "enabledVar": "leftFootIKEnabled", - "endEffectorRotationVarVar": "leftFootIKRotationVar", - "endEffectorPositionVarVar": "leftFootIKPositionVar" - }, - "children": [ - { - "id": "rightHandPoleVector", - "type": "poleVectorConstraint", - "data": { - "enabled": false, - "referenceVector": [ -1, 0, 0 ], - "baseJointName": "RightArm", - "midJointName": "RightForeArm", - "tipJointName": "RightHand", - "enabledVar": "rightHandPoleVectorEnabled", - "poleVectorVar": "rightHandPoleVector" - }, - "children": [ - { - "id": "rightHandIK", - "type": "twoBoneIK", - "data": { - "alpha": 1.0, - "enabled": false, - "interpDuration": 15, - "baseJointName": "RightArm", - "midJointName": "RightForeArm", - "tipJointName": "RightHand", - "midHingeAxis": [ 0, 0, -1 ], - "alphaVar": "rightHandIKAlpha", - "enabledVar": "rightHandIKEnabled", - "endEffectorRotationVarVar": "rightHandIKRotationVar", - "endEffectorPositionVarVar": "rightHandIKPositionVar" - }, - "children": [ - { - "id": "leftHandPoleVector", - "type": "poleVectorConstraint", - "data": { - "enabled": false, - "referenceVector": [ 1, 0, 0 ], - "baseJointName": "LeftArm", - "midJointName": "LeftForeArm", - "tipJointName": "LeftHand", - "enabledVar": "leftHandPoleVectorEnabled", - "poleVectorVar": "leftHandPoleVector" - }, - "children": [ - { - "id": "leftHandIK", - "type": "twoBoneIK", - "data": { - "alpha": 1.0, - "enabled": false, - "interpDuration": 15, - "baseJointName": "LeftArm", - "midJointName": "LeftForeArm", - "tipJointName": "LeftHand", - "midHingeAxis": [ 0, 0, 1 ], - "alphaVar": "leftHandIKAlpha", - "enabledVar": "leftHandIKEnabled", - "endEffectorRotationVarVar": "leftHandIKRotationVar", - "endEffectorPositionVarVar": "leftHandIKPositionVar" - }, - "children": [ - { - "id": "userSplineIK", - "type": "splineIK", - "data": { - "alpha": 1.0, - "enabled": false, - "interpDuration": 15, - "baseJointName": "Hips", - "midJointName": "Spine2", - "tipJointName": "Head", - "basePositionVar": "hipsPosition", - "baseRotationVar": "hipsRotation", - "midPositionVar": "spine2Position", - "midRotationVar": "spine2Rotation", - "tipPositionVar": "headPosition", - "tipRotationVar": "headRotation", - "alphaVar": "splineIKAlpha", - "enabledVar": "splineIKEnabled", - "tipTargetFlexCoefficients": [ 1.0, 1.0, 1.0, 1.0, 1.0 ], - "midTargetFlexCoefficients": [ 1.0, 1.0, 1.0 ] - }, - "children": [ - { - "id": "defaultPoseOverlay", - "type": "overlay", - "data": { - "alpha": 0.0, - "alphaVar": "defaultPoseOverlayAlpha", - "boneSet": "fullBody", - "boneSetVar": "defaultPoseOverlayBoneSet" - }, - "children": [ - { - "id": "defaultPose", - "type": "defaultPose", - "data": { - }, - "children": [] - }, - { - "id": "rightHandOverlay", - "type": "overlay", - "data": { - "alpha": 0.0, - "boneSet": "rightHand", - "alphaVar": "rightHandOverlayAlpha" - }, - "children": [ - { - "id": "rightHandStateMachine", - "type": "stateMachine", - "data": { - "currentState": "rightHandGrasp", - "states": [ - { - "id": "rightHandGrasp", - "interpTarget": 3, - "interpDuration": 3, - "transitions": [ - { - "var": "isRightIndexPoint", - "state": "rightIndexPoint" - }, - { - "var": "isRightThumbRaise", - "state": "rightThumbRaise" - }, - { - "var": "isRightIndexPointAndThumbRaise", - "state": "rightIndexPointAndThumbRaise" - } - ] - }, - { - "id": "rightIndexPoint", - "interpTarget": 15, - "interpDuration": 3, - "transitions": [ - { - "var": "isRightHandGrasp", - "state": "rightHandGrasp" - }, - { - "var": "isRightThumbRaise", - "state": "rightThumbRaise" - }, - { - "var": "isRightIndexPointAndThumbRaise", - "state": "rightIndexPointAndThumbRaise" - } - ] - }, - { - "id": "rightThumbRaise", - "interpTarget": 15, - "interpDuration": 3, - "transitions": [ - { - "var": "isRightHandGrasp", - "state": "rightHandGrasp" - }, - { - "var": "isRightIndexPoint", - "state": "rightIndexPoint" - }, - { - "var": "isRightIndexPointAndThumbRaise", - "state": "rightIndexPointAndThumbRaise" - } - ] - }, - { - "id": "rightIndexPointAndThumbRaise", - "interpTarget": 15, - "interpDuration": 3, - "transitions": [ - { - "var": "isRightHandGrasp", - "state": "rightHandGrasp" - }, - { - "var": "isRightIndexPoint", - "state": "rightIndexPoint" - }, - { - "var": "isRightThumbRaise", - "state": "rightThumbRaise" - } - ] - } - ] - }, - "children": [ - { - "id": "rightHandGrasp", - "type": "blendLinear", - "data": { - "alpha": 0.0, - "alphaVar": "rightHandGraspAlpha" - }, - "children": [ - { - "id": "rightHandGraspOpen", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/hydra_pose_open_right.fbx", - "startFrame": 0.0, - "endFrame": 0.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "rightHandGraspClosed", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/hydra_pose_closed_right.fbx", - "startFrame": 0.0, - "endFrame": 0.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - } - ] - }, - { - "id": "rightIndexPoint", - "type": "blendLinear", - "data": { - "alpha": 0.0, - "alphaVar": "rightHandGraspAlpha" - }, - "children": [ - { - "id": "rightIndexPointOpen", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/touch_point_open_right.fbx", - "startFrame": 15.0, - "endFrame": 15.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "rightIndexPointClosed", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/touch_point_closed_right.fbx", - "startFrame": 15.0, - "endFrame": 15.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - } - ] - }, - { - "id": "rightThumbRaise", - "type": "blendLinear", - "data": { - "alpha": 0.0, - "alphaVar": "rightHandGraspAlpha" - }, - "children": [ - { - "id": "rightThumbRaiseOpen", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/touch_thumb_open_right.fbx", - "startFrame": 15.0, - "endFrame": 15.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "rightThumbRaiseClosed", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/touch_thumb_closed_right.fbx", - "startFrame": 15.0, - "endFrame": 15.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - } - ] - }, - { - "id": "rightIndexPointAndThumbRaise", - "type": "blendLinear", - "data": { - "alpha": 0.0, - "alphaVar": "rightHandGraspAlpha" - }, - "children": [ - { - "id": "rightIndexPointAndThumbRaiseOpen", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/touch_thumb_point_open_right.fbx", - "startFrame": 15.0, - "endFrame": 15.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "rightIndexPointAndThumbRaiseClosed", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/touch_thumb_point_closed_right.fbx", - "startFrame": 15.0, - "endFrame": 15.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - } - ] - } - ] - }, - { - "id": "leftHandOverlay", - "type": "overlay", - "data": { - "alpha": 0.0, - "boneSet": "leftHand", - "alphaVar": "leftHandOverlayAlpha" - }, - "children": [ - { - "id": "leftHandStateMachine", - "type": "stateMachine", - "data": { - "currentState": "leftHandGrasp", - "states": [ - { - "id": "leftHandGrasp", - "interpTarget": 3, - "interpDuration": 3, - "transitions": [ - { - "var": "isLeftIndexPoint", - "state": "leftIndexPoint" - }, - { - "var": "isLeftThumbRaise", - "state": "leftThumbRaise" - }, - { - "var": "isLeftIndexPointAndThumbRaise", - "state": "leftIndexPointAndThumbRaise" - } - ] - }, - { - "id": "leftIndexPoint", - "interpTarget": 15, - "interpDuration": 3, - "transitions": [ - { - "var": "isLeftHandGrasp", - "state": "leftHandGrasp" - }, - { - "var": "isLeftThumbRaise", - "state": "leftThumbRaise" - }, - { - "var": "isLeftIndexPointAndThumbRaise", - "state": "leftIndexPointAndThumbRaise" - } - ] - }, - { - "id": "leftThumbRaise", - "interpTarget": 15, - "interpDuration": 3, - "transitions": [ - { - "var": "isLeftHandGrasp", - "state": "leftHandGrasp" - }, - { - "var": "isLeftIndexPoint", - "state": "leftIndexPoint" - }, - { - "var": "isLeftIndexPointAndThumbRaise", - "state": "leftIndexPointAndThumbRaise" - } - ] - }, - { - "id": "leftIndexPointAndThumbRaise", - "interpTarget": 15, - "interpDuration": 3, - "transitions": [ - { - "var": "isLeftHandGrasp", - "state": "leftHandGrasp" - }, - { - "var": "isLeftIndexPoint", - "state": "leftIndexPoint" - }, - { - "var": "isLeftThumbRaise", - "state": "leftThumbRaise" - } - ] - } - ] - }, - "children": [ - { - "id": "leftHandGrasp", - "type": "blendLinear", - "data": { - "alpha": 0.0, - "alphaVar": "leftHandGraspAlpha" - }, - "children": [ - { - "id": "leftHandGraspOpen", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/hydra_pose_open_left.fbx", - "startFrame": 0.0, - "endFrame": 0.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "leftHandGraspClosed", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/hydra_pose_closed_left.fbx", - "startFrame": 10.0, - "endFrame": 10.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - } - ] - }, - { - "id": "leftIndexPoint", - "type": "blendLinear", - "data": { - "alpha": 0.0, - "alphaVar": "leftHandGraspAlpha" - }, - "children": [ - { - "id": "leftIndexPointOpen", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/touch_point_open_left.fbx", - "startFrame": 15.0, - "endFrame": 15.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "leftIndexPointClosed", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/touch_point_closed_left.fbx", - "startFrame": 15.0, - "endFrame": 15.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - } - ] - }, - { - "id": "leftThumbRaise", - "type": "blendLinear", - "data": { - "alpha": 0.0, - "alphaVar": "leftHandGraspAlpha" - }, - "children": [ - { - "id": "leftThumbRaiseOpen", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/touch_thumb_open_left.fbx", - "startFrame": 15.0, - "endFrame": 15.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "leftThumbRaiseClosed", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/touch_thumb_closed_left.fbx", - "startFrame": 15.0, - "endFrame": 15.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - } - ] - }, - { - "id": "leftIndexPointAndThumbRaise", - "type": "blendLinear", - "data": { - "alpha": 0.0, - "alphaVar": "leftHandGraspAlpha" - }, - "children": [ - { - "id": "leftIndexPointAndThumbRaiseOpen", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/touch_thumb_point_open_left.fbx", - "startFrame": 15.0, - "endFrame": 15.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "leftIndexPointAndThumbRaiseClosed", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/touch_thumb_point_closed_left.fbx", - "startFrame": 15.0, - "endFrame": 15.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - } - ] - } - ] - }, - { - "id": "mainStateMachine", - "type": "stateMachine", - "data": { - "outputJoints": [ "LeftFoot", "RightFoot" ], - "currentState": "idle", - "states": [ - { - "id": "idle", - "interpTarget": 20, - "interpDuration": 8, - "interpType": "snapshotPrev", - "transitions": [ - { - "var": "isMovingForward", - "state": "WALKFWD" - }, - { - "var": "isMovingBackward", - "state": "WALKBWD" - }, - { - "var": "isMovingRight", - "state": "STRAFERIGHT" - }, - { - "var": "isMovingLeft", - "state": "STRAFELEFT" - }, - { - "var": "isTurningRight", - "state": "turnRight" - }, - { - "var": "isTurningLeft", - "state": "turnLeft" - }, - { - "var": "isFlying", - "state": "fly" - }, - { - "var": "isTakeoffStand", - "state": "takeoffStand" - }, - { - "var": "isTakeoffRun", - "state": "TAKEOFFRUN" - }, - { - "var": "isInAirStand", - "state": "inAirStand" - }, - { - "var": "isInAirRun", - "state": "INAIRRUN" - }, - { - "var": "isMovingRightHmd", - "state": "strafeRightHmd" - }, - { - "var": "isMovingLeftHmd", - "state": "strafeLeftHmd" - } - ] - }, - { - "id": "idleToWalkFwd", - "interpTarget": 12, - "interpDuration": 8, - "transitions": [ - { - "var": "idleToWalkFwdOnDone", - "state": "WALKFWD" - }, - { - "var": "isNotMoving", - "state": "idle" - }, - { - "var": "isMovingBackward", - "state": "WALKBWD" - }, - { - "var": "isMovingRight", - "state": "STRAFERIGHT" - }, - { - "var": "isMovingLeft", - "state": "STRAFELEFT" - }, - { - "var": "isTurningRight", - "state": "turnRight" - }, - { - "var": "isTurningLeft", - "state": "turnLeft" - }, - { - "var": "isFlying", - "state": "fly" - }, - { - "var": "isTakeoffStand", - "state": "takeoffStand" - }, - { - "var": "isTakeoffRun", - "state": "TAKEOFFRUN" - }, - { - "var": "isInAirStand", - "state": "inAirStand" - }, - { - "var": "isInAirRun", - "state": "INAIRRUN" - }, - { - "var": "isMovingRightHmd", - "state": "strafeRightHmd" - }, - { - "var": "isMovingLeftHmd", - "state": "strafeLeftHmd" - } - ] - }, - { - "id": "idleSettle", - "interpTarget": 15, - "interpDuration": 8, - "interpType": "snapshotPrev", - "transitions": [ - { - "var": "idleSettleOnDone", - "state": "idle" - }, - { - "var": "isMovingForward", - "state": "WALKFWD" - }, - { - "var": "isMovingBackward", - "state": "WALKBWD" - }, - { - "var": "isMovingRight", - "state": "STRAFERIGHT" - }, - { - "var": "isMovingLeft", - "state": "STRAFELEFT" - }, - { - "var": "isMovingRightHmd", - "state": "strafeRightHmd" - }, - { - "var": "isMovingLeftHmd", - "state": "strafeLeftHmd" - }, - { - "var": "isTurningRight", - "state": "turnRight" - }, - { - "var": "isTurningLeft", - "state": "turnLeft" - }, - { - "var": "isFlying", - "state": "fly" - }, - { - "var": "isTakeoffStand", - "state": "takeoffStand" - }, - { - "var": "isTakeoffRun", - "state": "TAKEOFFRUN" - }, - { - "var": "isInAirStand", - "state": "inAirStand" - }, - { - "var": "isInAirRun", - "state": "INAIRRUN" - } - ] - }, - { - "id": "WALKFWD", - "interpTarget": 35, - "interpDuration": 10, - "interpType": "snapshotPrev", - "transitions": [ - { - "var": "isNotMoving", - "state": "idleSettle" - }, - { - "var": "isMovingBackward", - "state": "WALKBWD" - }, - { - "var": "isMovingRight", - "state": "STRAFERIGHT" - }, - { - "var": "isMovingLeft", - "state": "STRAFELEFT" - }, - { - "var": "isTurningRight", - "state": "turnRight" - }, - { - "var": "isTurningLeft", - "state": "turnLeft" - }, - { - "var": "isFlying", - "state": "fly" - }, - { - "var": "isTakeoffStand", - "state": "takeoffStand" - }, - { - "var": "isTakeoffRun", - "state": "TAKEOFFRUN" - }, - { - "var": "isInAirStand", - "state": "inAirStand" - }, - { - "var": "isInAirRun", - "state": "INAIRRUN" - }, - { - "var": "isMovingRightHmd", - "state": "strafeRightHmd" - }, - { - "var": "isMovingLeftHmd", - "state": "strafeLeftHmd" - } - ] - }, - { - "id": "WALKBWD", - "interpTarget": 35, - "interpDuration": 10, - "interpType": "snapshotPrev", - "transitions": [ - { - "var": "isNotMoving", - "state": "idleSettle" - }, - { - "var": "isMovingForward", - "state": "WALKFWD" - }, - { - "var": "isMovingRight", - "state": "STRAFERIGHT" - }, - { - "var": "isMovingLeft", - "state": "STRAFELEFT" - }, - { - "var": "isTurningRight", - "state": "turnRight" - }, - { - "var": "isTurningLeft", - "state": "turnLeft" - }, - { - "var": "isFlying", - "state": "fly" - }, - { - "var": "isTakeoffStand", - "state": "takeoffStand" - }, - { - "var": "isTakeoffRun", - "state": "TAKEOFFRUN" - }, - { - "var": "isInAirStand", - "state": "inAirStand" - }, - { - "var": "isInAirRun", - "state": "INAIRRUN" - }, - { - "var": "isMovingRightHmd", - "state": "strafeRightHmd" - }, - { - "var": "isMovingLeftHmd", - "state": "strafeLeftHmd" - } - ] - }, - { - "id": "STRAFERIGHT", - "interpTarget": 25, - "interpDuration": 8, - "interpType": "snapshotPrev", - "transitions": [ - { - "var": "isNotMoving", - "state": "idleSettle" - }, - { - "var": "isMovingForward", - "state": "WALKFWD" - }, - { - "var": "isMovingBackward", - "state": "WALKBWD" - }, - { - "var": "isMovingLeft", - "state": "STRAFELEFT" - }, - { - "var": "isTurningRight", - "state": "turnRight" - }, - { - "var": "isTurningLeft", - "state": "turnLeft" - }, - { - "var": "isFlying", - "state": "fly" - }, - { - "var": "isTakeoffStand", - "state": "takeoffStand" - }, - { - "var": "isTakeoffRun", - "state": "TAKEOFFRUN" - }, - { - "var": "isInAirStand", - "state": "inAirStand" - }, - { - "var": "isInAirRun", - "state": "INAIRRUN" - }, - { - "var": "isMovingRightHmd", - "state": "strafeRightHmd" - }, - { - "var": "isMovingLeftHmd", - "state": "strafeLeftHmd" - } - ] - }, - { - "id": "STRAFELEFT", - "interpTarget": 25, - "interpDuration": 8, - "interpType": "snapshotPrev", - "transitions": [ - { - "var": "isNotMoving", - "state": "idleSettle" - }, - { - "var": "isMovingForward", - "state": "WALKFWD" - }, - { - "var": "isMovingBackward", - "state": "WALKBWD" - }, - { - "var": "isMovingRight", - "state": "STRAFERIGHT" - }, - { - "var": "isTurningRight", - "state": "turnRight" - }, - { - "var": "isTurningLeft", - "state": "turnLeft" - }, - { - "var": "isFlying", - "state": "fly" - }, - { - "var": "isTakeoffStand", - "state": "takeoffStand" - }, - { - "var": "isTakeoffRun", - "state": "TAKEOFFRUN" - }, - { - "var": "isInAirStand", - "state": "inAirStand" - }, - { - "var": "isInAirRun", - "state": "INAIRRUN" - }, - { - "var": "isMovingRightHmd", - "state": "strafeRightHmd" - }, - { - "var": "isMovingLeftHmd", - "state": "strafeLeftHmd" - } - ] - }, - { - "id": "turnRight", - "interpTarget": 6, - "interpDuration": 8, - "transitions": [ - { - "var": "isNotTurning", - "state": "idle" - }, - { - "var": "isMovingForward", - "state": "WALKFWD" - }, - { - "var": "isMovingBackward", - "state": "WALKBWD" - }, - { - "var": "isMovingRight", - "state": "STRAFERIGHT" - }, - { - "var": "isMovingLeft", - "state": "STRAFELEFT" - }, - { - "var": "isTurningLeft", - "state": "turnLeft" - }, - { - "var": "isFlying", - "state": "fly" - }, - { - "var": "isTakeoffStand", - "state": "takeoffStand" - }, - { - "var": "isTakeoffRun", - "state": "TAKEOFFRUN" - }, - { - "var": "isInAirStand", - "state": "inAirStand" - }, - { - "var": "isInAirRun", - "state": "INAIRRUN" - }, - { - "var": "isMovingRightHmd", - "state": "strafeRightHmd" - }, - { - "var": "isMovingLeftHmd", - "state": "strafeLeftHmd" - } - ] - }, - { - "id": "turnLeft", - "interpTarget": 6, - "interpDuration": 8, - "transitions": [ - { - "var": "isNotTurning", - "state": "idle" - }, - { - "var": "isMovingForward", - "state": "WALKFWD" - }, - { - "var": "isMovingBackward", - "state": "WALKBWD" - }, - { - "var": "isMovingRight", - "state": "STRAFERIGHT" - }, - { - "var": "isMovingLeft", - "state": "STRAFELEFT" - }, - { - "var": "isTurningRight", - "state": "turnRight" - }, - { - "var": "isFlying", - "state": "fly" - }, - { - "var": "isTakeoffStand", - "state": "takeoffStand" - }, - { - "var": "isTakeoffRun", - "state": "TAKEOFFRUN" - }, - { - "var": "isInAirStand", - "state": "inAirStand" - }, - { - "var": "isInAirRun", - "state": "INAIRRUN" - }, - { - "var": "isMovingRightHmd", - "state": "strafeRightHmd" - }, - { - "var": "isMovingLeftHmd", - "state": "strafeLeftHmd" - } - ] - }, - { - "id": "strafeRightHmd", - "interpTarget": 5, - "interpDuration": 8, - "interpType": "snapshotPrev", - "transitions": [ - { - "var": "isNotMoving", - "state": "idleSettle" - }, - { - "var": "isMovingForward", - "state": "WALKFWD" - }, - { - "var": "isMovingBackward", - "state": "WALKBWD" - }, - { - "var": "isMovingLeftHmd", - "state": "strafeLeftHmd" - }, - { - "var": "isMovingRight", - "state": "STRAFERIGHT" - }, - { - "var": "isMovingLeft", - "state": "STRAFELEFT" - }, - { - "var": "isTurningRight", - "state": "turnRight" - }, - { - "var": "isTurningLeft", - "state": "turnLeft" - }, - { - "var": "isFlying", - "state": "fly" - }, - { - "var": "isTakeoffStand", - "state": "takeoffStand" - }, - { - "var": "isTakeoffRun", - "state": "TAKEOFFRUN" - }, - { - "var": "isInAirStand", - "state": "inAirStand" - }, - { - "var": "isInAirRun", - "state": "INAIRRUN" - } - ] - }, - { - "id": "strafeLeftHmd", - "interpTarget": 5, - "interpDuration": 8, - "interpType": "snapshotPrev", - "transitions": [ - { - "var": "isNotMoving", - "state": "idleSettle" - }, - { - "var": "isMovingForward", - "state": "WALKFWD" - }, - { - "var": "isMovingBackward", - "state": "WALKBWD" - }, - { - "var": "isMovingRightHmd", - "state": "strafeRightHmd" - }, - { - "var": "isMovingRight", - "state": "STRAFERIGHT" - }, - { - "var": "isMovingLeft", - "state": "STRAFELEFT" - }, - { - "var": "isTurningRight", - "state": "turnRight" - }, - { - "var": "isTurningLeft", - "state": "turnLeft" - }, - { - "var": "isFlying", - "state": "fly" - }, - { - "var": "isTakeoffStand", - "state": "takeoffStand" - }, - { - "var": "isTakeoffRun", - "state": "TAKEOFFRUN" - }, - { - "var": "isInAirStand", - "state": "inAirStand" - }, - { - "var": "isInAirRun", - "state": "INAIRRUN" - } - ] - }, - { - "id": "fly", - "interpTarget": 6, - "interpDuration": 6, - "transitions": [ - { - "var": "isNotFlying", - "state": "idleSettle" - } - ] - }, - { - "id": "takeoffStand", - "interpTarget": 2, - "interpDuration": 2, - "transitions": [ - { - "var": "isNotTakeoff", - "state": "inAirStand" - } - ] - }, - { - "id": "TAKEOFFRUN", - "interpTarget": 2, - "interpDuration": 2, - "transitions": [ - { - "var": "isNotTakeoff", - "state": "INAIRRUN" - } - ] - }, - { - "id": "inAirStand", - "interpTarget": 3, - "interpDuration": 3, - "interpType": "snapshotPrev", - "transitions": [ - { - "var": "isNotInAir", - "state": "landStandImpact" - } - ] - }, - { - "id": "INAIRRUN", - "interpTarget": 3, - "interpDuration": 3, - "interpType": "snapshotPrev", - "transitions": [ - { - "var": "isNotInAir", - "state": "WALKFWD" - } - ] - }, - { - "id": "landStandImpact", - "interpTarget": 1, - "interpDuration": 1, - "transitions": [ - { - "var": "isFlying", - "state": "fly" - }, - { - "var": "isTakeoffStand", - "state": "takeoffStand" - }, - { - "var": "isTakeoffRun", - "state": "TAKEOFFRUN" - }, - { - "var": "landStandImpactOnDone", - "state": "landStand" - } - ] - }, - { - "id": "landStand", - "interpTarget": 1, - "interpDuration": 1, - "transitions": [ - { - "var": "isMovingForward", - "state": "WALKFWD" - }, - { - "var": "isMovingBackward", - "state": "WALKBWD" - }, - { - "var": "isMovingRight", - "state": "STRAFERIGHT" - }, - { - "var": "isMovingLeft", - "state": "STRAFELEFT" - }, - { - "var": "isTurningRight", - "state": "turnRight" - }, - { - "var": "isTurningLeft", - "state": "turnLeft" - }, - { - "var": "isFlying", - "state": "fly" - }, - { - "var": "isTakeoffStand", - "state": "takeoffStand" - }, - { - "var": "isTakeoffRun", - "state": "TAKEOFFRUN" - }, - { - "var": "isInAirStand", - "state": "inAirStand" - }, - { - "var": "isInAirRun", - "state": "INAIRRUN" - }, - { - "var": "landStandOnDone", - "state": "idle" - }, - { - "var": "isMovingRightHmd", - "state": "strafeRightHmd" - }, - { - "var": "isMovingLeftHmd", - "state": "strafeLeftHmd" - } - ] - }, - { - "id": "LANDRUN", - "interpTarget": 2, - "interpDuration": 2, - "transitions": [ - { - "var": "isFlying", - "state": "fly" - }, - { - "var": "isTakeoffStand", - "state": "takeoffStand" - }, - { - "var": "isTakeoffRun", - "state": "TAKEOFFRUN" - }, - { - "var": "landRunOnDone", - "state": "WALKFWD" - } - ] - } - ] - }, - "children": [ - { - "id": "idle", - "type": "stateMachine", - "data": { - "currentState": "idleStand", - "states": [ - { - "id": "idleStand", - "interpTarget": 6, - "interpDuration": 10, - "transitions": [ - { - "var": "isTalking", - "state": "idleTalk" - } - ] - }, - { - "id": "idleTalk", - "interpTarget": 6, - "interpDuration": 10, - "transitions": [ - { - "var": "notIsTalking", - "state": "idleStand" - } - ] - } - ] - }, - "children": [ - { - "id": "idleStand", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/idle.fbx", - "startFrame": 0.0, - "endFrame": 300.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "idleTalk", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/talk.fbx", - "startFrame": 0.0, - "endFrame": 800.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - } - ] - }, - { - "id": "WALKFWD", - "type": "blendLinearMove", - "data": { - "alpha": 0.0, - "desiredSpeed": 1.4, - "characteristicSpeeds": [ 0.5, 1.8, 2.3, 3.2, 4.5 ], - "alphaVar": "moveForwardAlpha", - "desiredSpeedVar": "moveForwardSpeed" - }, - "children": [ - { - "id": "walkFwdShort_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/walk_short_fwd.fbx", - "startFrame": 0.0, - "endFrame": 39.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "walkFwdNormal_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/walk_fwd.fbx", - "startFrame": 0.0, - "endFrame": 30.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "walkFwdFast_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/walk_fwd_fast.fbx", - "startFrame": 0.0, - "endFrame": 25.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "walkFwdJog_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/jog_fwd.fbx", - "startFrame": 0.0, - "endFrame": 25.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "walkFwdRun_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/run_fwd.fbx", - "startFrame": 0.0, - "endFrame": 21.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - } - ] - }, - { - "id": "idleToWalkFwd", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/idle_to_walk.fbx", - "startFrame": 1.0, - "endFrame": 13.0, - "timeScale": 1.0, - "loopFlag": false - }, - "children": [] - }, - { - "id": "idleSettle", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/settle_to_idle.fbx", - "startFrame": 1.0, - "endFrame": 59.0, - "timeScale": 1.0, - "loopFlag": false - }, - "children": [] - }, - { - "id": "WALKBWD", - "type": "blendLinearMove", - "data": { - "alpha": 0.0, - "desiredSpeed": 1.4, - "characteristicSpeeds": [ 0.6, 1.6, 2.3, 3.1 ], - "alphaVar": "moveBackwardAlpha", - "desiredSpeedVar": "moveBackwardSpeed" - }, - "children": [ - { - "id": "walkBwdShort_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/walk_short_bwd.fbx", - "startFrame": 0.0, - "endFrame": 38.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "walkBwdFast_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/walk_bwd_fast.fbx", - "startFrame": 0.0, - "endFrame": 27.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "jogBwd_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/jog_bwd.fbx", - "startFrame": 0.0, - "endFrame": 24.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "runBwd_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/run_bwd.fbx", - "startFrame": 0.0, - "endFrame": 16.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - } - ] - }, - { - "id": "turnLeft", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/turn_left.fbx", - "startFrame": 0.0, - "endFrame": 32.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "turnRight", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/turn_left.fbx", - "startFrame": 0.0, - "endFrame": 32.0, - "timeScale": 1.0, - "loopFlag": true, - "mirrorFlag": true - }, - "children": [] - }, - { - "id": "STRAFELEFT", - "type": "blendLinearMove", - "data": { - "alpha": 0.0, - "desiredSpeed": 1.4, - "characteristicSpeeds": [ 0.1, 0.5, 1.0, 2.6, 3.0 ], - "alphaVar": "moveLateralAlpha", - "desiredSpeedVar": "moveLateralSpeed" - }, - "children": [ - { - "id": "strafeLeftShortStep_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/side_step_short_left.fbx", - "startFrame": 0.0, - "endFrame": 29.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "strafeLeftStep_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/side_step_left.fbx", - "startFrame": 0.0, - "endFrame": 20.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "strafeLeftWalk_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/walk_left.fbx", - "startFrame": 0.0, - "endFrame": 35.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "strafeLeftWalkFast_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/walk_left_fast.fbx", - "startFrame": 0.0, - "endFrame": 21.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "strafeLeftJog_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/jog_left.fbx", - "startFrame": 0.0, - "endFrame": 24.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - } - ] - }, - { - "id": "STRAFERIGHT", - "type": "blendLinearMove", - "data": { - "alpha": 0.0, - "desiredSpeed": 1.4, - "characteristicSpeeds": [ 0.1, 0.5, 1.0, 2.6, 3.0 ], - "alphaVar": "moveLateralAlpha", - "desiredSpeedVar": "moveLateralSpeed" - }, - "children": [ - { - "id": "strafeRightShortStep_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/side_step_short_left.fbx", - "startFrame": 0.0, - "endFrame": 29.0, - "timeScale": 1.0, - "loopFlag": true, - "mirrorFlag": true - }, - "children": [] - }, - { - "id": "strafeRightStep_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/side_step_left.fbx", - "startFrame": 0.0, - "endFrame": 20.0, - "timeScale": 1.0, - "loopFlag": true, - "mirrorFlag": true - }, - "children": [] - }, - { - "id": "strafeRightWalk_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/walk_left.fbx", - "startFrame": 0.0, - "endFrame": 35.0, - "timeScale": 1.0, - "loopFlag": true, - "mirrorFlag": true - }, - "children": [] - }, - { - "id": "strafeRightFast_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/walk_left_fast.fbx", - "startFrame": 0.0, - "endFrame": 21.0, - "timeScale": 1.0, - "loopFlag": true, - "mirrorFlag": true - }, - "children": [] - }, - { - "id": "strafeRightJog_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/jog_left.fbx", - "startFrame": 0.0, - "endFrame": 24.0, - "timeScale": 1.0, - "loopFlag": true, - "mirrorFlag": true - }, - "children": [] - } - ] - }, - { - "id": "strafeLeftHmd", - "type": "blendLinearMove", - "data": { - "alpha": 0.0, - "desiredSpeed": 1.4, - "characteristicSpeeds": [ 0, 0.5, 2.5 ], - "alphaVar": "moveLateralAlpha", - "desiredSpeedVar": "moveLateralSpeed" - }, - "children": [ - { - "id": "stepLeftShort_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/side_step_short_left.fbx", - "startFrame": 0.0, - "endFrame": 29.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "stepLeft_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/side_step_left.fbx", - "startFrame": 0.0, - "endFrame": 20.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "strafeLeftAnim_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/side_step_left_fast.fbx", - "startFrame": 0.0, - "endFrame": 16.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - } - ] - }, - { - "id": "strafeRightHmd", - "type": "blendLinearMove", - "data": { - "alpha": 0.0, - "desiredSpeed": 1.4, - "characteristicSpeeds": [ 0, 0.5, 2.5 ], - "alphaVar": "moveLateralAlpha", - "desiredSpeedVar": "moveLateralSpeed" - }, - "children": [ - { - "id": "stepRightShort_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/side_step_short_left.fbx", - "startFrame": 0.0, - "endFrame": 29.0, - "timeScale": 1.0, - "loopFlag": true, - "mirrorFlag": true - }, - "children": [] - }, - { - "id": "stepRight_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/side_step_left.fbx", - "startFrame": 0.0, - "endFrame": 20.0, - "timeScale": 1.0, - "loopFlag": true, - "mirrorFlag": true - }, - "children": [] - }, - { - "id": "strafeRightAnim_c", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/side_step_left_fast.fbx", - "startFrame": 0.0, - "endFrame": 16.0, - "timeScale": 1.0, - "loopFlag": true, - "mirrorFlag": true - }, - "children": [] - } - ] - }, - { - "id": "fly", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/fly.fbx", - "startFrame": 1.0, - "endFrame": 80.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "takeoffStand", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/jump_standing_launch.fbx", - "startFrame": 2.0, - "endFrame": 16.0, - "timeScale": 1.0, - "loopFlag": false - }, - "children": [] - }, - { - "id": "TAKEOFFRUN", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/jump_running_launch_land.fbx", - "startFrame": 4.0, - "endFrame": 15.0, - "timeScale": 1.0, - "loopFlag": false - }, - "children": [] - }, - { - "id": "inAirStand", - "type": "blendLinear", - "data": { - "alpha": 0.0, - "alphaVar": "inAirAlpha" - }, - "children": [ - { - "id": "inAirStandPreApex", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/jump_standing_apex.fbx", - "startFrame": 0.0, - "endFrame": 0.0, - "timeScale": 1.0, - "loopFlag": false - }, - "children": [] - }, - { - "id": "inAirStandApex", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/jump_standing_apex.fbx", - "startFrame": 1.0, - "endFrame": 1.0, - "timeScale": 1.0, - "loopFlag": false - }, - "children": [] - }, - { - "id": "inAirStandPostApex", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/jump_standing_apex.fbx", - "startFrame": 2.0, - "endFrame": 2.0, - "timeScale": 1.0, - "loopFlag": false - }, - "children": [] - } - ] - }, - { - "id": "INAIRRUN", - "type": "blendLinear", - "data": { - "alpha": 0.0, - "alphaVar": "inAirAlpha" - }, - "children": [ - { - "id": "inAirRunPreApex", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/jump_running_launch_land.fbx", - "startFrame": 16.0, - "endFrame": 16.0, - "timeScale": 1.0, - "loopFlag": false - }, - "children": [] - }, - { - "id": "inAirRunApex", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/jump_running_launch_land.fbx", - "startFrame": 22.0, - "endFrame": 22.0, - "timeScale": 1.0, - "loopFlag": false - }, - "children": [] - }, - { - "id": "inAirRunPostApex", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/jump_running_launch_land.fbx", - "startFrame": 33.0, - "endFrame": 33.0, - "timeScale": 1.0, - "loopFlag": false - }, - "children": [] - } - ] - }, - { - "id": "landStandImpact", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/jump_standing_land_settle.fbx", - "startFrame": 1.0, - "endFrame": 6.0, - "timeScale": 1.0, - "loopFlag": false - }, - "children": [] - }, - { - "id": "landStand", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/jump_standing_land_settle.fbx", - "startFrame": 6.0, - "endFrame": 68.0, - "timeScale": 1.0, - "loopFlag": false - }, - "children": [] - }, - { - "id": "LANDRUN", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/jump_running_launch_land.fbx", - "startFrame": 29.0, - "endFrame": 40.0, - "timeScale": 1.0, - "loopFlag": false - }, - "children": [] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "id": "userAnimA", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/idle.fbx", - "startFrame": 0.0, - "endFrame": 90.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - }, - { - "id": "userAnimB", - "type": "clip", - "data": { - "url": "qrc:///avatar/animations/idle.fbx", - "startFrame": 0.0, - "endFrame": 90.0, - "timeScale": 1.0, - "loopFlag": true - }, - "children": [] - } - ] - } -} diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 2522d0e4c6..87589ab432 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -3098,7 +3098,7 @@ void MyAvatar::initAnimGraph() { graphUrl = PathUtils::resourcesUrl("avatar/avatar-animation.json"); #if defined(Q_OS_ANDROID) || defined(HIFI_USE_OPTIMIZED_IK) - graphUrl = PathUtils::resourcesUrl("avatar/avatar-animation_withSplineIKNode.json"); + graphUrl = PathUtils::resourcesUrl("avatar/avatar-animation-optimized-ik.json"); #endif } From b92badbe769073d7b58fa372dc7b7b1b0ffe5c9e Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Wed, 13 Nov 2019 08:23:27 -0800 Subject: [PATCH 03/22] Updated avatar-animation-optimized-ik.json from latest avatar-animation.json --- .../avatar/avatar-animation-optimized-ik.json | 279 +++++++++++++++--- 1 file changed, 239 insertions(+), 40 deletions(-) diff --git a/interface/resources/avatar/avatar-animation-optimized-ik.json b/interface/resources/avatar/avatar-animation-optimized-ik.json index c69863b190..2aad89228a 100644 --- a/interface/resources/avatar/avatar-animation-optimized-ik.json +++ b/interface/resources/avatar/avatar-animation-optimized-ik.json @@ -4717,16 +4717,117 @@ }, { "children": [ + { + "children": [ + ], + "data": { + "endFrame": 59, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/settle_to_idle.fbx" + }, + "id": "idleSettle01", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "blendType": "", + "endFrame": 40, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/settle_to_idle02.fbx" + }, + "id": "idleSettle02", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 60, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/settle_to_idle03.fbx" + }, + "id": "idleSettle03", + "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 82, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/settle_to_idle04.fbx" + }, + "id": "idleSettle04", + "type": "clip" + } ], "data": { + "currentState": "idleSettle01", "endFrame": 59, "loopFlag": false, + "randomSwitchTimeMin": 1, "startFrame": 1, + "states": [ + { + "easingType": "easeInOutQuad", + "id": "idleSettle01", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "idleSettle02", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "idleSettle03", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + }, + { + "easingType": "easeInOutQuad", + "id": "idleSettle04", + "interpDuration": 1, + "interpTarget": 1, + "interpType": "evaluateBoth", + "priority": 1, + "resume": false, + "transitions": [ + ] + } + ], "timeScale": 1, - "url": "qrc:///avatar/animations/settle_to_idle_small.fbx" + "url": "qrc:///avatar/animations/settle_to_idle.fbx" }, "id": "idleSettle", - "type": "clip" + "type": "randomSwitchStateMachine" }, { "children": [ @@ -5259,6 +5360,19 @@ }, "id": "LANDRUN", "type": "clip" + }, + { + "children": [ + ], + "data": { + "endFrame": 40, + "loopFlag": false, + "startFrame": 1, + "timeScale": 1, + "url": "qrc:///avatar/animations/settle_to_idle_small.fbx" + }, + "id": "idleSettleSmall", + "type": "clip" } ], "data": { @@ -5284,7 +5398,7 @@ { "easingType": "easeInOutQuad", "id": "idle", - "interpDuration": 15, + "interpDuration": 20, "interpTarget": 20, "interpType": "evaluateBoth", "transitions": [ @@ -5416,13 +5530,114 @@ { "easingType": "easeInOutQuad", "id": "idleSettle", - "interpDuration": 13, - "interpTarget": 14, + "interpDuration": 15, + "interpTarget": 15, "interpType": "snapshotPrev", "transitions": [ { "state": "idle", - "var": "idleSettleOnDone" + "var": "idleSettle01OnDone" + }, + { + "state": "idle", + "var": "idleSettle02OnDone" + }, + { + "state": "idle", + "var": "idleSettle03OnDone" + }, + { + "state": "idle", + "var": "idleSettle04OnDone" + }, + { + "state": "idle", + "var": "reactionPositiveTrigger" + }, + { + "state": "idle", + "var": "reactionNegativeTrigger" + }, + { + "state": "idle", + "var": "reactionRaiseHandEnabled" + }, + { + "state": "idle", + "var": "reactionApplaudEnabled" + }, + { + "state": "idle", + "var": "reactionPointEnabled" + }, + { + "state": "WALKFWD", + "var": "isInputForward" + }, + { + "state": "WALKBWD", + "var": "isInputBackward" + }, + { + "state": "STRAFERIGHT", + "var": "isInputRight" + }, + { + "state": "STRAFELEFT", + "var": "isInputLeft" + }, + { + "state": "strafeRightHmd", + "var": "isMovingRightHmd" + }, + { + "state": "strafeLeftHmd", + "var": "isMovingLeftHmd" + }, + { + "state": "turnRight", + "var": "isTurningRight" + }, + { + "state": "turnLeft", + "var": "isTurningLeft" + }, + { + "state": "fly", + "var": "isFlying" + }, + { + "state": "takeoffStand", + "var": "isTakeoffStand" + }, + { + "state": "TAKEOFFRUN", + "var": "isTakeoffRun" + }, + { + "state": "inAirStand", + "var": "isInAirStand" + }, + { + "state": "INAIRRUN", + "var": "isInAirRun" + }, + { + "state": "seated", + "var": "isSeated" + } + ] + }, + { + "easingType": "easeInOutQuad", + "id": "idleSettleSmall", + "interpDuration": 10, + "interpTarget": 10, + "interpType": "snapshotPrev", + "transitions": [ + { + "state": "idle", + "var": "idleSettleSmallOnDone" }, { "state": "idle", @@ -5508,6 +5723,10 @@ "interpTarget": 35, "interpType": "snapshotPrev", "transitions": [ + { + "state": "idleSettleSmall", + "var": "isNotInputNoMomentum" + }, { "state": "idleSettle", "var": "isNotInputSlow" @@ -5572,6 +5791,10 @@ "interpTarget": 35, "interpType": "snapshotPrev", "transitions": [ + { + "state": "idleSettleSmall", + "var": "isNotInputNoMomentum" + }, { "state": "idleSettle", "var": "isNotInputSlow" @@ -5636,6 +5859,10 @@ "interpTarget": 25, "interpType": "snapshotPrev", "transitions": [ + { + "state": "idleSettleSmall", + "var": "isNotInputNoMomentum" + }, { "state": "idleSettle", "var": "isNotInputSlow" @@ -5680,14 +5907,6 @@ "state": "INAIRRUN", "var": "isInAirRun" }, - { - "state": "strafeRightHmd", - "var": "isMovingRightHmd" - }, - { - "state": "strafeLeftHmd", - "var": "isMovingLeftHmd" - }, { "state": "seated", "var": "isSeated" @@ -5700,6 +5919,10 @@ "interpTarget": 25, "interpType": "snapshotPrev", "transitions": [ + { + "state": "idleSettleSmall", + "var": "isNotInputNoMomentum" + }, { "state": "idleSettle", "var": "isNotInputSlow" @@ -5744,14 +5967,6 @@ "state": "INAIRRUN", "var": "isInAirRun" }, - { - "state": "strafeRightHmd", - "var": "isMovingRightHmd" - }, - { - "state": "strafeLeftHmd", - "var": "isMovingLeftHmd" - }, { "state": "seated", "var": "isSeated" @@ -5896,7 +6111,7 @@ "transitions": [ { "state": "idleSettle", - "var": "isNotInput" + "var": "isNotMoving" }, { "state": "WALKFWD", @@ -5910,14 +6125,6 @@ "state": "strafeLeftHmd", "var": "isMovingLeftHmd" }, - { - "state": "STRAFERIGHT", - "var": "isInputRight" - }, - { - "state": "STRAFELEFT", - "var": "isInputLeft" - }, { "state": "turnRight", "var": "isTurningRight" @@ -5960,7 +6167,7 @@ "transitions": [ { "state": "idleSettle", - "var": "isNotInput" + "var": "isNotMoving" }, { "state": "WALKFWD", @@ -5974,14 +6181,6 @@ "state": "strafeRightHmd", "var": "isMovingRightHmd" }, - { - "state": "STRAFERIGHT", - "var": "isInputRight" - }, - { - "state": "STRAFELEFT", - "var": "isInputLeft" - }, { "state": "turnRight", "var": "isTurningRight" From e81b21ac592f8818e0627e655b4f477ccfb19550 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Wed, 13 Nov 2019 10:40:00 -0800 Subject: [PATCH 04/22] bug fix from code review comment --- interface/src/octree/SafeLanding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index bcf345bae8..ab002e4868 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -151,7 +151,7 @@ void SafeLanding::updateTracking() { shouldStop = (sequenceSize == 0 || (startIter != _sequenceNumbers.end() && endIter != _sequenceNumbers.end() && - !tooManySequenceNumbers && + tooManySequenceNumbers && ((distance(startIter, endIter) == sequenceSize - 1) || !missingSequenceNumbers))); if (shouldStop) { From 487515d956274b90b171517e7f99f1da81df317c Mon Sep 17 00:00:00 2001 From: Anthony Thibault Date: Wed, 13 Nov 2019 17:17:17 -0800 Subject: [PATCH 05/22] Revert "bug fix from code review comment" This reverts commit e81b21ac592f8818e0627e655b4f477ccfb19550. --- interface/src/octree/SafeLanding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index ab002e4868..bcf345bae8 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -151,7 +151,7 @@ void SafeLanding::updateTracking() { shouldStop = (sequenceSize == 0 || (startIter != _sequenceNumbers.end() && endIter != _sequenceNumbers.end() && - tooManySequenceNumbers && + !tooManySequenceNumbers && ((distance(startIter, endIter) == sequenceSize - 1) || !missingSequenceNumbers))); if (shouldStop) { From 929e829801c4e644af2114867f82496aa6b4a9d4 Mon Sep 17 00:00:00 2001 From: Anthony Thibault Date: Wed, 13 Nov 2019 17:17:37 -0800 Subject: [PATCH 06/22] Revert "Speculative fix for infinite loop in SafeLanding" This reverts commit 52acfc9333cb527dc97d940d65da976d1af1ab76. --- interface/src/octree/SafeLanding.cpp | 75 ++++++++++++---------------- interface/src/octree/SafeLanding.h | 4 +- 2 files changed, 34 insertions(+), 45 deletions(-) diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index bcf345bae8..fbc35f2732 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -39,7 +39,6 @@ bool SafeLanding::SequenceLessThan::operator()(const OCTREE_PACKET_SEQUENCE& a, void SafeLanding::startTracking(QSharedPointer entityTreeRenderer) { if (!entityTreeRenderer.isNull()) { - qCDebug(interfaceapp) << "SafeLanding has started tracking"; auto entityTree = entityTreeRenderer->getTree(); if (entityTree && !_trackingEntities) { Locker lock(_lock); @@ -105,55 +104,47 @@ void SafeLanding::updateTracking() { return; } - Locker lock(_lock); - - bool enableInterstitial = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); - auto entityMapIter = _trackedEntities.begin(); - while (entityMapIter != _trackedEntities.end()) { - auto entity = entityMapIter->second; - bool isVisuallyReady = true; - if (enableInterstitial) { - auto entityRenderable = _entityTreeRenderer->renderableForEntityId(entityMapIter->first); - if (!entityRenderable) { - _entityTreeRenderer->addingEntity(entityMapIter->first); + { + Locker lock(_lock); + bool enableInterstitial = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); + auto entityMapIter = _trackedEntities.begin(); + while (entityMapIter != _trackedEntities.end()) { + auto entity = entityMapIter->second; + bool isVisuallyReady = true; + if (enableInterstitial) { + auto entityRenderable = _entityTreeRenderer->renderableForEntityId(entityMapIter->first); + if (!entityRenderable) { + _entityTreeRenderer->addingEntity(entityMapIter->first); + } + isVisuallyReady = entity->isVisuallyReady() || (!entityRenderable && !entity->isParentPathComplete()); + } + if (isEntityPhysicsReady(entity) && isVisuallyReady) { + entityMapIter = _trackedEntities.erase(entityMapIter); + } else { + entityMapIter++; } - isVisuallyReady = entity->isVisuallyReady() || (!entityRenderable && !entity->isParentPathComplete()); } - if (isEntityPhysicsReady(entity) && isVisuallyReady) { - entityMapIter = _trackedEntities.erase(entityMapIter); - } else { - entityMapIter++; + if (enableInterstitial) { + _trackedEntityStabilityCount++; } } - if (enableInterstitial) { - _trackedEntityStabilityCount++; - } if (_trackedEntities.empty()) { // no more tracked entities --> check sequenceNumbers if (_sequenceStart != SafeLanding::INVALID_SEQUENCE) { bool shouldStop = false; - auto sequenceSize = _sequenceEnd - _sequenceStart; // this works even in rollover case - auto startIter = _sequenceNumbers.find(_sequenceStart); - auto endIter = _sequenceNumbers.find(_sequenceEnd - 1); + { + Locker lock(_lock); + auto sequenceSize = _sequenceEnd - _sequenceStart; // this works even in rollover case + auto startIter = _sequenceNumbers.find(_sequenceStart); + auto endIter = _sequenceNumbers.find(_sequenceEnd - 1); - bool missingSequenceNumbers = qApp->isMissingSequenceNumbers(); - - // If the EntityQueryInitialResultsComplete packet is really late due to packet loss, the - // _sequenceNumbers map will be filled with unnecessary sequence numbers. This can cause - // the main thread to enter an infinite loop in the std::distance() calculation. - // Try to guard against this. This might cause physics to be enabled too soon, but - // that is preferable to locking up. - bool tooManySequenceNumbers = _sequenceNumbers.size() >= (std::numeric_limits::max() / 2); - - qCDebug(interfaceapp) << "SafeLanding has no more tracked entities and" << _sequenceNumbers.size() << "sequence numbers"; - - shouldStop = (sequenceSize == 0 || + bool missingSequenceNumbers = qApp->isMissingSequenceNumbers(); + shouldStop = (sequenceSize == 0 || (startIter != _sequenceNumbers.end() && endIter != _sequenceNumbers.end() && - !tooManySequenceNumbers && ((distance(startIter, endIter) == sequenceSize - 1) || !missingSequenceNumbers))); - + } if (shouldStop) { stopTracking(); } @@ -162,8 +153,6 @@ void SafeLanding::updateTracking() { } void SafeLanding::stopTracking() { - qCDebug(interfaceapp) << "SafeLanding has stopped tracking"; - Locker lock(_lock); if (_trackingEntities) { _trackingEntities = false; @@ -180,7 +169,6 @@ void SafeLanding::stopTracking() { } void SafeLanding::reset() { - Locker lock(_lock); _trackingEntities = false; _trackedEntities.clear(); _maxTrackedEntityCount = 0; @@ -189,7 +177,6 @@ void SafeLanding::reset() { } bool SafeLanding::trackingIsComplete() const { - Locker lock(_lock); return !_trackingEntities && (_sequenceStart != SafeLanding::INVALID_SEQUENCE); } @@ -254,8 +241,10 @@ void SafeLanding::debugDumpSequenceIDs() const { ++itr; while (itr != _sequenceNumbers.end()) { OCTREE_PACKET_SEQUENCE s = *itr; - qCDebug(interfaceapp) << " " << (int32_t)s; - p = s; + if (s != p + 1) { + qCDebug(interfaceapp) << "Gap from" << (int32_t)p << "to" << (int32_t)s << "(exclusive)"; + p = s; + } ++itr; } if (p != SafeLanding::INVALID_SEQUENCE) { diff --git a/interface/src/octree/SafeLanding.h b/interface/src/octree/SafeLanding.h index d3131752bf..00473f6fc8 100644 --- a/interface/src/octree/SafeLanding.h +++ b/interface/src/octree/SafeLanding.h @@ -51,8 +51,8 @@ private: bool isEntityPhysicsReady(const EntityItemPointer& entity); void debugDumpSequenceIDs() const; - mutable std::recursive_mutex _lock; - using Locker = std::lock_guard; + std::mutex _lock; + using Locker = std::lock_guard; bool _trackingEntities { false }; QSharedPointer _entityTreeRenderer; using EntityMap = std::map; From 9d92546a8b53728cbd210531aeb54897b44e0e73 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Tue, 15 Oct 2019 14:52:12 -0700 Subject: [PATCH 07/22] revert the revert of PR-16307 --- interface/src/InterfaceParentFinder.cpp | 4 - interface/src/avatar/AvatarManager.cpp | 20 +- interface/src/avatar/MyAvatar.cpp | 61 +-- interface/src/avatar/OtherAvatar.cpp | 8 +- interface/src/ui/AvatarCertifyBanner.cpp | 11 +- .../src/avatars-renderer/Avatar.cpp | 12 +- libraries/avatars/src/AvatarData.cpp | 5 +- libraries/avatars/src/AvatarData.h | 2 +- .../src/EntityTreeRenderer.cpp | 14 +- .../src/EntityTreeRenderer.h | 1 + .../src/RenderableEntityItem.cpp | 5 +- .../entities/src/DeleteEntityOperator.cpp | 9 + libraries/entities/src/DeleteEntityOperator.h | 1 + libraries/entities/src/EntityEditFilters.cpp | 2 +- libraries/entities/src/EntityEditFilters.h | 2 +- .../entities/src/EntityEditPacketSender.cpp | 8 +- libraries/entities/src/EntityItem.cpp | 44 ++- libraries/entities/src/EntityItem.h | 7 +- .../entities/src/EntityItemProperties.cpp | 2 +- .../entities/src/EntityScriptingInterface.cpp | 95 ++--- libraries/entities/src/EntitySimulation.cpp | 92 ++--- libraries/entities/src/EntitySimulation.h | 46 +-- libraries/entities/src/EntityTree.cpp | 354 ++++++++++-------- libraries/entities/src/EntityTree.h | 19 +- libraries/entities/src/EntityTreeElement.cpp | 2 +- .../entities/src/SimpleEntitySimulation.cpp | 17 +- .../entities/src/SimpleEntitySimulation.h | 10 +- libraries/physics/src/EntityMotionState.cpp | 24 +- libraries/physics/src/EntityMotionState.h | 2 +- .../physics/src/PhysicalEntitySimulation.cpp | 111 ++++-- .../physics/src/PhysicalEntitySimulation.h | 24 +- libraries/shared/src/PhysicsHelpers.cpp | 6 +- libraries/shared/src/SpatialParentFinder.h | 2 +- tests/octree/src/ModelTests.cpp | 7 +- 34 files changed, 572 insertions(+), 457 deletions(-) diff --git a/interface/src/InterfaceParentFinder.cpp b/interface/src/InterfaceParentFinder.cpp index 33328f54cc..0f1c8876a9 100644 --- a/interface/src/InterfaceParentFinder.cpp +++ b/interface/src/InterfaceParentFinder.cpp @@ -45,10 +45,6 @@ SpatiallyNestableWeakPointer InterfaceParentFinder::find(QUuid parentID, bool& s success = true; return parent; } - if (parentID == AVATAR_SELF_ID) { - success = true; - return avatarManager->getMyAvatar(); - } success = false; return parent; diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index 553033f394..32e725388c 100755 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -543,26 +543,8 @@ void AvatarManager::removeDeadAvatarEntities(const SetOfEntities& deadEntities) for (auto entity : deadEntities) { QUuid entityOwnerID = entity->getOwningAvatarID(); AvatarSharedPointer avatar = getAvatarBySessionID(entityOwnerID); - const bool REQUIRES_REMOVAL_FROM_TREE = false; if (avatar) { - avatar->clearAvatarEntity(entity->getID(), REQUIRES_REMOVAL_FROM_TREE); - } - if (entityTree && entity->isMyAvatarEntity()) { - entityTree->withWriteLock([&] { - // We only need to delete the direct children (rather than the descendants) because - // when the child is deleted, it will take care of its own children. If the child - // is also an avatar-entity, we'll end up back here. If it's not, the entity-server - // will take care of it in the usual way. - entity->forEachChild([&](SpatiallyNestablePointer child) { - EntityItemPointer childEntity = std::dynamic_pointer_cast(child); - if (childEntity) { - entityTree->deleteEntity(childEntity->getID(), true, true); - if (avatar) { - avatar->clearAvatarEntity(childEntity->getID(), REQUIRES_REMOVAL_FROM_TREE); - } - } - }); - }); + avatar->clearAvatarEntity(entity->getID()); } } } diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 87589ab432..5c10e05806 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1518,7 +1518,8 @@ void MyAvatar::storeAvatarEntityDataPayload(const QUuid& entityID, const QByteAr } void MyAvatar::clearAvatarEntity(const QUuid& entityID, bool requiresRemovalFromTree) { - AvatarData::clearAvatarEntity(entityID, requiresRemovalFromTree); + // NOTE: the requiresRemovalFromTree argument is unused + AvatarData::clearAvatarEntity(entityID); _avatarEntitiesLock.withWriteLock([&] { _cachedAvatarEntityBlobsToDelete.push_back(entityID); }); @@ -1526,7 +1527,12 @@ void MyAvatar::clearAvatarEntity(const QUuid& entityID, bool requiresRemovalFrom void MyAvatar::sanitizeAvatarEntityProperties(EntityItemProperties& properties) const { properties.setEntityHostType(entity::HostType::AVATAR); - properties.setOwningAvatarID(getID()); + + // Note: we store AVATAR_SELF_ID in EntityItem::_owningAvatarID and we usually + // store the actual sessionUUID in EntityItemProperties::_owningAvatarID (for JS + // consumption, for example). However at this context we are preparing properties + // for outgoing packet, in which case we use AVATAR_SELF_ID. + properties.setOwningAvatarID(AVATAR_SELF_ID); // there's no entity-server to tell us we're the simulation owner, so always set the // simulationOwner to the owningAvatarID and a high priority. @@ -1583,13 +1589,16 @@ void MyAvatar::handleChangedAvatarEntityData() { // move the lists to minimize lock time std::vector cachedBlobsToDelete; std::vector cachedBlobsToUpdate; - std::vector entitiesToDelete; + QSet idsToDelete; std::vector entitiesToAdd; std::vector entitiesToUpdate; _avatarEntitiesLock.withWriteLock([&] { cachedBlobsToDelete = std::move(_cachedAvatarEntityBlobsToDelete); cachedBlobsToUpdate = std::move(_cachedAvatarEntityBlobsToAddOrUpdate); - entitiesToDelete = std::move(_entitiesToDelete); + foreach (auto id, _entitiesToDelete) { + idsToDelete.insert(id); + } + _entitiesToDelete.clear(); entitiesToAdd = std::move(_entitiesToAdd); entitiesToUpdate = std::move(_entitiesToUpdate); }); @@ -1607,7 +1616,7 @@ void MyAvatar::handleChangedAvatarEntityData() { }; // remove delete-add and delete-update overlap - for (const auto& id : entitiesToDelete) { + for (const auto& id : idsToDelete) { removeAllInstancesHelper(id, cachedBlobsToUpdate); removeAllInstancesHelper(id, entitiesToAdd); removeAllInstancesHelper(id, entitiesToUpdate); @@ -1621,11 +1630,9 @@ void MyAvatar::handleChangedAvatarEntityData() { } // DELETE real entities - for (const auto& id : entitiesToDelete) { - entityTree->withWriteLock([&] { - entityTree->deleteEntity(id); - }); - } + entityTree->withWriteLock([&] { + entityTree->deleteEntitiesByID(idsToDelete); + }); // ADD real entities EntityEditPacketSender* packetSender = qApp->getEntityEditPacketSender(); @@ -1738,7 +1745,7 @@ void MyAvatar::handleChangedAvatarEntityData() { // we have a client traits handler // flag removed entities as deleted so that changes are sent next frame _avatarEntitiesLock.withWriteLock([&] { - for (const auto& id : entitiesToDelete) { + for (const auto& id : idsToDelete) { if (_packedAvatarEntityData.find(id) != _packedAvatarEntityData.end()) { _clientTraitsHandler->markInstancedTraitDeleted(AvatarTraits::AvatarEntity, id); } @@ -2469,18 +2476,11 @@ bool isWearableEntity(const EntityItemPointer& entity) { void MyAvatar::removeWornAvatarEntity(const EntityItemID& entityID) { auto treeRenderer = DependencyManager::get(); EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr; - if (entityTree) { auto entity = entityTree->findEntityByID(entityID); if (entity && isWearableEntity(entity)) { - entityTree->withWriteLock([&entityID, &entityTree] { - // remove this entity first from the entity tree - entityTree->deleteEntity(entityID, true, true); - }); - - // remove the avatar entity from our internal list - // (but indicate it doesn't need to be pulled from the tree) - clearAvatarEntity(entityID, false); + treeRenderer->deleteEntity(entityID); + clearAvatarEntity(entityID); } } } @@ -2490,8 +2490,16 @@ void MyAvatar::clearWornAvatarEntities() { _avatarEntitiesLock.withReadLock([&] { avatarEntityIDs = _packedAvatarEntityData.keys(); }); - for (auto entityID : avatarEntityIDs) { - removeWornAvatarEntity(entityID); + auto treeRenderer = DependencyManager::get(); + EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr; + if (entityTree) { + for (auto entityID : avatarEntityIDs) { + auto entity = entityTree->findEntityByID(entityID); + if (entity && isWearableEntity(entity)) { + treeRenderer->deleteEntity(entityID); + clearAvatarEntity(entityID); + } + } } } @@ -3934,6 +3942,10 @@ float MyAvatar::getGravity() { void MyAvatar::setSessionUUID(const QUuid& sessionUUID) { QUuid oldSessionID = getSessionUUID(); Avatar::setSessionUUID(sessionUUID); + bool sendPackets = !DependencyManager::get()->getSessionUUID().isNull(); + if (!sendPackets) { + return; + } QUuid newSessionID = getSessionUUID(); if (newSessionID != oldSessionID) { auto treeRenderer = DependencyManager::get(); @@ -3943,7 +3955,6 @@ void MyAvatar::setSessionUUID(const QUuid& sessionUUID) { _avatarEntitiesLock.withReadLock([&] { avatarEntityIDs = _packedAvatarEntityData.keys(); }); - bool sendPackets = !DependencyManager::get()->getSessionUUID().isNull(); EntityEditPacketSender* packetSender = qApp->getEntityEditPacketSender(); entityTree->withWriteLock([&] { for (const auto& entityID : avatarEntityIDs) { @@ -3951,11 +3962,9 @@ void MyAvatar::setSessionUUID(const QUuid& sessionUUID) { if (!entity) { continue; } - // update OwningAvatarID so entity can be identified as "ours" later - entity->setOwningAvatarID(newSessionID); // NOTE: each attached AvatarEntity already have the correct updated parentID // via magic in SpatiallyNestable, hence we check against newSessionID - if (sendPackets && entity->getParentID() == newSessionID) { + if (entity->getParentID() == newSessionID) { // but when we have a real session and the AvatarEntity is parented to MyAvatar // we need to update the "packedAvatarEntityData" sent to the avatar-mixer // because it contains a stale parentID somewhere deep inside diff --git a/interface/src/avatar/OtherAvatar.cpp b/interface/src/avatar/OtherAvatar.cpp index 50f6369dbe..43d1ddeaad 100755 --- a/interface/src/avatar/OtherAvatar.cpp +++ b/interface/src/avatar/OtherAvatar.cpp @@ -561,11 +561,17 @@ void OtherAvatar::handleChangedAvatarEntityData() { _avatarEntitiesLock.withReadLock([&] { packedAvatarEntityData = _packedAvatarEntityData; }); + QSet idsToDelete; foreach (auto entityID, recentlyRemovedAvatarEntities) { if (!packedAvatarEntityData.contains(entityID)) { - entityTree->deleteEntity(entityID, true, true); + idsToDelete.insert(entityID); } } + if (!idsToDelete.empty()) { + bool force = true; + bool ignoreWarnings = true; + entityTree->deleteEntitiesByID(idsToDelete, force, ignoreWarnings); + } // TODO: move this outside of tree lock // remove stale data hashes diff --git a/interface/src/ui/AvatarCertifyBanner.cpp b/interface/src/ui/AvatarCertifyBanner.cpp index 5101188885..3fe2ed2027 100644 --- a/interface/src/ui/AvatarCertifyBanner.cpp +++ b/interface/src/ui/AvatarCertifyBanner.cpp @@ -62,16 +62,7 @@ void AvatarCertifyBanner::show(const QUuid& avatarID) { void AvatarCertifyBanner::clear() { if (_active) { - auto entityTreeRenderer = DependencyManager::get(); - EntityTreePointer entityTree = entityTreeRenderer->getTree(); - if (!entityTree) { - return; - } - - entityTree->withWriteLock([&] { - entityTree->deleteEntity(_bannerID); - }); - + DependencyManager::get()->deleteEntity(_bannerID); _active = false; } } diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp index 9b8ce8cf34..6f0fef40d2 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp @@ -340,11 +340,13 @@ void Avatar::removeAvatarEntitiesFromTree() { _avatarEntitiesLock.withReadLock([&] { avatarEntityIDs = _packedAvatarEntityData.keys(); }); - entityTree->withWriteLock([&] { - for (const auto& entityID : avatarEntityIDs) { - entityTree->deleteEntity(entityID, true, true); - } - }); + QSet ids; + foreach (auto id, avatarEntityIDs) { + ids.insert(id); + } + bool force = true; + bool ignoreWarnings = true; + entityTree->deleteEntitiesByID(ids, force, ignoreWarnings); // locks tree } } diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index 93850197af..5fe7998ecb 100755 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -3033,15 +3033,12 @@ void AvatarData::updateAvatarEntity(const QUuid& entityID, const QByteArray& ent } void AvatarData::clearAvatarEntity(const QUuid& entityID, bool requiresRemovalFromTree) { - + // NOTE: requiresRemovalFromTree is unused bool removedEntity = false; - _avatarEntitiesLock.withWriteLock([this, &removedEntity, &entityID] { removedEntity = _packedAvatarEntityData.remove(entityID); }); - insertRemovedEntityID(entityID); - if (removedEntity && _clientTraitsHandler) { // we have a client traits handler, so we need to mark this removed instance trait as deleted // so that changes are sent next frame diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index e8aee1f3d2..21779a2b29 100755 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -1179,7 +1179,7 @@ public: /**jsdoc * @function Avatar.clearAvatarEntity * @param {Uuid} entityID - The entity ID. - * @param {boolean} [requiresRemovalFromTree=true] - Requires removal from tree. + * @param {boolean} [requiresRemovalFromTree=true] - unused * @deprecated This function is deprecated and will be removed. */ Q_INVOKABLE virtual void clearAvatarEntity(const QUuid& entityID, bool requiresRemovalFromTree = true); diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index ab3f4c5243..fa18783b98 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -226,7 +226,7 @@ void EntityTreeRenderer::stopDomainAndNonOwnedEntities() { EntityItemPointer entityItem = getTree()->findEntityByEntityItemID(entityID); if (entityItem && !entityItem->getScript().isEmpty()) { - if (!(entityItem->isLocalEntity() || (entityItem->isAvatarEntity() && entityItem->getOwningAvatarID() == getTree()->getMyAvatarSessionUUID()))) { + if (!(entityItem->isLocalEntity() || entityItem->isMyAvatarEntity())) { if (_currentEntitiesInside.contains(entityID)) { _entitiesScriptEngine->callEntityScriptMethod(entityID, "leaveEntity"); } @@ -240,7 +240,6 @@ void EntityTreeRenderer::stopDomainAndNonOwnedEntities() { void EntityTreeRenderer::clearDomainAndNonOwnedEntities() { stopDomainAndNonOwnedEntities(); - auto sessionUUID = getTree()->getMyAvatarSessionUUID(); std::unordered_map savedEntities; std::unordered_set savedRenderables; // remove all entities from the scene @@ -249,7 +248,7 @@ void EntityTreeRenderer::clearDomainAndNonOwnedEntities() { for (const auto& entry : _entitiesInScene) { const auto& renderer = entry.second; const EntityItemPointer& entityItem = renderer->getEntity(); - if (!(entityItem->isLocalEntity() || (entityItem->isAvatarEntity() && entityItem->getOwningAvatarID() == sessionUUID))) { + if (!(entityItem->isLocalEntity() || entityItem->isMyAvatarEntity())) { fadeOutRenderable(renderer); } else { savedEntities[entry.first] = entry.second; @@ -261,6 +260,7 @@ void EntityTreeRenderer::clearDomainAndNonOwnedEntities() { _renderablesToUpdate = savedRenderables; _entitiesInScene = savedEntities; + auto sessionUUID = getTree()->getMyAvatarSessionUUID(); if (_layeredZones.clearDomainAndNonOwnedZones(sessionUUID)) { applyLayeredZones(); } @@ -683,7 +683,7 @@ void EntityTreeRenderer::leaveDomainAndNonOwnedEntities() { QSet currentEntitiesInsideToSave; foreach (const EntityItemID& entityID, _currentEntitiesInside) { EntityItemPointer entityItem = getTree()->findEntityByEntityItemID(entityID); - if (!(entityItem->isLocalEntity() || (entityItem->isAvatarEntity() && entityItem->getOwningAvatarID() == getTree()->getMyAvatarSessionUUID()))) { + if (!(entityItem->isLocalEntity() || entityItem->isMyAvatarEntity())) { emit leaveEntity(entityID); if (_entitiesScriptEngine) { _entitiesScriptEngine->callEntityScriptMethod(entityID, "leaveEntity"); @@ -1221,7 +1221,7 @@ bool EntityTreeRenderer::LayeredZones::clearDomainAndNonOwnedZones(const QUuid& auto it = begin(); while (it != end()) { auto zone = it->zone.lock(); - if (!zone || !(zone->isLocalEntity() || (zone->isAvatarEntity() && zone->getOwningAvatarID() == sessionUUID))) { + if (!zone || !(zone->isLocalEntity() || zone->isMyAvatarEntity())) { zonesChanged = true; it = erase(it); } else { @@ -1362,6 +1362,10 @@ EntityItemPointer EntityTreeRenderer::getEntity(const EntityItemID& id) { return result; } +void EntityTreeRenderer::deleteEntity(const EntityItemID& id) const { + DependencyManager::get()->deleteEntity(id); +} + void EntityTreeRenderer::onEntityChanged(const EntityItemID& id) { _changedEntitiesGuard.withWriteLock([&] { _changedEntities.insert(id); diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.h b/libraries/entities-renderer/src/EntityTreeRenderer.h index 6dbaedc123..6a5152b219 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.h +++ b/libraries/entities-renderer/src/EntityTreeRenderer.h @@ -118,6 +118,7 @@ public: void setProxyWindow(const EntityItemID& id, QWindow* proxyWindow); void setCollisionSound(const EntityItemID& id, const SharedSoundPointer& sound); EntityItemPointer getEntity(const EntityItemID& id); + void deleteEntity(const EntityItemID& id) const; void onEntityChanged(const EntityItemID& id); // Access the workload Space diff --git a/libraries/entities-renderer/src/RenderableEntityItem.cpp b/libraries/entities-renderer/src/RenderableEntityItem.cpp index fb3d2f1bf5..0e5dab6524 100644 --- a/libraries/entities-renderer/src/RenderableEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableEntityItem.cpp @@ -43,6 +43,7 @@ const Transform& EntityRenderer::getModelTransform() const { void EntityRenderer::makeStatusGetters(const EntityItemPointer& entity, Item::Status::Getters& statusGetters) { auto nodeList = DependencyManager::get(); + // DANGER: nodeList->getSessionUUID() will return null id when not connected to domain. const QUuid& myNodeID = nodeList->getSessionUUID(); statusGetters.push_back([entity]() -> render::Item::Status::Value { @@ -103,9 +104,9 @@ void EntityRenderer::makeStatusGetters(const EntityItemPointer& entity, Item::St (unsigned char)render::Item::Status::Icon::HAS_ACTIONS); }); - statusGetters.push_back([entity, myNodeID] () -> render::Item::Status::Value { + statusGetters.push_back([entity] () -> render::Item::Status::Value { if (entity->isAvatarEntity()) { - if (entity->getOwningAvatarID() == myNodeID) { + if (entity->isMyAvatarEntity()) { return render::Item::Status::Value(1.0f, render::Item::Status::Value::GREEN, (unsigned char)render::Item::Status::Icon::ENTITY_HOST_TYPE); } else { diff --git a/libraries/entities/src/DeleteEntityOperator.cpp b/libraries/entities/src/DeleteEntityOperator.cpp index 1dca171ae3..a4ecb532e5 100644 --- a/libraries/entities/src/DeleteEntityOperator.cpp +++ b/libraries/entities/src/DeleteEntityOperator.cpp @@ -53,6 +53,15 @@ void DeleteEntityOperator::addEntityIDToDeleteList(const EntityItemID& searchEnt } } +void DeleteEntityOperator::addEntityToDeleteList(const EntityItemPointer& entity) { + assert(entity && entity->getElement()); + EntityToDeleteDetails details; + details.entity = entity; + details.containingElement = entity->getElement(); + details.cube = details.containingElement->getAACube(); + _entitiesToDelete << details; + _lookingCount++; +} // does this entity tree element contain the old entity bool DeleteEntityOperator::subTreeContainsSomeEntitiesToDelete(const OctreeElementPointer& element) { diff --git a/libraries/entities/src/DeleteEntityOperator.h b/libraries/entities/src/DeleteEntityOperator.h index 3b3ee2a868..1449e2caad 100644 --- a/libraries/entities/src/DeleteEntityOperator.h +++ b/libraries/entities/src/DeleteEntityOperator.h @@ -42,6 +42,7 @@ public: ~DeleteEntityOperator(); void addEntityIDToDeleteList(const EntityItemID& searchEntityID); + void addEntityToDeleteList(const EntityItemPointer& entity); virtual bool preRecursion(const OctreeElementPointer& element) override; virtual bool postRecursion(const OctreeElementPointer& element) override; diff --git a/libraries/entities/src/EntityEditFilters.cpp b/libraries/entities/src/EntityEditFilters.cpp index a222ca8216..16dace0fc8 100644 --- a/libraries/entities/src/EntityEditFilters.cpp +++ b/libraries/entities/src/EntityEditFilters.cpp @@ -43,7 +43,7 @@ QList EntityEditFilters::getZonesByPosition(glm::vec3& position) { } bool EntityEditFilters::filter(glm::vec3& position, EntityItemProperties& propertiesIn, EntityItemProperties& propertiesOut, - bool& wasChanged, EntityTree::FilterType filterType, EntityItemID& itemID, EntityItemPointer& existingEntity) { + bool& wasChanged, EntityTree::FilterType filterType, EntityItemID& itemID, const EntityItemPointer& existingEntity) { // get the ids of all the zones (plus the global entity edit filter) that the position // lies within diff --git a/libraries/entities/src/EntityEditFilters.h b/libraries/entities/src/EntityEditFilters.h index cb99c97762..69fd920998 100644 --- a/libraries/entities/src/EntityEditFilters.h +++ b/libraries/entities/src/EntityEditFilters.h @@ -55,7 +55,7 @@ public: void removeFilter(EntityItemID entityID); bool filter(glm::vec3& position, EntityItemProperties& propertiesIn, EntityItemProperties& propertiesOut, bool& wasChanged, - EntityTree::FilterType filterType, EntityItemID& entityID, EntityItemPointer& existingEntity); + EntityTree::FilterType filterType, EntityItemID& entityID, const EntityItemPointer& existingEntity); signals: void filterAdded(EntityItemID id, bool success); diff --git a/libraries/entities/src/EntityEditPacketSender.cpp b/libraries/entities/src/EntityEditPacketSender.cpp index dbb3ab076e..aaaf7d645a 100644 --- a/libraries/entities/src/EntityEditPacketSender.cpp +++ b/libraries/entities/src/EntityEditPacketSender.cpp @@ -73,8 +73,12 @@ void EntityEditPacketSender::queueEditEntityMessage(PacketType type, if (properties.getEntityHostType() == entity::HostType::AVATAR) { if (!_myAvatar) { qCWarning(entities) << "Suppressing entity edit message: cannot send avatar entity edit with no myAvatar"; - } else if (properties.getOwningAvatarID() == _myAvatar->getID()) { - // this is an avatar-based entity --> update our avatar-data rather than sending to the entity-server + } else if (properties.getOwningAvatarID() == _myAvatar->getID() || properties.getOwningAvatarID() == AVATAR_SELF_ID) { + // this is a local avatar-entity --> update our avatar-data rather than sending to the entity-server + // Note: we store AVATAR_SELF_ID in EntityItem::_owningAvatarID and we usually + // store the actual sessionUUID in EntityItemProperties::_owningAvatarID. + // However at this context we check for both cases just in case. Really we just want to know + // where to route the data: entity-server or avatar-mixer. queueEditAvatarEntityMessage(entityTree, entityItemID); } else { qCWarning(entities) << "Suppressing entity edit message: cannot send avatar entity edit for another avatar"; diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index 598ac17510..15aacd934c 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -1347,7 +1347,7 @@ EntityItemProperties EntityItem::getProperties(const EntityPropertyFlags& desire COPY_ENTITY_PROPERTY_TO_PROPERTIES(created, getCreated); COPY_ENTITY_PROPERTY_TO_PROPERTIES(lastEditedBy, getLastEditedBy); COPY_ENTITY_PROPERTY_TO_PROPERTIES(entityHostType, getEntityHostType); - COPY_ENTITY_PROPERTY_TO_PROPERTIES(owningAvatarID, getOwningAvatarID); + COPY_ENTITY_PROPERTY_TO_PROPERTIES(owningAvatarID, getOwningAvatarIDForProperties); COPY_ENTITY_PROPERTY_TO_PROPERTIES(queryAACube, getQueryAACube); COPY_ENTITY_PROPERTY_TO_PROPERTIES(canCastShadow, getCanCastShadow); COPY_ENTITY_PROPERTY_TO_PROPERTIES(isVisibleInSecondaryCamera, isVisibleInSecondaryCamera); @@ -3203,6 +3203,7 @@ void EntityItem::somethingChangedNotification() { }); } +// static void EntityItem::retrieveMarketplacePublicKey() { QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance(); QNetworkRequest networkRequest; @@ -3234,6 +3235,26 @@ void EntityItem::retrieveMarketplacePublicKey() { }); } +void EntityItem::collectChildrenForDelete(SetOfEntities& entitiesToDelete, SetOfEntities& domainEntities, const QUuid& sessionID) const { + // Deleting an entity has consequences for its children, however there are rules dictating what can be deleted. + // This method helps enforce those rules for the children of entity (not for this entity). + for (SpatiallyNestablePointer child : getChildren()) { + if (child && child->getNestableType() == NestableType::Entity) { + EntityItemPointer childEntity = std::static_pointer_cast(child); + // NOTE: null sessionID means "collect ALL known entities", else we only collect: local-entities and authorized avatar-entities + if (sessionID.isNull() || childEntity->isLocalEntity() || (childEntity->isAvatarEntity() && + (childEntity->isMyAvatarEntity() || childEntity->getOwningAvatarID() == sessionID))) { + if (entitiesToDelete.find(childEntity) == entitiesToDelete.end()) { + entitiesToDelete.insert(childEntity); + childEntity->collectChildrenForDelete(entitiesToDelete, domainEntities, sessionID); + } + } else if (childEntity->isDomainEntity()) { + domainEntities.insert(childEntity); + } + } + } +} + void EntityItem::setSpaceIndex(int32_t index) { assert(_spaceIndex == -1); _spaceIndex = index; @@ -3398,6 +3419,7 @@ void EntityItem::prepareForSimulationOwnershipBid(EntityItemProperties& properti properties.setSimulationOwner(Physics::getSessionUUID(), priority); setPendingOwnershipPriority(priority); + // ANDREW TODO: figure out if it would be OK to NOT bother set these properties here properties.setEntityHostType(getEntityHostType()); properties.setOwningAvatarID(getOwningAvatarID()); setLastBroadcast(now); // for debug/physics status icons @@ -3409,9 +3431,27 @@ bool EntityItem::isWearable() const { } bool EntityItem::isMyAvatarEntity() const { - return _hostType == entity::HostType::AVATAR && Physics::getSessionUUID() == _owningAvatarID; + return _hostType == entity::HostType::AVATAR && AVATAR_SELF_ID == _owningAvatarID; }; +QUuid EntityItem::getOwningAvatarIDForProperties() const { + if (isMyAvatarEntity()) { + // NOTE: we always store AVATAR_SELF_ID for MyAvatar's avatar entities, + // however for EntityItemProperties to be consumed by outside contexts (e.g. JS) + // we use the actual "sessionUUID" which is conveniently cached in the Physics namespace + return Physics::getSessionUUID(); + } + return _owningAvatarID; +} + +void EntityItem::setOwningAvatarID(const QUuid& owningAvatarID) { + if (!owningAvatarID.isNull() && owningAvatarID == Physics::getSessionUUID()) { + _owningAvatarID = AVATAR_SELF_ID; + } else { + _owningAvatarID = owningAvatarID; + } +} + void EntityItem::addGrab(GrabPointer grab) { enableNoBootstrap(); SpatiallyNestable::addGrab(grab); diff --git a/libraries/entities/src/EntityItem.h b/libraries/entities/src/EntityItem.h index 3274379ee9..fef198c006 100644 --- a/libraries/entities/src/EntityItem.h +++ b/libraries/entities/src/EntityItem.h @@ -18,6 +18,7 @@ #include #include +#include #include // for EncodeBitstreamParams class #include // for OctreeElement::AppendState @@ -49,6 +50,7 @@ typedef std::shared_ptr EntityTreePointer; typedef std::shared_ptr EntityDynamicPointer; typedef std::shared_ptr EntityTreeElementPointer; using EntityTreeElementExtraEncodeDataPointer = std::shared_ptr; +using SetOfEntities = QSet; #define DONT_ALLOW_INSTANTIATION virtual void pureVirtualFunctionPlaceHolder() = 0; #define ALLOW_INSTANTIATION virtual void pureVirtualFunctionPlaceHolder() override { }; @@ -514,7 +516,8 @@ public: // if this entity is an avatar entity, which avatar is it associated with? QUuid getOwningAvatarID() const { return _owningAvatarID; } - virtual void setOwningAvatarID(const QUuid& owningAvatarID) { _owningAvatarID = owningAvatarID; } + QUuid getOwningAvatarIDForProperties() const; + void setOwningAvatarID(const QUuid& owningAvatarID); virtual bool wantsHandControllerPointerEvents() const { return false; } virtual bool wantsKeyboardFocus() const { return false; } @@ -540,6 +543,8 @@ public: static QString _marketplacePublicKey; static void retrieveMarketplacePublicKey(); + void collectChildrenForDelete(SetOfEntities& entitiesToDelete, SetOfEntities& domainEntities, const QUuid& sessionID) const; + float getBoundingRadius() const { return _boundingRadius; } void setSpaceIndex(int32_t index); int32_t getSpaceIndex() const { return _spaceIndex; } diff --git a/libraries/entities/src/EntityItemProperties.cpp b/libraries/entities/src/EntityItemProperties.cpp index 2b8f2b4c14..ae2e83affe 100644 --- a/libraries/entities/src/EntityItemProperties.cpp +++ b/libraries/entities/src/EntityItemProperties.cpp @@ -3936,7 +3936,7 @@ bool EntityItemProperties::decodeCloneEntityMessage(const QByteArray& buffer, in processedBytes = 0; if (NUM_BYTES_RFC4122_UUID * 2 > packetLength) { - qCDebug(entities) << "EntityItemProperties::processEraseMessageDetails().... bailing because not enough bytes in buffer"; + qCDebug(entities) << "EntityItemProperties::decodeCloneEntityMessage().... bailing because not enough bytes in buffer"; return false; // bail to prevent buffer overflow } diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index 3305d9ba00..1ca6a5804f 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -480,17 +480,11 @@ QUuid EntityScriptingInterface::addEntityInternal(const EntityItemProperties& pr _activityTracking.addedEntityCount++; - auto nodeList = DependencyManager::get(); - auto sessionID = nodeList->getSessionUUID(); - EntityItemProperties propertiesWithSimID = properties; propertiesWithSimID.setEntityHostType(entityHostType); if (entityHostType == entity::HostType::AVATAR) { - if (sessionID.isNull()) { - // null sessionID is unacceptable in this case - sessionID = AVATAR_SELF_ID; - } - propertiesWithSimID.setOwningAvatarID(sessionID); + // only allow adding our own avatar entities from script + propertiesWithSimID.setOwningAvatarID(AVATAR_SELF_ID); } else if (entityHostType == entity::HostType::LOCAL) { // For now, local entities are always collisionless // TODO: create a separate, local physics simulation that just handles local entities (and MyAvatar?) @@ -498,6 +492,8 @@ QUuid EntityScriptingInterface::addEntityInternal(const EntityItemProperties& pr } // the created time will be set in EntityTree::addEntity by recordCreationTime() + auto nodeList = DependencyManager::get(); + auto sessionID = nodeList->getSessionUUID(); propertiesWithSimID.setLastEditedBy(sessionID); bool scalesWithParent = propertiesWithSimID.getScalesWithParent(); @@ -805,7 +801,7 @@ QUuid EntityScriptingInterface::editEntity(const QUuid& id, const EntityItemProp return; } - if (entity->isAvatarEntity() && entity->getOwningAvatarID() != sessionID && entity->getOwningAvatarID() != AVATAR_SELF_ID) { + if (entity->isAvatarEntity() && !entity->isMyAvatarEntity()) { // don't edit other avatar's avatarEntities properties = EntityItemProperties(); return; @@ -970,43 +966,52 @@ void EntityScriptingInterface::deleteEntity(const QUuid& id) { _activityTracking.deletedEntityCount++; - EntityItemID entityID(id); - bool shouldSendDeleteToServer = true; - - // If we have a local entity tree set, then also update it. - if (_entityTree) { - _entityTree->withWriteLock([&] { - EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID); - if (entity) { - - auto nodeList = DependencyManager::get(); - const QUuid myNodeID = nodeList->getSessionUUID(); - if (entity->isAvatarEntity() && entity->getOwningAvatarID() != myNodeID) { - // don't delete other avatar's avatarEntities - shouldSendDeleteToServer = false; - return; - } - - if (entity->getLocked()) { - shouldSendDeleteToServer = false; - } else { - // only delete local entities, server entities will round trip through the server filters - if (!entity->isDomainEntity() || _entityTree->isServerlessMode()) { - shouldSendDeleteToServer = false; - _entityTree->deleteEntity(entityID); - - if (entity->isAvatarEntity() && getEntityPacketSender()->getMyAvatar()) { - getEntityPacketSender()->getMyAvatar()->clearAvatarEntity(entityID, false); - } - } - } - } - }); + if (!_entityTree) { + return; } - // if at this point, we know the id, and we should still delete the entity, send the update to the entity server - if (shouldSendDeleteToServer) { - getEntityPacketSender()->queueEraseEntityMessage(entityID); + EntityItemID entityID(id); + + // If we have a local entity tree set, then also update it. + SetOfEntities entitiesToDeleteImmediately; + SetOfEntities domainEntities; + _entityTree->withWriteLock([&] { + EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID); + if (entity) { + if (entity->isAvatarEntity() && !entity->isMyAvatarEntity()) { + // don't delete other avatar's avatarEntities + return; + } + if (entity->getLocked()) { + return; + } + + // Deleting an entity has consequences for linked children: some can be deleted but others can't. + // Local- and my-avatar-entities can be deleted immediately, but other-avatar-entities can't be deleted + // by this context, and domain-entity deletes must rountrip through the entity-server for authorization. + // So we recurse down the linked hierarchy and snarf children into two categories: + // (a) entitiesToDeleteImmediately and (b) domainEntntities. + if (entity->isDomainEntity()) { + domainEntities.insert(entity); + } else { + entitiesToDeleteImmediately.insert(entity); + const auto sessionID = DependencyManager::get()->getSessionUUID(); + entity->collectChildrenForDelete(entitiesToDeleteImmediately, domainEntities, sessionID); + } + if (!entitiesToDeleteImmediately.empty()) { + _entityTree->deleteEntitiesByPointer(entitiesToDeleteImmediately); + } + } + }); + + foreach (auto entity, entitiesToDeleteImmediately) { + if (entity->isMyAvatarEntity()) { + getEntityPacketSender()->getMyAvatar()->clearAvatarEntity(entityID, false); + } + } + // finally ask entity-server to delete domainEntities + foreach (auto entity, domainEntities) { + getEntityPacketSender()->queueEraseEntityMessage(entity->getID()); } } @@ -1671,7 +1676,7 @@ bool EntityScriptingInterface::actionWorker(const QUuid& entityID, return; } - if (entity->isAvatarEntity() && entity->getOwningAvatarID() != myNodeID) { + if (entity->isAvatarEntity() && !entity->isMyAvatarEntity()) { return; } diff --git a/libraries/entities/src/EntitySimulation.cpp b/libraries/entities/src/EntitySimulation.cpp index 9f81572a4a..5576f21cc5 100644 --- a/libraries/entities/src/EntitySimulation.cpp +++ b/libraries/entities/src/EntitySimulation.cpp @@ -19,41 +19,36 @@ void EntitySimulation::setEntityTree(EntityTreePointer tree) { if (_entityTree && _entityTree != tree) { - _mortalEntities.clear(); - _nextExpiry = std::numeric_limits::max(); - _entitiesToUpdate.clear(); _entitiesToSort.clear(); _simpleKinematicEntities.clear(); + _changedEntities.clear(); + _entitiesToUpdate.clear(); + _mortalEntities.clear(); + _nextExpiry = std::numeric_limits::max(); } _entityTree = tree; } void EntitySimulation::updateEntities() { + PerformanceTimer perfTimer("EntitySimulation::updateEntities"); QMutexLocker lock(&_mutex); uint64_t now = usecTimestampNow(); - PerformanceTimer perfTimer("EntitySimulation::updateEntities"); // these methods may accumulate entries in _entitiesToBeDeleted expireMortalEntities(now); callUpdateOnEntitiesThatNeedIt(now); moveSimpleKinematics(now); - updateEntitiesInternal(now); sortEntitiesThatMoved(); + processDeadEntities(); } -void EntitySimulation::takeDeadEntities(SetOfEntities& entitiesToDelete) { - QMutexLocker lock(&_mutex); - entitiesToDelete.swap(_deadEntities); - _deadEntities.clear(); -} - -void EntitySimulation::removeEntityInternal(EntityItemPointer entity) { - // remove from all internal lists except _deadEntities - _mortalEntities.remove(entity); - _entitiesToUpdate.remove(entity); +void EntitySimulation::removeEntityFromInternalLists(EntityItemPointer entity) { + // remove from all internal lists except _deadEntitiesToRemoveFromTree _entitiesToSort.remove(entity); _simpleKinematicEntities.remove(entity); _allEntities.remove(entity); + _entitiesToUpdate.remove(entity); + _mortalEntities.remove(entity); entity->setSimulated(false); } @@ -62,10 +57,9 @@ void EntitySimulation::prepareEntityForDelete(EntityItemPointer entity) { assert(entity->isDead()); if (entity->isSimulated()) { QMutexLocker lock(&_mutex); - entity->clearActions(getThisPointer()); - removeEntityInternal(entity); + removeEntityFromInternalLists(entity); if (entity->getElement()) { - _deadEntities.insert(entity); + _deadEntitiesToRemoveFromTree.insert(entity); _entityTree->cleanupCloneIDs(entity->getEntityItemID()); } } @@ -149,10 +143,7 @@ void EntitySimulation::sortEntitiesThatMoved() { _entitiesToSort.clear(); } -void EntitySimulation::addEntity(EntityItemPointer entity) { - QMutexLocker lock(&_mutex); - assert(entity); - entity->deserializeActions(); +void EntitySimulation::addEntityToInternalLists(EntityItemPointer entity) { if (entity->isMortal()) { _mortalEntities.insert(entity); uint64_t expiry = entity->getExpiry(); @@ -163,10 +154,14 @@ void EntitySimulation::addEntity(EntityItemPointer entity) { if (entity->needsToCallUpdate()) { _entitiesToUpdate.insert(entity); } - addEntityInternal(entity); - _allEntities.insert(entity); entity->setSimulated(true); +} + +void EntitySimulation::addEntity(EntityItemPointer entity) { + QMutexLocker lock(&_mutex); + assert(entity); + addEntityToInternalLists(entity); // DirtyFlags are used to signal changes to entities that have already been added, // so we can clear them for this entity which has just been added. @@ -218,16 +213,14 @@ void EntitySimulation::processChangedEntity(const EntityItemPointer& entity) { void EntitySimulation::clearEntities() { QMutexLocker lock(&_mutex); - _mortalEntities.clear(); - _nextExpiry = std::numeric_limits::max(); - _entitiesToUpdate.clear(); _entitiesToSort.clear(); _simpleKinematicEntities.clear(); - - clearEntitiesInternal(); - + _changedEntities.clear(); _allEntities.clear(); - _deadEntities.clear(); + _deadEntitiesToRemoveFromTree.clear(); + _entitiesToUpdate.clear(); + _mortalEntities.clear(); + _nextExpiry = std::numeric_limits::max(); } void EntitySimulation::moveSimpleKinematics(uint64_t now) { @@ -263,25 +256,22 @@ void EntitySimulation::moveSimpleKinematics(uint64_t now) { } } -void EntitySimulation::addDynamic(EntityDynamicPointer dynamic) { - QMutexLocker lock(&_dynamicsMutex); - _dynamicsToAdd += dynamic; -} - -void EntitySimulation::removeDynamic(const QUuid dynamicID) { - QMutexLocker lock(&_dynamicsMutex); - _dynamicsToRemove += dynamicID; -} - -void EntitySimulation::removeDynamics(QList dynamicIDsToRemove) { - QMutexLocker lock(&_dynamicsMutex); - foreach(QUuid uuid, dynamicIDsToRemove) { - _dynamicsToRemove.insert(uuid); +void EntitySimulation::processDeadEntities() { + if (_deadEntitiesToRemoveFromTree.empty()) { + return; } -} - -void EntitySimulation::applyDynamicChanges() { - QMutexLocker lock(&_dynamicsMutex); - _dynamicsToAdd.clear(); - _dynamicsToRemove.clear(); + SetOfEntities entitiesToDeleteImmediately; + // NOTE: dummyList will be empty because this base-class implementation is only used server-side + // for which ATM we only process domain-entities, and since we are passing nullSessionID for authorization + // EntityItem::collectChildrenForDelete() will not collect domain-entities into this side list. + SetOfEntities dummyList; + QUuid nullSessionID; + foreach (auto entity, _deadEntitiesToRemoveFromTree) { + entitiesToDeleteImmediately.insert(entity); + entity->collectChildrenForDelete(entitiesToDeleteImmediately, dummyList, nullSessionID); + } + if (_entityTree) { + _entityTree->deleteEntitiesByPointer(entitiesToDeleteImmediately); + } + _deadEntitiesToRemoveFromTree.clear(); } diff --git a/libraries/entities/src/EntitySimulation.h b/libraries/entities/src/EntitySimulation.h index 1dd0369561..646e5a0f67 100644 --- a/libraries/entities/src/EntitySimulation.h +++ b/libraries/entities/src/EntitySimulation.h @@ -16,17 +16,14 @@ #include #include -#include #include #include -#include "EntityDynamicInterface.h" #include "EntityItem.h" #include "EntityTree.h" using EntitySimulationPointer = std::shared_ptr; -using SetOfEntities = QSet; using VectorOfEntities = QVector; // the EntitySimulation needs to know when these things change on an entity, @@ -47,8 +44,8 @@ const int DIRTY_SIMULATION_FLAGS = class EntitySimulation : public QObject, public std::enable_shared_from_this { public: - EntitySimulation() : _mutex(QMutex::Recursive), _entityTree(NULL), _nextExpiry(std::numeric_limits::max()) { } - virtual ~EntitySimulation() { setEntityTree(NULL); } + EntitySimulation() : _mutex(QMutex::Recursive), _nextExpiry(std::numeric_limits::max()), _entityTree(nullptr) { } + virtual ~EntitySimulation() { setEntityTree(nullptr); } inline EntitySimulationPointer getThisPointer() const { return std::const_pointer_cast(shared_from_this()); @@ -57,12 +54,12 @@ public: /// \param tree pointer to EntityTree which is stored internally void setEntityTree(EntityTreePointer tree); - void updateEntities(); + virtual void updateEntities(); - virtual void addDynamic(EntityDynamicPointer dynamic); - virtual void removeDynamic(const QUuid dynamicID); - virtual void removeDynamics(QList dynamicIDsToRemove); - virtual void applyDynamicChanges(); + // FIXME: remove these + virtual void addDynamic(EntityDynamicPointer dynamic) {} + virtual void removeDynamic(const QUuid dynamicID) {} + virtual void applyDynamicChanges() {}; /// \param entity pointer to EntityItem to be added /// \sideeffect sets relevant backpointers in entity, but maybe later when appropriate data structures are locked @@ -72,27 +69,22 @@ public: /// call this whenever an entity was changed from some EXTERNAL event (NOT by the EntitySimulation itself) void changeEntity(EntityItemPointer entity); - void clearEntities(); + virtual void clearEntities(); void moveSimpleKinematics(uint64_t now); EntityTreePointer getEntityTree() { return _entityTree; } - virtual void takeDeadEntities(SetOfEntities& entitiesToDelete); - - /// \param entity pointer to EntityItem that needs to be put on the entitiesToDelete list and removed from others. virtual void prepareEntityForDelete(EntityItemPointer entity); void processChangedEntities(); + virtual void queueEraseDomainEntities(const SetOfEntities& domainEntities) const { } protected: - // These pure virtual methods are protected because they are not to be called will-nilly. The base class - // calls them in the right places. - virtual void updateEntitiesInternal(uint64_t now) = 0; - virtual void addEntityInternal(EntityItemPointer entity) = 0; - virtual void removeEntityInternal(EntityItemPointer entity); + virtual void addEntityToInternalLists(EntityItemPointer entity); + virtual void removeEntityFromInternalLists(EntityItemPointer entity); virtual void processChangedEntity(const EntityItemPointer& entity); - virtual void clearEntitiesInternal() = 0; + virtual void processDeadEntities(); void expireMortalEntities(uint64_t now); void callUpdateOnEntitiesThatNeedIt(uint64_t now); @@ -102,27 +94,21 @@ protected: SetOfEntities _entitiesToSort; // entities moved by simulation (and might need resort in EntityTree) SetOfEntities _simpleKinematicEntities; // entities undergoing non-colliding kinematic motion - QList _dynamicsToAdd; - QSet _dynamicsToRemove; - QMutex _dynamicsMutex { QMutex::Recursive }; - -protected: - SetOfEntities _deadEntities; // dead entities that might still be in the _entityTree + SetOfEntities _deadEntitiesToRemoveFromTree; private: void moveSimpleKinematics(); - // back pointer to EntityTree structure - EntityTreePointer _entityTree; - // We maintain multiple lists, each for its distinct purpose. // An entity may be in more than one list. std::unordered_set _changedEntities; // all changes this frame SetOfEntities _allEntities; // tracks all entities added the simulation + SetOfEntities _entitiesToUpdate; // entities that need to call EntityItem::update() SetOfEntities _mortalEntities; // entities that have an expiry uint64_t _nextExpiry; - SetOfEntities _entitiesToUpdate; // entities that need to call EntityItem::update() + // back pointer to EntityTree structure + EntityTreePointer _entityTree; }; #endif // hifi_EntitySimulation_h diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 6c12c6d019..f44f2eb7c5 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -98,14 +98,15 @@ void EntityTree::eraseDomainAndNonOwnedEntities() { if (element) { element->cleanupDomainAndNonOwnedEntities(); } - - if (entity->isLocalEntity() || (entity->isAvatarEntity() && entity->getOwningAvatarID() == getMyAvatarSessionUUID())) { - savedEntities[entity->getEntityItemID()] = entity; - } else { - int32_t spaceIndex = entity->getSpaceIndex(); - if (spaceIndex != -1) { - // stale spaceIndices will be freed later - _staleProxies.push_back(spaceIndex); + if (!getIsServer()) { + if (entity->isLocalEntity() || entity->isMyAvatarEntity()) { + savedEntities[entity->getEntityItemID()] = entity; + } else { + int32_t spaceIndex = entity->getSpaceIndex(); + if (spaceIndex != -1) { + // stale spaceIndices will be freed later + _staleProxies.push_back(spaceIndex); + } } } } @@ -121,7 +122,7 @@ void EntityTree::eraseDomainAndNonOwnedEntities() { foreach (EntityItemWeakPointer entityItem, _needsParentFixup) { auto entity = entityItem.lock(); - if (entity && (entity->isLocalEntity() || (entity->isAvatarEntity() && entity->getOwningAvatarID() == getMyAvatarSessionUUID()))) { + if (entity && (entity->isLocalEntity() || entity->isMyAvatarEntity())) { needParentFixup.push_back(entityItem); } } @@ -144,10 +145,12 @@ void EntityTree::eraseAllOctreeElements(bool createNewRoot) { if (element) { element->cleanupEntities(); } - int32_t spaceIndex = entity->getSpaceIndex(); - if (spaceIndex != -1) { - // assume stale spaceIndices will be freed later - _staleProxies.push_back(spaceIndex); + if (!getIsServer()) { + int32_t spaceIndex = entity->getSpaceIndex(); + if (spaceIndex != -1) { + // assume stale spaceIndices will be freed later + _staleProxies.push_back(spaceIndex); + } } } }); @@ -605,61 +608,21 @@ void EntityTree::setSimulation(EntitySimulationPointer simulation) { } void EntityTree::deleteEntity(const EntityItemID& entityID, bool force, bool ignoreWarnings) { - EntityTreeElementPointer containingElement = getContainingElement(entityID); - if (!containingElement) { - if (!ignoreWarnings) { - qCWarning(entities) << "EntityTree::deleteEntity() on non-existent entityID=" << entityID; - } - return; - } - - EntityItemPointer existingEntity = containingElement->getEntityWithEntityItemID(entityID); - if (!existingEntity) { - if (!ignoreWarnings) { - qCWarning(entities) << "EntityTree::deleteEntity() on non-existant entity item with entityID=" << entityID; - } - return; - } - - if (existingEntity->getLocked() && !force) { - if (!ignoreWarnings) { - qCDebug(entities) << "ERROR! EntityTree::deleteEntity() trying to delete locked entity. entityID=" << entityID; - } - return; - } - - cleanupCloneIDs(entityID); - unhookChildAvatar(entityID); - emit deletingEntity(entityID); - emit deletingEntityPointer(existingEntity.get()); - - // NOTE: callers must lock the tree before using this method - DeleteEntityOperator theOperator(getThisPointer(), entityID); - - existingEntity->forEachDescendant([&](SpatiallyNestablePointer descendant) { - auto descendantID = descendant->getID(); - theOperator.addEntityIDToDeleteList(descendantID); - emit deletingEntity(descendantID); - EntityItemPointer descendantEntity = std::dynamic_pointer_cast(descendant); - if (descendantEntity) { - emit deletingEntityPointer(descendantEntity.get()); - } - }); - - recurseTreeWithOperator(&theOperator); - processRemovedEntities(theOperator); - _isDirty = true; + // NOTE: can be called without lock because deleteEntitiesByID() will lock + QSet ids; + ids << entityID; + deleteEntitiesByID(ids, force, ignoreWarnings); } void EntityTree::unhookChildAvatar(const EntityItemID entityID) { - - EntityItemPointer entity = findEntityByEntityItemID(entityID); - - entity->forEachDescendant([&](SpatiallyNestablePointer child) { - if (child->getNestableType() == NestableType::Avatar) { - child->setParentID(nullptr); - } - }); + if (!getIsServer()) { + EntityItemPointer entity = findEntityByEntityItemID(entityID); + entity->forEachDescendant([&](SpatiallyNestablePointer child) { + if (child->getNestableType() == NestableType::Avatar) { + child->setParentID(nullptr); + } + }); + } } void EntityTree::cleanupCloneIDs(const EntityItemID& entityID) { @@ -684,39 +647,100 @@ void EntityTree::cleanupCloneIDs(const EntityItemID& entityID) { } } -void EntityTree::deleteEntities(QSet entityIDs, bool force, bool ignoreWarnings) { - // NOTE: callers must lock the tree before using this method +void EntityTree::recursivelyFilterAndCollectForDelete(const EntityItemPointer& entity, SetOfEntities& entitiesToDelete, bool force) const { + // tree must be read-locked before calling this method + //TODO: assert(treeIsLocked); + assert(entity); + if (entity->getElement() && (entitiesToDelete.find(entity) == entitiesToDelete.end())) { + // filter + bool allowed = force; + if (!allowed) { + bool wasChanged = false; + auto startFilter = usecTimestampNow(); + EntityItemProperties dummyProperties; + allowed = force || filterProperties(entity, dummyProperties, dummyProperties, wasChanged, FilterType::Delete); + auto endFilter = usecTimestampNow(); + _totalFilterTime += endFilter - startFilter; + } + if (allowed) { + entitiesToDelete.insert(entity); + for (SpatiallyNestablePointer child : entity->getChildren()) { + if (child && child->getNestableType() == NestableType::Entity) { + EntityItemPointer childEntity = std::static_pointer_cast(child); + recursivelyFilterAndCollectForDelete(childEntity, entitiesToDelete, force); + } + } + } + } +} + +void EntityTree::deleteEntitiesByID(const QSet& ids, bool force, bool ignoreWarnings) { + // this method has two paths: + // (a) entity-server: applies delete filter + // (b) interface-client: deletes local- and my-avatar-entities immediately, submits domainEntity deletes to the entity-server + if (getIsServer()) { + withWriteLock([&] { + SetOfEntities entitiesToDelete; + for (auto id : ids) { + EntityItemPointer entity; + { + QReadLocker locker(&_entityMapLock); + entity = _entityMap.value(id); + } + if (entity) { + recursivelyFilterAndCollectForDelete(entity, entitiesToDelete, force); + } + } + if (!entitiesToDelete.empty()) { + deleteEntitiesByPointer(entitiesToDelete); + } + }); + } else { + SetOfEntities entitiesToDelete; + SetOfEntities domainEntities; + QUuid sessionID = DependencyManager::get()->getSessionUUID(); + withWriteLock([&] { + for (auto id : ids) { + EntityItemPointer entity; + { + QReadLocker locker(&_entityMapLock); + entity = _entityMap.value(id); + } + if (entity) { + if (entity->isDomainEntity()) { + domainEntities.insert(entity); + } else if (entity->isLocalEntity() || entity->isMyAvatarEntity()) { + entitiesToDelete.insert(entity); + entity->collectChildrenForDelete(entitiesToDelete, domainEntities, sessionID); + } + } + } + if (!entitiesToDelete.empty()) { + deleteEntitiesByPointer(entitiesToDelete); + } + }); + if (!domainEntities.empty() && _simulation) { + // interface-client can't delete domainEntities outright, they must roundtrip through the entity-server + _simulation->queueEraseDomainEntities(domainEntities); + } + } +} + +void EntityTree::deleteEntitiesByPointer(const SetOfEntities& entities) { + // tree must be write-locked before calling this method + //TODO: assert(treeIsLocked); + // NOTE: there is no entity validation (i.e. is entity in tree?) nor snarfing of children beyond this point. + // Get those done BEFORE calling this method. + for (auto entity : entities) { + cleanupCloneIDs(entity->getID()); + } DeleteEntityOperator theOperator(getThisPointer()); - foreach(const EntityItemID& entityID, entityIDs) { - EntityTreeElementPointer containingElement = getContainingElement(entityID); - if (!containingElement) { - if (!ignoreWarnings) { - qCWarning(entities) << "EntityTree::deleteEntities() on non-existent entityID=" << entityID; - } - continue; + for (auto entity : entities) { + if (entity->getElement()) { + theOperator.addEntityToDeleteList(entity); + emit deletingEntity(entity->getID()); + emit deletingEntityPointer(entity.get()); } - - EntityItemPointer existingEntity = containingElement->getEntityWithEntityItemID(entityID); - if (!existingEntity) { - if (!ignoreWarnings) { - qCWarning(entities) << "EntityTree::deleteEntities() on non-existent entity item with entityID=" << entityID; - } - continue; - } - - if (existingEntity->getLocked() && !force) { - if (!ignoreWarnings) { - qCDebug(entities) << "ERROR! EntityTree::deleteEntities() trying to delete locked entity. entityID=" << entityID; - } - continue; - } - - // tell our delete operator about this entityID - cleanupCloneIDs(entityID); - unhookChildAvatar(entityID); - theOperator.addEntityIDToDeleteList(entityID); - emit deletingEntity(entityID); - emit deletingEntityPointer(existingEntity.get()); } if (!theOperator.getEntities().empty()) { @@ -727,23 +751,11 @@ void EntityTree::deleteEntities(QSet entityIDs, bool force, bool i } void EntityTree::processRemovedEntities(const DeleteEntityOperator& theOperator) { + // NOTE: assume tree already write-locked because this method only called in deleteEntitiesByPointer() quint64 deletedAt = usecTimestampNow(); const RemovedEntities& entities = theOperator.getEntities(); foreach(const EntityToDeleteDetails& details, entities) { EntityItemPointer theEntity = details.entity; - - if (getIsServer()) { - QSet childrenIDs; - theEntity->forEachChild([&](SpatiallyNestablePointer child) { - if (child->getNestableType() == NestableType::Entity) { - childrenIDs += child->getID(); - } - }); - deleteEntities(childrenIDs, true, true); - } - - theEntity->die(); - if (getIsServer()) { removeCertifiedEntityOnServer(theEntity); @@ -751,19 +763,24 @@ void EntityTree::processRemovedEntities(const DeleteEntityOperator& theOperator) QWriteLocker recentlyDeletedEntitiesLocker(&_recentlyDeletedEntitiesLock); _recentlyDeletedEntityItemIDs.insert(deletedAt, theEntity->getEntityItemID()); } else { + theEntity->forEachDescendant([&](SpatiallyNestablePointer child) { + if (child->getNestableType() == NestableType::Avatar) { + child->setParentID(nullptr); + } + }); + // on the client side, we also remember that we deleted this entity, we don't care about the time trackDeletedEntity(theEntity->getEntityItemID()); - } + int32_t spaceIndex = theEntity->getSpaceIndex(); + if (spaceIndex != -1) { + // stale spaceIndices will be freed later + _staleProxies.push_back(spaceIndex); + } + } if (theEntity->isSimulated()) { _simulation->prepareEntityForDelete(theEntity); } - - int32_t spaceIndex = theEntity->getSpaceIndex(); - if (spaceIndex != -1) { - // stale spaceIndices will be freed later - _staleProxies.push_back(spaceIndex); - } } } @@ -1369,7 +1386,7 @@ void EntityTree::fixupTerseEditLogging(EntityItemProperties& properties, QList(); if (entityEditFilters) { @@ -1749,9 +1766,9 @@ void EntityTree::processChallengeOwnershipPacket(ReceivedMessage& message, const } } +// NOTE: Caller must lock the tree before calling this. int EntityTree::processEditPacketData(ReceivedMessage& message, const unsigned char* editData, int maxLength, const SharedNodePointer& senderNode) { - if (!getIsServer()) { qCWarning(entities) << "EntityTree::processEditPacketData() should only be called on a server tree."; return 0; @@ -2217,7 +2234,9 @@ void EntityTree::fixupNeedsParentFixups() { void EntityTree::deleteDescendantsOfAvatar(QUuid avatarID) { if (_childrenOfAvatars.contains(avatarID)) { - deleteEntities(_childrenOfAvatars[avatarID]); + bool force = true; + bool ignoreWarnings = true; + deleteEntitiesByID(_childrenOfAvatars[avatarID], force, ignoreWarnings); _childrenOfAvatars.remove(avatarID); } } @@ -2249,22 +2268,6 @@ void EntityTree::update(bool simulate) { if (simulate && _simulation) { withWriteLock([&] { _simulation->updateEntities(); - { - PROFILE_RANGE(simulation_physics, "Deletes"); - SetOfEntities deadEntities; - _simulation->takeDeadEntities(deadEntities); - if (!deadEntities.empty()) { - // translate into list of ID's - QSet idsToDelete; - - for (auto entity : deadEntities) { - idsToDelete.insert(entity->getEntityItemID()); - } - - // delete these things the roundabout way - deleteEntities(idsToDelete, true); - } - } }); } } @@ -2353,12 +2356,17 @@ bool EntityTree::shouldEraseEntity(EntityItemID entityID, const SharedNodePointe return allowed; } - -// TODO: consider consolidating processEraseMessageDetails() and processEraseMessage() int EntityTree::processEraseMessage(ReceivedMessage& message, const SharedNodePointer& sourceNode) { + // NOTE: this is only called by the interface-client on receipt of deleteEntity message from entity-server. + // Which means this is a state synchronization message from the the entity-server. It is saying + // "The following domain-entities have already been deleted". While need to perform sanity checking + // (e.g. verify these are domain entities) permissions need NOT checked for the domain-entities. + assert(!getIsServer()); + // TODO: remove this stuff out of EntityTree:: and into interface-client code. #ifdef EXTRA_ERASE_DEBUGGING qCDebug(entities) << "EntityTree::processEraseMessage()"; #endif + SetOfEntities consequentialDomainEntities; withWriteLock([&] { message.seek(sizeof(OCTREE_PACKET_FLAGS) + sizeof(OCTREE_PACKET_SEQUENCE) + sizeof(OCTREE_PACKET_SENT_TIME)); @@ -2366,10 +2374,9 @@ int EntityTree::processEraseMessage(ReceivedMessage& message, const SharedNodePo message.readPrimitive(&numberOfIDs); if (numberOfIDs > 0) { - QSet entityItemIDsToDelete; + QSet idsToDelete; for (size_t i = 0; i < numberOfIDs; i++) { - if (NUM_BYTES_RFC4122_UUID > message.getBytesLeftToRead()) { qCDebug(entities) << "EntityTree::processEraseMessage().... bailing because not enough bytes in buffer"; break; // bail to prevent buffer overflow @@ -2381,64 +2388,85 @@ int EntityTree::processEraseMessage(ReceivedMessage& message, const SharedNodePo #endif EntityItemID entityItemID(entityID); + idsToDelete << entityItemID; + } - if (shouldEraseEntity(entityID, sourceNode)) { - entityItemIDsToDelete << entityItemID; - cleanupCloneIDs(entityItemID); + // domain-entity deletion can trigger deletion of other entities the entity-server doesn't know about + // so we must recurse down the children and collect consequential deletes however + // we must first identify all domain-entities in idsToDelete so as to not overstep entity-server's authority + SetOfEntities domainEntities; + for (auto id : idsToDelete) { + EntityItemPointer entity = _entityMap.value(id); + if (entity && entity->isDomainEntity()) { + domainEntities.insert(entity); } } - deleteEntities(entityItemIDsToDelete, true, true); + // now we recurse domain-entities children and snarf consequential entities + auto nodeList = DependencyManager::get(); + QUuid sessionID = nodeList->getSessionUUID(); + // NOTE: normally a null sessionID would be bad, as that would cause the collectDhildrenForDelete() method below + // to snarf domain entities for which the interface-client is not authorized to delete without explicit instructions + // from the entity-server, however it is ok here because that would mean: + // (a) interface-client is not connected to a domain which means... + // (b) we should never get here (since this would correspond to a message from the entity-server) but... + // (c) who cares? When not connected to a domain the interface-client can do whatever it wants. + SetOfEntities entitiesToDelete; + for (auto entity : domainEntities) { + entitiesToDelete.insert(entity); + entity->collectChildrenForDelete(entitiesToDelete, consequentialDomainEntities, sessionID); + } + + if (!entitiesToDelete.empty()) { + deleteEntitiesByPointer(entitiesToDelete); + } } }); + if (!consequentialDomainEntities.empty() && _simulation) { + _simulation->queueEraseDomainEntities(consequentialDomainEntities); + } return message.getPosition(); } // This version skips over the header -// NOTE: Caller must lock the tree before calling this. -// TODO: consider consolidating processEraseMessageDetails() and processEraseMessage() +// NOTE: Caller must write-lock the tree before calling this. int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, const SharedNodePointer& sourceNode) { + //TODO: assert(treeIsLocked); + assert(getIsServer()); #ifdef EXTRA_ERASE_DEBUGGING qCDebug(entities) << "EntityTree::processEraseMessageDetails()"; #endif - const unsigned char* packetData = (const unsigned char*)dataByteArray.constData(); - const unsigned char* dataAt = packetData; size_t packetLength = dataByteArray.size(); size_t processedBytes = 0; uint16_t numberOfIds = 0; // placeholder for now - memcpy(&numberOfIds, dataAt, sizeof(numberOfIds)); - dataAt += sizeof(numberOfIds); + memcpy(&numberOfIds, dataByteArray.constData(), sizeof(numberOfIds)); processedBytes += sizeof(numberOfIds); if (numberOfIds > 0) { - QSet entityItemIDsToDelete; + QSet ids; + // extract ids from packet for (size_t i = 0; i < numberOfIds; i++) { - - if (processedBytes + NUM_BYTES_RFC4122_UUID > packetLength) { qCDebug(entities) << "EntityTree::processEraseMessageDetails().... bailing because not enough bytes in buffer"; break; // bail to prevent buffer overflow } QByteArray encodedID = dataByteArray.mid((int)processedBytes, NUM_BYTES_RFC4122_UUID); - QUuid entityID = QUuid::fromRfc4122(encodedID); - dataAt += encodedID.size(); + QUuid id = QUuid::fromRfc4122(encodedID); processedBytes += encodedID.size(); #ifdef EXTRA_ERASE_DEBUGGING - qCDebug(entities) << " ---- EntityTree::processEraseMessageDetails() contains id:" << entityID; + qCDebug(entities) << " ---- EntityTree::processEraseMessageDetails() contains id:" << id; #endif - EntityItemID entityItemID(entityID); - - if (shouldEraseEntity(entityID, sourceNode)) { - entityItemIDsToDelete << entityItemID; - cleanupCloneIDs(entityItemID); - } - + EntityItemID entityID(id); + ids << entityID; } - deleteEntities(entityItemIDsToDelete, true, true); + + bool force = sourceNode->isAllowedEditor(); + bool ignoreWarnings = true; + deleteEntitiesByID(ids, force, ignoreWarnings); } return (int)processedBytes; } diff --git a/libraries/entities/src/EntityTree.h b/libraries/entities/src/EntityTree.h index 9108f8d8d2..6574b9d601 100644 --- a/libraries/entities/src/EntityTree.h +++ b/libraries/entities/src/EntityTree.h @@ -126,7 +126,9 @@ public: void unhookChildAvatar(const EntityItemID entityID); void cleanupCloneIDs(const EntityItemID& entityID); void deleteEntity(const EntityItemID& entityID, bool force = false, bool ignoreWarnings = true); - void deleteEntities(QSet entityIDs, bool force = false, bool ignoreWarnings = true); + + void deleteEntitiesByID(const QSet& entityIDs, bool force = false, bool ignoreWarnings = true); + void deleteEntitiesByPointer(const SetOfEntities& entities); EntityItemPointer findEntityByID(const QUuid& id) const; EntityItemPointer findEntityByEntityItemID(const EntityItemID& entityID) const; @@ -291,6 +293,7 @@ signals: protected: + void recursivelyFilterAndCollectForDelete(const EntityItemPointer& entity, SetOfEntities& entitiesToDelete, bool force) const; void processRemovedEntities(const DeleteEntityOperator& theOperator); bool updateEntity(EntityItemPointer entity, const EntityItemProperties& properties, const SharedNodePointer& senderNode = SharedNodePointer(nullptr)); @@ -339,12 +342,12 @@ protected: int _totalEditMessages = 0; int _totalUpdates = 0; int _totalCreates = 0; - quint64 _totalDecodeTime = 0; - quint64 _totalLookupTime = 0; - quint64 _totalUpdateTime = 0; - quint64 _totalCreateTime = 0; - quint64 _totalLoggingTime = 0; - quint64 _totalFilterTime = 0; + mutable quint64 _totalDecodeTime = 0; + mutable quint64 _totalLookupTime = 0; + mutable quint64 _totalUpdateTime = 0; + mutable quint64 _totalCreateTime = 0; + mutable quint64 _totalLoggingTime = 0; + mutable quint64 _totalFilterTime = 0; // these performance statistics are only used in the client void resetClientEditStats(); @@ -364,7 +367,7 @@ protected: float _maxTmpEntityLifetime { DEFAULT_MAX_TMP_ENTITY_LIFETIME }; - bool filterProperties(EntityItemPointer& existingEntity, EntityItemProperties& propertiesIn, EntityItemProperties& propertiesOut, bool& wasChanged, FilterType filterType); + bool filterProperties(const EntityItemPointer& existingEntity, EntityItemProperties& propertiesIn, EntityItemProperties& propertiesOut, bool& wasChanged, FilterType filterType) const; bool _hasEntityEditFilter{ false }; QStringList _entityScriptSourceWhitelist; diff --git a/libraries/entities/src/EntityTreeElement.cpp b/libraries/entities/src/EntityTreeElement.cpp index 60eaafc0dd..0096319081 100644 --- a/libraries/entities/src/EntityTreeElement.cpp +++ b/libraries/entities/src/EntityTreeElement.cpp @@ -705,7 +705,7 @@ void EntityTreeElement::cleanupDomainAndNonOwnedEntities() { withWriteLock([&] { EntityItems savedEntities; foreach(EntityItemPointer entity, _entityItems) { - if (!(entity->isLocalEntity() || (entity->isAvatarEntity() && entity->getOwningAvatarID() == getTree()->getMyAvatarSessionUUID()))) { + if (!(entity->isLocalEntity() || entity->isMyAvatarEntity())) { entity->preDelete(); entity->_element = NULL; } else { diff --git a/libraries/entities/src/SimpleEntitySimulation.cpp b/libraries/entities/src/SimpleEntitySimulation.cpp index b8e3df2d03..d64efdf87f 100644 --- a/libraries/entities/src/SimpleEntitySimulation.cpp +++ b/libraries/entities/src/SimpleEntitySimulation.cpp @@ -47,14 +47,17 @@ void SimpleEntitySimulation::clearOwnership(const QUuid& ownerID) { } } -void SimpleEntitySimulation::updateEntitiesInternal(uint64_t now) { +void SimpleEntitySimulation::updateEntities() { + EntitySimulation::updateEntities(); + QMutexLocker lock(&_mutex); + uint64_t now = usecTimestampNow(); expireStaleOwnerships(now); stopOwnerlessEntities(now); } -void SimpleEntitySimulation::addEntityInternal(EntityItemPointer entity) { +void SimpleEntitySimulation::addEntityToInternalLists(EntityItemPointer entity) { + EntitySimulation::addEntityToInternalLists(entity); if (entity->getSimulatorID().isNull()) { - QMutexLocker lock(&_mutex); if (entity->getDynamic()) { // we don't allow dynamic objects to move without an owner so nothing to do here } else if (entity->isMovingRelativeToParent()) { @@ -65,7 +68,6 @@ void SimpleEntitySimulation::addEntityInternal(EntityItemPointer entity) { } } } else { - QMutexLocker lock(&_mutex); _entitiesWithSimulationOwner.insert(entity); _nextStaleOwnershipExpiry = glm::min(_nextStaleOwnershipExpiry, entity->getSimulationOwnershipExpiry()); @@ -79,10 +81,10 @@ void SimpleEntitySimulation::addEntityInternal(EntityItemPointer entity) { } } -void SimpleEntitySimulation::removeEntityInternal(EntityItemPointer entity) { - EntitySimulation::removeEntityInternal(entity); +void SimpleEntitySimulation::removeEntityFromInternalLists(EntityItemPointer entity) { _entitiesWithSimulationOwner.remove(entity); _entitiesThatNeedSimulationOwner.remove(entity); + EntitySimulation::removeEntityFromInternalLists(entity); } void SimpleEntitySimulation::processChangedEntity(const EntityItemPointer& entity) { @@ -135,10 +137,11 @@ void SimpleEntitySimulation::processChangedEntity(const EntityItemPointer& entit entity->clearDirtyFlags(); } -void SimpleEntitySimulation::clearEntitiesInternal() { +void SimpleEntitySimulation::clearEntities() { QMutexLocker lock(&_mutex); _entitiesWithSimulationOwner.clear(); _entitiesThatNeedSimulationOwner.clear(); + EntitySimulation::clearEntities(); } void SimpleEntitySimulation::sortEntitiesThatMoved() { diff --git a/libraries/entities/src/SimpleEntitySimulation.h b/libraries/entities/src/SimpleEntitySimulation.h index 1b240a8bf0..e984b72ed4 100644 --- a/libraries/entities/src/SimpleEntitySimulation.h +++ b/libraries/entities/src/SimpleEntitySimulation.h @@ -23,16 +23,16 @@ using SimpleEntitySimulationPointer = std::shared_ptr; class SimpleEntitySimulation : public EntitySimulation { public: SimpleEntitySimulation() : EntitySimulation() { } - ~SimpleEntitySimulation() { clearEntitiesInternal(); } + ~SimpleEntitySimulation() { clearEntities(); } void clearOwnership(const QUuid& ownerID); + void clearEntities() override; + void updateEntities() override; protected: - void updateEntitiesInternal(uint64_t now) override; - void addEntityInternal(EntityItemPointer entity) override; - void removeEntityInternal(EntityItemPointer entity) override; + void addEntityToInternalLists(EntityItemPointer entity) override; + void removeEntityFromInternalLists(EntityItemPointer entity) override; void processChangedEntity(const EntityItemPointer& entity) override; - void clearEntitiesInternal() override; void sortEntitiesThatMoved() override; diff --git a/libraries/physics/src/EntityMotionState.cpp b/libraries/physics/src/EntityMotionState.cpp index e48f0603bd..f3d129871f 100644 --- a/libraries/physics/src/EntityMotionState.cpp +++ b/libraries/physics/src/EntityMotionState.cpp @@ -62,7 +62,7 @@ EntityMotionState::EntityMotionState(btCollisionShape* shape, EntityItemPointer // rather than pass the legit shape pointer to the ObjectMotionState ctor above. setShape(shape); - if (_entity->isAvatarEntity() && _entity->getOwningAvatarID() != Physics::getSessionUUID()) { + if (_entity->isAvatarEntity() && !_entity->isMyAvatarEntity()) { // avatar entities are always thus, so we cache this fact in _ownershipState _ownershipState = EntityMotionState::OwnershipState::Unownable; } @@ -407,8 +407,8 @@ bool EntityMotionState::shouldSendUpdate(uint32_t simulationStep) { // NOTE: we expect _entity and _body to be valid in this context, since shouldSendUpdate() is only called // after doesNotNeedToSendUpdate() returns false and that call should return 'true' if _entity or _body are NULL. - // this case is prevented by setting _ownershipState to UNOWNABLE in EntityMotionState::ctor - assert(!(_entity->isAvatarEntity() && _entity->getOwningAvatarID() != Physics::getSessionUUID())); + // this case is prevented by setting _ownershipState to OwnershipState::Unownable in EntityMotionState::ctor + assert(!(_entity->isAvatarEntity() && !_entity->isMyAvatarEntity())); if (_entity->getTransitingWithAvatar()) { return false; @@ -768,7 +768,7 @@ uint8_t EntityMotionState::computeFinalBidPriority() const { } bool EntityMotionState::isLocallyOwned() const { - return _entity->getSimulatorID() == Physics::getSessionUUID(); + return _entity->getSimulatorID() == Physics::getSessionUUID() || _entity->isMyAvatarEntity(); } bool EntityMotionState::isLocallyOwnedOrShouldBe() const { @@ -786,13 +786,21 @@ void EntityMotionState::setRegion(uint8_t region) { } void EntityMotionState::initForBid() { - assert(_ownershipState != EntityMotionState::OwnershipState::Unownable); - _ownershipState = EntityMotionState::OwnershipState::PendingBid; + if (_ownershipState != EntityMotionState::OwnershipState::Unownable) { + _ownershipState = EntityMotionState::OwnershipState::PendingBid; + } } void EntityMotionState::initForOwned() { - assert(_ownershipState != EntityMotionState::OwnershipState::Unownable); - _ownershipState = EntityMotionState::OwnershipState::LocallyOwned; + if (_ownershipState != EntityMotionState::OwnershipState::Unownable) { + _ownershipState = EntityMotionState::OwnershipState::LocallyOwned; + } +} + +void EntityMotionState::clearOwnershipState() { + if (_ownershipState != OwnershipState::Unownable) { + _ownershipState = OwnershipState::NotLocallyOwned; + } } void EntityMotionState::clearObjectVelocities() const { diff --git a/libraries/physics/src/EntityMotionState.h b/libraries/physics/src/EntityMotionState.h index 7456837777..be6f5c0658 100644 --- a/libraries/physics/src/EntityMotionState.h +++ b/libraries/physics/src/EntityMotionState.h @@ -107,7 +107,7 @@ protected: uint64_t getNextBidExpiry() const { return _nextBidExpiry; } void initForBid(); void initForOwned(); - void clearOwnershipState() { _ownershipState = OwnershipState::NotLocallyOwned; } + void clearOwnershipState(); void updateServerPhysicsVariables(); bool remoteSimulationOutOfSync(uint32_t simulationStep); diff --git a/libraries/physics/src/PhysicalEntitySimulation.cpp b/libraries/physics/src/PhysicalEntitySimulation.cpp index df8c3fa32e..0375e1dfd9 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.cpp +++ b/libraries/physics/src/PhysicalEntitySimulation.cpp @@ -40,14 +40,9 @@ void PhysicalEntitySimulation::init( } // begin EntitySimulation overrides -void PhysicalEntitySimulation::updateEntitiesInternal(uint64_t now) { - // Do nothing here because the "internal" update the PhysicsEngine::stepSimulation() which is done elsewhere. -} - -void PhysicalEntitySimulation::addEntityInternal(EntityItemPointer entity) { - QMutexLocker lock(&_mutex); - assert(entity); - assert(!entity->isDead()); +void PhysicalEntitySimulation::addEntityToInternalLists(EntityItemPointer entity) { + EntitySimulation::addEntityToInternalLists(entity); + entity->deserializeActions(); // TODO: do this elsewhere uint8_t region = _space->getRegion(entity->getSpaceIndex()); bool maybeShouldBePhysical = (region < workload::Region::R3 || region == workload::Region::UNKNOWN) && entity->shouldBePhysical(); bool canBeKinematic = region <= workload::Region::R3; @@ -66,23 +61,20 @@ void PhysicalEntitySimulation::addEntityInternal(EntityItemPointer entity) { } } -void PhysicalEntitySimulation::removeEntityInternal(EntityItemPointer entity) { - if (entity->isSimulated()) { - EntitySimulation::removeEntityInternal(entity); - _entitiesToAddToPhysics.remove(entity); - - EntityMotionState* motionState = static_cast(entity->getPhysicsInfo()); - if (motionState) { - removeOwnershipData(motionState); - _entitiesToRemoveFromPhysics.insert(entity); - } - if (entity->isDead() && entity->getElement()) { - _deadEntities.insert(entity); - } +void PhysicalEntitySimulation::removeEntityFromInternalLists(EntityItemPointer entity) { + _entitiesToAddToPhysics.remove(entity); + EntityMotionState* motionState = static_cast(entity->getPhysicsInfo()); + if (motionState) { + removeOwnershipData(motionState); + _entitiesToRemoveFromPhysics.insert(entity); + } + if (entity->isDead() && entity->getElement()) { + _deadEntitiesToRemoveFromTree.insert(entity); } if (entity->isAvatarEntity()) { _deadAvatarEntities.insert(entity); } + EntitySimulation::removeEntityFromInternalLists(entity); } void PhysicalEntitySimulation::removeOwnershipData(EntityMotionState* motionState) { @@ -115,18 +107,6 @@ void PhysicalEntitySimulation::clearOwnershipData() { _bids.clear(); } -void PhysicalEntitySimulation::takeDeadEntities(SetOfEntities& deadEntities) { - QMutexLocker lock(&_mutex); - for (auto entity : _deadEntities) { - EntityMotionState* motionState = static_cast(entity->getPhysicsInfo()); - if (motionState) { - _entitiesToRemoveFromPhysics.insert(entity); - } - } - _deadEntities.swap(deadEntities); - _deadEntities.clear(); -} - void PhysicalEntitySimulation::takeDeadAvatarEntities(SetOfEntities& deadEntities) { _deadAvatarEntities.swap(deadEntities); _deadAvatarEntities.clear(); @@ -190,11 +170,44 @@ void PhysicalEntitySimulation::processChangedEntity(const EntityItemPointer& ent } } -void PhysicalEntitySimulation::clearEntitiesInternal() { +void PhysicalEntitySimulation::processDeadEntities() { + if (_deadEntitiesToRemoveFromTree.empty()) { + return; + } + PROFILE_RANGE(simulation_physics, "Deletes"); + SetOfEntities entitiesToDeleteImmediately; + SetOfEntities domainEntities; + QUuid sessionID = Physics::getSessionUUID(); + QMutexLocker lock(&_mutex); + for (auto entity : _deadEntitiesToRemoveFromTree) { + EntityMotionState* motionState = static_cast(entity->getPhysicsInfo()); + if (motionState) { + _entitiesToRemoveFromPhysics.insert(entity); + } + if (entity->isDomainEntity()) { + domainEntities.insert(entity); + } else if (entity->isLocalEntity() || entity->isMyAvatarEntity()) { + entitiesToDeleteImmediately.insert(entity); + entity->collectChildrenForDelete(entitiesToDeleteImmediately, domainEntities, sessionID); + } + } + _deadEntitiesToRemoveFromTree.clear(); + + // interface-client can't delete domainEntities outright, they must roundtrip through the entity-server + for (auto entity : domainEntities) { + _entityPacketSender->queueEraseEntityMessage(entity->getID()); + } + if (!entitiesToDeleteImmediately.empty()) { + getEntityTree()->deleteEntitiesByPointer(entitiesToDeleteImmediately); + } +} + +void PhysicalEntitySimulation::clearEntities() { // TODO: we should probably wait to lock the _physicsEngine so we don't mess up data structures // while it is in the middle of a simulation step. As it is, we're probably in shutdown mode // anyway, so maybe the simulation was already properly shutdown? Cross our fingers... + QMutexLocker lock(&_mutex); // remove the objects (aka MotionStates) from physics _physicsEngine->removeSetOfObjects(_physicalObjects); @@ -216,11 +229,23 @@ void PhysicalEntitySimulation::clearEntitiesInternal() { _entitiesToAddToPhysics.clear(); _incomingChanges.clear(); _entitiesToDeleteLater.clear(); + + EntitySimulation::clearEntities(); +} + +void PhysicalEntitySimulation::queueEraseDomainEntities(const SetOfEntities& domainEntities) const { + if (_entityPacketSender) { + for (auto domainEntity : domainEntities) { + assert(domainEntity->isDomainEntity()); + _entityPacketSender->queueEraseEntityMessage(domainEntity->getID()); + } + } } // virtual void PhysicalEntitySimulation::prepareEntityForDelete(EntityItemPointer entity) { - // this can be called on any thread + // DANGER! this can be called on any thread + // do no dirty deeds here --> assemble list for later assert(entity); assert(entity->isDead()); QMutexLocker lock(&_mutex); @@ -228,11 +253,11 @@ void PhysicalEntitySimulation::prepareEntityForDelete(EntityItemPointer entity) } void PhysicalEntitySimulation::removeDeadEntities() { - // only ever call this on the main thread + // DANGER! only ever call this on the main thread QMutexLocker lock(&_mutex); for (auto& entity : _entitiesToDeleteLater) { entity->clearActions(getThisPointer()); - removeEntityInternal(entity); + EntitySimulation::prepareEntityForDelete(entity); } _entitiesToDeleteLater.clear(); } @@ -647,10 +672,16 @@ void PhysicalEntitySimulation::addDynamic(EntityDynamicPointer dynamic) { "dynamic that was already in _physicsEngine"; } } - EntitySimulation::addDynamic(dynamic); + QMutexLocker lock(&_dynamicsMutex); + _dynamicsToAdd += dynamic; } } +void PhysicalEntitySimulation::removeDynamic(const QUuid dynamicID) { + QMutexLocker lock(&_dynamicsMutex); + _dynamicsToRemove += dynamicID; +} + void PhysicalEntitySimulation::applyDynamicChanges() { QList dynamicsFailedToAdd; if (_physicsEngine) { @@ -665,8 +696,8 @@ void PhysicalEntitySimulation::applyDynamicChanges() { } } } - // applyDynamicChanges will clear _dynamicsToRemove and _dynamicsToAdd - EntitySimulation::applyDynamicChanges(); + _dynamicsToAdd.clear(); + _dynamicsToRemove.clear(); } // put back the ones that couldn't yet be added diff --git a/libraries/physics/src/PhysicalEntitySimulation.h b/libraries/physics/src/PhysicalEntitySimulation.h index f5213f7fef..a3bd60b96e 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.h +++ b/libraries/physics/src/PhysicalEntitySimulation.h @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -58,22 +59,24 @@ public: void init(EntityTreePointer tree, PhysicsEnginePointer engine, EntityEditPacketSender* packetSender); void setWorkloadSpace(const workload::SpacePointer space) { _space = space; } - virtual void addDynamic(EntityDynamicPointer dynamic) override; - virtual void applyDynamicChanges() override; + void addDynamic(EntityDynamicPointer dynamic) override; + void removeDynamic(const QUuid dynamicID) override; + void applyDynamicChanges() override; - virtual void takeDeadEntities(SetOfEntities& deadEntities) override; void takeDeadAvatarEntities(SetOfEntities& deadEntities); + virtual void clearEntities() override; + void queueEraseDomainEntities(const SetOfEntities& domainEntities) const override; + signals: void entityCollisionWithEntity(const EntityItemID& idA, const EntityItemID& idB, const Collision& collision); protected: // only called by EntitySimulation // overrides for EntitySimulation - virtual void updateEntitiesInternal(uint64_t now) override; - virtual void addEntityInternal(EntityItemPointer entity) override; - virtual void removeEntityInternal(EntityItemPointer entity) override; + void addEntityToInternalLists(EntityItemPointer entity) override; + void removeEntityFromInternalLists(EntityItemPointer entity) override; void processChangedEntity(const EntityItemPointer& entity) override; - virtual void clearEntitiesInternal() override; + void processDeadEntities() override; void removeOwnershipData(EntityMotionState* motionState); void clearOwnershipData(); @@ -121,8 +124,13 @@ private: VectorOfEntityMotionStates _owned; VectorOfEntityMotionStates _bids; - SetOfEntities _deadAvatarEntities; + SetOfEntities _deadAvatarEntities; // to remove from Avatar's lists std::vector _entitiesToDeleteLater; + + QList _dynamicsToAdd; + QSet _dynamicsToRemove; + QMutex _dynamicsMutex { QMutex::Recursive }; + workload::SpacePointer _space; uint64_t _nextBidExpiry; uint32_t _lastStepSendPackets { 0 }; diff --git a/libraries/shared/src/PhysicsHelpers.cpp b/libraries/shared/src/PhysicsHelpers.cpp index 092b9d078a..b7f5242429 100644 --- a/libraries/shared/src/PhysicsHelpers.cpp +++ b/libraries/shared/src/PhysicsHelpers.cpp @@ -10,10 +10,12 @@ // #include "PhysicsHelpers.h" -#include "NumericalConstants.h" + #include +#include "NumericalConstants.h" #include "PhysicsCollisionGroups.h" +#include "SharedUtil.h" // This chunk of code was copied from Bullet-2.82, so we include the Bullet license here: /* @@ -91,7 +93,7 @@ int32_t Physics::getDefaultCollisionMask(int32_t group) { QUuid _sessionID; void Physics::setSessionUUID(const QUuid& sessionID) { - _sessionID = sessionID; + _sessionID = sessionID.isNull() ? AVATAR_SELF_ID : sessionID; } const QUuid& Physics::getSessionUUID() { diff --git a/libraries/shared/src/SpatialParentFinder.h b/libraries/shared/src/SpatialParentFinder.h index c19babbc7f..8300359b65 100644 --- a/libraries/shared/src/SpatialParentFinder.h +++ b/libraries/shared/src/SpatialParentFinder.h @@ -21,7 +21,7 @@ using SpatiallyNestableWeakPointer = std::weak_ptr; using SpatiallyNestablePointer = std::shared_ptr; class SpatialParentTree { public: - virtual SpatiallyNestablePointer findByID(const QUuid& id) const { return nullptr; } + virtual SpatiallyNestablePointer findByID(const QUuid& id) const = 0; }; class SpatialParentFinder : public Dependency { diff --git a/tests/octree/src/ModelTests.cpp b/tests/octree/src/ModelTests.cpp index f3e17a56a5..1ab32217d9 100644 --- a/tests/octree/src/ModelTests.cpp +++ b/tests/octree/src/ModelTests.cpp @@ -363,7 +363,8 @@ void EntityTests::entityTreeTests(bool verbose) { } quint64 startDelete = usecTimestampNow(); - tree.deleteEntity(entityID); + bool force = true; + tree.deleteEntity(entityID, force); quint64 endDelete = usecTimestampNow(); totalElapsedDelete += (endDelete - startDelete); @@ -446,7 +447,9 @@ void EntityTests::entityTreeTests(bool verbose) { } quint64 startDelete = usecTimestampNow(); - tree.deleteEntities(entitiesToDelete); + bool force = true; + bool ignoreWarnings = true; + tree.deleteEntitiesByID(entitiesToDelete, force, ignoreWarnings); quint64 endDelete = usecTimestampNow(); totalElapsedDelete += (endDelete - startDelete); From 4e6a6477188e4473e48efcf4622add205a3c28de Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Tue, 15 Oct 2019 15:15:56 -0700 Subject: [PATCH 08/22] don't restrict edit properties of myAvatarEntity --- libraries/entities/src/EntityScriptingInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index 1ca6a5804f..7bb7f65089 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -821,7 +821,7 @@ QUuid EntityScriptingInterface::editEntity(const QUuid& id, const EntityItemProp // flag for simulation ownership, or upgrade existing ownership priority // (actual bids for simulation ownership are sent by the PhysicalEntitySimulation) entity->upgradeScriptSimulationPriority(properties.computeSimulationBidPriority()); - if (simulationOwner.getID() == sessionID) { + if (entity->isMyAvatarEntity() || simulationOwner.getID() == sessionID) { // we own the simulation --> copy ALL restricted properties properties.copySimulationRestrictedProperties(entity); } else { From 4159bc4862c5c9a165b546b0cb1fd972c281d37b Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 16 Oct 2019 08:55:02 -0700 Subject: [PATCH 09/22] abide by domain-entity hierarchy deletion rules --- libraries/entities/src/EntityItem.cpp | 6 ++---- libraries/entities/src/EntityItem.h | 2 +- .../entities/src/EntityScriptingInterface.cpp | 13 +++---------- libraries/entities/src/EntitySimulation.cpp | 6 +----- libraries/entities/src/EntitySimulation.h | 2 +- libraries/entities/src/EntityTree.cpp | 17 +++++------------ .../physics/src/PhysicalEntitySimulation.cpp | 17 +++++------------ .../physics/src/PhysicalEntitySimulation.h | 2 +- 8 files changed, 19 insertions(+), 46 deletions(-) diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index 15aacd934c..58584cc72b 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -3235,7 +3235,7 @@ void EntityItem::retrieveMarketplacePublicKey() { }); } -void EntityItem::collectChildrenForDelete(SetOfEntities& entitiesToDelete, SetOfEntities& domainEntities, const QUuid& sessionID) const { +void EntityItem::collectChildrenForDelete(SetOfEntities& entitiesToDelete, const QUuid& sessionID) const { // Deleting an entity has consequences for its children, however there are rules dictating what can be deleted. // This method helps enforce those rules for the children of entity (not for this entity). for (SpatiallyNestablePointer child : getChildren()) { @@ -3246,10 +3246,8 @@ void EntityItem::collectChildrenForDelete(SetOfEntities& entitiesToDelete, SetOf (childEntity->isMyAvatarEntity() || childEntity->getOwningAvatarID() == sessionID))) { if (entitiesToDelete.find(childEntity) == entitiesToDelete.end()) { entitiesToDelete.insert(childEntity); - childEntity->collectChildrenForDelete(entitiesToDelete, domainEntities, sessionID); + childEntity->collectChildrenForDelete(entitiesToDelete, sessionID); } - } else if (childEntity->isDomainEntity()) { - domainEntities.insert(childEntity); } } } diff --git a/libraries/entities/src/EntityItem.h b/libraries/entities/src/EntityItem.h index fef198c006..01e63bbd3b 100644 --- a/libraries/entities/src/EntityItem.h +++ b/libraries/entities/src/EntityItem.h @@ -543,7 +543,7 @@ public: static QString _marketplacePublicKey; static void retrieveMarketplacePublicKey(); - void collectChildrenForDelete(SetOfEntities& entitiesToDelete, SetOfEntities& domainEntities, const QUuid& sessionID) const; + void collectChildrenForDelete(SetOfEntities& entitiesToDelete, const QUuid& sessionID) const; float getBoundingRadius() const { return _boundingRadius; } void setSpaceIndex(int32_t index); diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index 7bb7f65089..7299665bd2 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -974,7 +974,6 @@ void EntityScriptingInterface::deleteEntity(const QUuid& id) { // If we have a local entity tree set, then also update it. SetOfEntities entitiesToDeleteImmediately; - SetOfEntities domainEntities; _entityTree->withWriteLock([&] { EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID); if (entity) { @@ -988,15 +987,13 @@ void EntityScriptingInterface::deleteEntity(const QUuid& id) { // Deleting an entity has consequences for linked children: some can be deleted but others can't. // Local- and my-avatar-entities can be deleted immediately, but other-avatar-entities can't be deleted - // by this context, and domain-entity deletes must rountrip through the entity-server for authorization. - // So we recurse down the linked hierarchy and snarf children into two categories: - // (a) entitiesToDeleteImmediately and (b) domainEntntities. + // by this context, and a domain-entity must rountrip through the entity-server for authorization. if (entity->isDomainEntity()) { - domainEntities.insert(entity); + getEntityPacketSender()->queueEraseEntityMessage(entity->getID()); } else { entitiesToDeleteImmediately.insert(entity); const auto sessionID = DependencyManager::get()->getSessionUUID(); - entity->collectChildrenForDelete(entitiesToDeleteImmediately, domainEntities, sessionID); + entity->collectChildrenForDelete(entitiesToDeleteImmediately, sessionID); } if (!entitiesToDeleteImmediately.empty()) { _entityTree->deleteEntitiesByPointer(entitiesToDeleteImmediately); @@ -1009,10 +1006,6 @@ void EntityScriptingInterface::deleteEntity(const QUuid& id) { getEntityPacketSender()->getMyAvatar()->clearAvatarEntity(entityID, false); } } - // finally ask entity-server to delete domainEntities - foreach (auto entity, domainEntities) { - getEntityPacketSender()->queueEraseEntityMessage(entity->getID()); - } } QString EntityScriptingInterface::getEntityType(const QUuid& entityID) { diff --git a/libraries/entities/src/EntitySimulation.cpp b/libraries/entities/src/EntitySimulation.cpp index 5576f21cc5..c272d16b4d 100644 --- a/libraries/entities/src/EntitySimulation.cpp +++ b/libraries/entities/src/EntitySimulation.cpp @@ -261,14 +261,10 @@ void EntitySimulation::processDeadEntities() { return; } SetOfEntities entitiesToDeleteImmediately; - // NOTE: dummyList will be empty because this base-class implementation is only used server-side - // for which ATM we only process domain-entities, and since we are passing nullSessionID for authorization - // EntityItem::collectChildrenForDelete() will not collect domain-entities into this side list. - SetOfEntities dummyList; QUuid nullSessionID; foreach (auto entity, _deadEntitiesToRemoveFromTree) { entitiesToDeleteImmediately.insert(entity); - entity->collectChildrenForDelete(entitiesToDeleteImmediately, dummyList, nullSessionID); + entity->collectChildrenForDelete(entitiesToDeleteImmediately, nullSessionID); } if (_entityTree) { _entityTree->deleteEntitiesByPointer(entitiesToDeleteImmediately); diff --git a/libraries/entities/src/EntitySimulation.h b/libraries/entities/src/EntitySimulation.h index 646e5a0f67..5b7b38e447 100644 --- a/libraries/entities/src/EntitySimulation.h +++ b/libraries/entities/src/EntitySimulation.h @@ -78,7 +78,7 @@ public: virtual void prepareEntityForDelete(EntityItemPointer entity); void processChangedEntities(); - virtual void queueEraseDomainEntities(const SetOfEntities& domainEntities) const { } + virtual void queueEraseDomainEntity(const QUuid& id) const { } protected: virtual void addEntityToInternalLists(EntityItemPointer entity); diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index f44f2eb7c5..ad9e71be8f 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -697,7 +697,6 @@ void EntityTree::deleteEntitiesByID(const QSet& ids, bool force, b }); } else { SetOfEntities entitiesToDelete; - SetOfEntities domainEntities; QUuid sessionID = DependencyManager::get()->getSessionUUID(); withWriteLock([&] { for (auto id : ids) { @@ -708,10 +707,12 @@ void EntityTree::deleteEntitiesByID(const QSet& ids, bool force, b } if (entity) { if (entity->isDomainEntity()) { - domainEntities.insert(entity); + if (_simulation) { + _simulation->queueEraseDomainEntity(entity->getID()); + } } else if (entity->isLocalEntity() || entity->isMyAvatarEntity()) { entitiesToDelete.insert(entity); - entity->collectChildrenForDelete(entitiesToDelete, domainEntities, sessionID); + entity->collectChildrenForDelete(entitiesToDelete, sessionID); } } } @@ -719,10 +720,6 @@ void EntityTree::deleteEntitiesByID(const QSet& ids, bool force, b deleteEntitiesByPointer(entitiesToDelete); } }); - if (!domainEntities.empty() && _simulation) { - // interface-client can't delete domainEntities outright, they must roundtrip through the entity-server - _simulation->queueEraseDomainEntities(domainEntities); - } } } @@ -2366,7 +2363,6 @@ int EntityTree::processEraseMessage(ReceivedMessage& message, const SharedNodePo #ifdef EXTRA_ERASE_DEBUGGING qCDebug(entities) << "EntityTree::processEraseMessage()"; #endif - SetOfEntities consequentialDomainEntities; withWriteLock([&] { message.seek(sizeof(OCTREE_PACKET_FLAGS) + sizeof(OCTREE_PACKET_SEQUENCE) + sizeof(OCTREE_PACKET_SENT_TIME)); @@ -2413,7 +2409,7 @@ int EntityTree::processEraseMessage(ReceivedMessage& message, const SharedNodePo SetOfEntities entitiesToDelete; for (auto entity : domainEntities) { entitiesToDelete.insert(entity); - entity->collectChildrenForDelete(entitiesToDelete, consequentialDomainEntities, sessionID); + entity->collectChildrenForDelete(entitiesToDelete, sessionID); } if (!entitiesToDelete.empty()) { @@ -2421,9 +2417,6 @@ int EntityTree::processEraseMessage(ReceivedMessage& message, const SharedNodePo } } }); - if (!consequentialDomainEntities.empty() && _simulation) { - _simulation->queueEraseDomainEntities(consequentialDomainEntities); - } return message.getPosition(); } diff --git a/libraries/physics/src/PhysicalEntitySimulation.cpp b/libraries/physics/src/PhysicalEntitySimulation.cpp index 0375e1dfd9..d83708b2a2 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.cpp +++ b/libraries/physics/src/PhysicalEntitySimulation.cpp @@ -176,7 +176,6 @@ void PhysicalEntitySimulation::processDeadEntities() { } PROFILE_RANGE(simulation_physics, "Deletes"); SetOfEntities entitiesToDeleteImmediately; - SetOfEntities domainEntities; QUuid sessionID = Physics::getSessionUUID(); QMutexLocker lock(&_mutex); for (auto entity : _deadEntitiesToRemoveFromTree) { @@ -185,18 +184,15 @@ void PhysicalEntitySimulation::processDeadEntities() { _entitiesToRemoveFromPhysics.insert(entity); } if (entity->isDomainEntity()) { - domainEntities.insert(entity); + // interface-client can't delete domainEntities outright, they must roundtrip through the entity-server + _entityPacketSender->queueEraseEntityMessage(entity->getID()); } else if (entity->isLocalEntity() || entity->isMyAvatarEntity()) { entitiesToDeleteImmediately.insert(entity); - entity->collectChildrenForDelete(entitiesToDeleteImmediately, domainEntities, sessionID); + entity->collectChildrenForDelete(entitiesToDeleteImmediately, sessionID); } } _deadEntitiesToRemoveFromTree.clear(); - // interface-client can't delete domainEntities outright, they must roundtrip through the entity-server - for (auto entity : domainEntities) { - _entityPacketSender->queueEraseEntityMessage(entity->getID()); - } if (!entitiesToDeleteImmediately.empty()) { getEntityTree()->deleteEntitiesByPointer(entitiesToDeleteImmediately); } @@ -233,12 +229,9 @@ void PhysicalEntitySimulation::clearEntities() { EntitySimulation::clearEntities(); } -void PhysicalEntitySimulation::queueEraseDomainEntities(const SetOfEntities& domainEntities) const { +void PhysicalEntitySimulation::queueEraseDomainEntity(const QUuid& id) const { if (_entityPacketSender) { - for (auto domainEntity : domainEntities) { - assert(domainEntity->isDomainEntity()); - _entityPacketSender->queueEraseEntityMessage(domainEntity->getID()); - } + _entityPacketSender->queueEraseEntityMessage(id); } } diff --git a/libraries/physics/src/PhysicalEntitySimulation.h b/libraries/physics/src/PhysicalEntitySimulation.h index a3bd60b96e..0f0a8e9295 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.h +++ b/libraries/physics/src/PhysicalEntitySimulation.h @@ -66,7 +66,7 @@ public: void takeDeadAvatarEntities(SetOfEntities& deadEntities); virtual void clearEntities() override; - void queueEraseDomainEntities(const SetOfEntities& domainEntities) const override; + void queueEraseDomainEntity(const QUuid& id) const override; signals: void entityCollisionWithEntity(const EntityItemID& idA, const EntityItemID& idB, const Collision& collision); From fb090d138853b65df3594ae1faed96b01458d15b Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 16 Oct 2019 15:18:15 -0700 Subject: [PATCH 10/22] force delete OtherAvatar entities when necessary --- libraries/entities/src/EntityTree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index ad9e71be8f..dc94024804 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -710,7 +710,7 @@ void EntityTree::deleteEntitiesByID(const QSet& ids, bool force, b if (_simulation) { _simulation->queueEraseDomainEntity(entity->getID()); } - } else if (entity->isLocalEntity() || entity->isMyAvatarEntity()) { + } else if (force || entity->isLocalEntity() || entity->isMyAvatarEntity()) { entitiesToDelete.insert(entity); entity->collectChildrenForDelete(entitiesToDelete, sessionID); } From 3546bab19a8a28f1ee43357270c9a6bad9695ca9 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 18 Oct 2019 10:13:56 -0700 Subject: [PATCH 11/22] use std::vector<> instead of QVector<> --- interface/src/avatar/MyAvatar.cpp | 5 ++-- interface/src/avatar/OtherAvatar.cpp | 21 ++++++++------ .../src/avatars-renderer/Avatar.cpp | 8 +++-- libraries/entities/src/EntityTree.cpp | 29 ++++++++++++------- libraries/entities/src/EntityTree.h | 2 +- tests/octree/src/ModelTests.cpp | 5 ++-- 6 files changed, 44 insertions(+), 26 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 5c10e05806..667c315121 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1589,14 +1589,15 @@ void MyAvatar::handleChangedAvatarEntityData() { // move the lists to minimize lock time std::vector cachedBlobsToDelete; std::vector cachedBlobsToUpdate; - QSet idsToDelete; + std::vector idsToDelete; + idsToDelete.reserve(_entitiesToDelete.size()); std::vector entitiesToAdd; std::vector entitiesToUpdate; _avatarEntitiesLock.withWriteLock([&] { cachedBlobsToDelete = std::move(_cachedAvatarEntityBlobsToDelete); cachedBlobsToUpdate = std::move(_cachedAvatarEntityBlobsToAddOrUpdate); foreach (auto id, _entitiesToDelete) { - idsToDelete.insert(id); + idsToDelete.push_back(id); } _entitiesToDelete.clear(); entitiesToAdd = std::move(_entitiesToAdd); diff --git a/interface/src/avatar/OtherAvatar.cpp b/interface/src/avatar/OtherAvatar.cpp index 43d1ddeaad..aa6c074d08 100755 --- a/interface/src/avatar/OtherAvatar.cpp +++ b/interface/src/avatar/OtherAvatar.cpp @@ -561,16 +561,19 @@ void OtherAvatar::handleChangedAvatarEntityData() { _avatarEntitiesLock.withReadLock([&] { packedAvatarEntityData = _packedAvatarEntityData; }); - QSet idsToDelete; - foreach (auto entityID, recentlyRemovedAvatarEntities) { - if (!packedAvatarEntityData.contains(entityID)) { - idsToDelete.insert(entityID); + if (!recentlyRemovedAvatarEntities.empty()) { + std::vector idsToDelete; + idsToDelete.reserve(recentlyRemovedAvatarEntities.size()); + foreach (auto entityID, recentlyRemovedAvatarEntities) { + if (!packedAvatarEntityData.contains(entityID)) { + idsToDelete.push_back(entityID); + } + } + if (!idsToDelete.empty()) { + bool force = true; + bool ignoreWarnings = true; + entityTree->deleteEntitiesByID(idsToDelete, force, ignoreWarnings); } - } - if (!idsToDelete.empty()) { - bool force = true; - bool ignoreWarnings = true; - entityTree->deleteEntitiesByID(idsToDelete, force, ignoreWarnings); } // TODO: move this outside of tree lock diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp index 6f0fef40d2..01cc86f8b5 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp @@ -333,6 +333,9 @@ void Avatar::setTargetScale(float targetScale) { } void Avatar::removeAvatarEntitiesFromTree() { + if (_packedAvatarEntityData.empty()) { + return; + } auto treeRenderer = DependencyManager::get(); EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr; if (entityTree) { @@ -340,9 +343,10 @@ void Avatar::removeAvatarEntitiesFromTree() { _avatarEntitiesLock.withReadLock([&] { avatarEntityIDs = _packedAvatarEntityData.keys(); }); - QSet ids; + std::vector ids; + ids.reserve(avatarEntityIDs.size()); foreach (auto id, avatarEntityIDs) { - ids.insert(id); + ids.push_back(id); } bool force = true; bool ignoreWarnings = true; diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index dc94024804..cad25aa61e 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -609,8 +609,8 @@ void EntityTree::setSimulation(EntitySimulationPointer simulation) { void EntityTree::deleteEntity(const EntityItemID& entityID, bool force, bool ignoreWarnings) { // NOTE: can be called without lock because deleteEntitiesByID() will lock - QSet ids; - ids << entityID; + std::vector ids; + ids.push_back(entityID); deleteEntitiesByID(ids, force, ignoreWarnings); } @@ -674,7 +674,7 @@ void EntityTree::recursivelyFilterAndCollectForDelete(const EntityItemPointer& e } } -void EntityTree::deleteEntitiesByID(const QSet& ids, bool force, bool ignoreWarnings) { +void EntityTree::deleteEntitiesByID(const std::vector& ids, bool force, bool ignoreWarnings) { // this method has two paths: // (a) entity-server: applies delete filter // (b) interface-client: deletes local- and my-avatar-entities immediately, submits domainEntity deletes to the entity-server @@ -2230,11 +2230,19 @@ void EntityTree::fixupNeedsParentFixups() { } void EntityTree::deleteDescendantsOfAvatar(QUuid avatarID) { - if (_childrenOfAvatars.contains(avatarID)) { - bool force = true; - bool ignoreWarnings = true; - deleteEntitiesByID(_childrenOfAvatars[avatarID], force, ignoreWarnings); - _childrenOfAvatars.remove(avatarID); + QHash>::const_iterator itr = _childrenOfAvatars.constFind(avatarID); + if (itr != _childrenOfAvatars.end()) { + if (!itr.value().empty()) { + std::vector ids; + ids.reserve(itr.value().size()); + for (const auto id : itr.value()) { + ids.push_back(id); + } + bool force = true; + bool ignoreWarnings = true; + deleteEntitiesByID(ids, force, ignoreWarnings); + } + _childrenOfAvatars.erase(itr); } } @@ -2436,7 +2444,8 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons processedBytes += sizeof(numberOfIds); if (numberOfIds > 0) { - QSet ids; + std::vector ids; + ids.reserve(numberOfIds); // extract ids from packet for (size_t i = 0; i < numberOfIds; i++) { @@ -2454,7 +2463,7 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons #endif EntityItemID entityID(id); - ids << entityID; + ids.push_back(entityID); } bool force = sourceNode->isAllowedEditor(); diff --git a/libraries/entities/src/EntityTree.h b/libraries/entities/src/EntityTree.h index 6574b9d601..dc26b0a9ce 100644 --- a/libraries/entities/src/EntityTree.h +++ b/libraries/entities/src/EntityTree.h @@ -127,7 +127,7 @@ public: void cleanupCloneIDs(const EntityItemID& entityID); void deleteEntity(const EntityItemID& entityID, bool force = false, bool ignoreWarnings = true); - void deleteEntitiesByID(const QSet& entityIDs, bool force = false, bool ignoreWarnings = true); + void deleteEntitiesByID(const std::vector& entityIDs, bool force = false, bool ignoreWarnings = true); void deleteEntitiesByPointer(const SetOfEntities& entities); EntityItemPointer findEntityByID(const QUuid& id) const; diff --git a/tests/octree/src/ModelTests.cpp b/tests/octree/src/ModelTests.cpp index 1ab32217d9..0b812c1de7 100644 --- a/tests/octree/src/ModelTests.cpp +++ b/tests/octree/src/ModelTests.cpp @@ -434,12 +434,13 @@ void EntityTests::entityTreeTests(bool verbose) { quint64 totalElapsedFind = 0; for (int i = 0; i < TEST_ITERATIONS; i++) { - QSet entitiesToDelete; + std::vector entitiesToDelete; + entitiesToDelete.reserve(ENTITIES_PER_ITERATION); for (int j = 0; j < ENTITIES_PER_ITERATION; j++) { //uint32_t id = 2 + (i * ENTITIES_PER_ITERATION) + j; // These are the entities we added above QUuid id = QUuid::createUuid();// make sure it doesn't collide with previous entity ids EntityItemID entityID(id); - entitiesToDelete << entityID; + entitiesToDelete.push_back(entityID); } if (extraVerbose) { From 039f7cae13d6066562c5b02a89f8d81e0fc20231 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 18 Oct 2019 14:10:22 -0700 Subject: [PATCH 12/22] avoid Qt container in another spot --- libraries/entities/src/EntityItem.cpp | 6 +-- libraries/entities/src/EntityItem.h | 2 +- .../entities/src/EntityScriptingInterface.cpp | 12 +++--- libraries/entities/src/EntitySimulation.cpp | 5 ++- libraries/entities/src/EntityTree.cpp | 43 ++++++++++++------- libraries/entities/src/EntityTree.h | 4 +- .../physics/src/PhysicalEntitySimulation.cpp | 5 ++- 7 files changed, 44 insertions(+), 33 deletions(-) diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index 58584cc72b..70be7a4d66 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -3235,7 +3235,7 @@ void EntityItem::retrieveMarketplacePublicKey() { }); } -void EntityItem::collectChildrenForDelete(SetOfEntities& entitiesToDelete, const QUuid& sessionID) const { +void EntityItem::collectChildrenForDelete(std::vector& entitiesToDelete, const QUuid& sessionID) const { // Deleting an entity has consequences for its children, however there are rules dictating what can be deleted. // This method helps enforce those rules for the children of entity (not for this entity). for (SpatiallyNestablePointer child : getChildren()) { @@ -3244,8 +3244,8 @@ void EntityItem::collectChildrenForDelete(SetOfEntities& entitiesToDelete, const // NOTE: null sessionID means "collect ALL known entities", else we only collect: local-entities and authorized avatar-entities if (sessionID.isNull() || childEntity->isLocalEntity() || (childEntity->isAvatarEntity() && (childEntity->isMyAvatarEntity() || childEntity->getOwningAvatarID() == sessionID))) { - if (entitiesToDelete.find(childEntity) == entitiesToDelete.end()) { - entitiesToDelete.insert(childEntity); + if (std::find(entitiesToDelete.begin(), entitiesToDelete.end(), childEntity) == entitiesToDelete.end()) { + entitiesToDelete.push_back(childEntity); childEntity->collectChildrenForDelete(entitiesToDelete, sessionID); } } diff --git a/libraries/entities/src/EntityItem.h b/libraries/entities/src/EntityItem.h index 01e63bbd3b..5f56b3a2b8 100644 --- a/libraries/entities/src/EntityItem.h +++ b/libraries/entities/src/EntityItem.h @@ -543,7 +543,7 @@ public: static QString _marketplacePublicKey; static void retrieveMarketplacePublicKey(); - void collectChildrenForDelete(SetOfEntities& entitiesToDelete, const QUuid& sessionID) const; + void collectChildrenForDelete(std::vector& entitiesToDelete, const QUuid& sessionID) const; float getBoundingRadius() const { return _boundingRadius; } void setSpaceIndex(int32_t index); diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index 7299665bd2..944286656e 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -973,7 +973,7 @@ void EntityScriptingInterface::deleteEntity(const QUuid& id) { EntityItemID entityID(id); // If we have a local entity tree set, then also update it. - SetOfEntities entitiesToDeleteImmediately; + std::vector entitiesToDeleteImmediately; _entityTree->withWriteLock([&] { EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID); if (entity) { @@ -989,21 +989,19 @@ void EntityScriptingInterface::deleteEntity(const QUuid& id) { // Local- and my-avatar-entities can be deleted immediately, but other-avatar-entities can't be deleted // by this context, and a domain-entity must rountrip through the entity-server for authorization. if (entity->isDomainEntity()) { - getEntityPacketSender()->queueEraseEntityMessage(entity->getID()); + getEntityPacketSender()->queueEraseEntityMessage(id); } else { - entitiesToDeleteImmediately.insert(entity); + entitiesToDeleteImmediately.push_back(entity); const auto sessionID = DependencyManager::get()->getSessionUUID(); entity->collectChildrenForDelete(entitiesToDeleteImmediately, sessionID); - } - if (!entitiesToDeleteImmediately.empty()) { _entityTree->deleteEntitiesByPointer(entitiesToDeleteImmediately); } } }); - foreach (auto entity, entitiesToDeleteImmediately) { + for (auto entity : entitiesToDeleteImmediately) { if (entity->isMyAvatarEntity()) { - getEntityPacketSender()->getMyAvatar()->clearAvatarEntity(entityID, false); + getEntityPacketSender()->getMyAvatar()->clearAvatarEntity(entity->getID(), false); } } } diff --git a/libraries/entities/src/EntitySimulation.cpp b/libraries/entities/src/EntitySimulation.cpp index c272d16b4d..246a82c88d 100644 --- a/libraries/entities/src/EntitySimulation.cpp +++ b/libraries/entities/src/EntitySimulation.cpp @@ -260,10 +260,11 @@ void EntitySimulation::processDeadEntities() { if (_deadEntitiesToRemoveFromTree.empty()) { return; } - SetOfEntities entitiesToDeleteImmediately; + std::vector entitiesToDeleteImmediately; + entitiesToDeleteImmediately.reserve(_deadEntitiesToRemoveFromTree.size()); QUuid nullSessionID; foreach (auto entity, _deadEntitiesToRemoveFromTree) { - entitiesToDeleteImmediately.insert(entity); + entitiesToDeleteImmediately.push_back(entity); entity->collectChildrenForDelete(entitiesToDeleteImmediately, nullSessionID); } if (_entityTree) { diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index cad25aa61e..94eaceb63e 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -84,7 +84,7 @@ void EntityTree::eraseDomainAndNonOwnedEntities() { emit clearingEntities(); if (_simulation) { - // local entities are not in the simulation, so we clear ALL + // local-entities are not in the simulation, so we clear ALL _simulation->clearEntities(); } @@ -647,11 +647,11 @@ void EntityTree::cleanupCloneIDs(const EntityItemID& entityID) { } } -void EntityTree::recursivelyFilterAndCollectForDelete(const EntityItemPointer& entity, SetOfEntities& entitiesToDelete, bool force) const { +void EntityTree::recursivelyFilterAndCollectForDelete(const EntityItemPointer& entity, std::vector& entitiesToDelete, bool force) const { // tree must be read-locked before calling this method //TODO: assert(treeIsLocked); assert(entity); - if (entity->getElement() && (entitiesToDelete.find(entity) == entitiesToDelete.end())) { + if (entity->getElement() && (std::find(entitiesToDelete.begin(), entitiesToDelete.end(), entity) == entitiesToDelete.end())) { // filter bool allowed = force; if (!allowed) { @@ -663,7 +663,7 @@ void EntityTree::recursivelyFilterAndCollectForDelete(const EntityItemPointer& e _totalFilterTime += endFilter - startFilter; } if (allowed) { - entitiesToDelete.insert(entity); + entitiesToDelete.push_back(entity); for (SpatiallyNestablePointer child : entity->getChildren()) { if (child && child->getNestableType() == NestableType::Entity) { EntityItemPointer childEntity = std::static_pointer_cast(child); @@ -680,7 +680,8 @@ void EntityTree::deleteEntitiesByID(const std::vector& ids, bool f // (b) interface-client: deletes local- and my-avatar-entities immediately, submits domainEntity deletes to the entity-server if (getIsServer()) { withWriteLock([&] { - SetOfEntities entitiesToDelete; + std::vector entitiesToDelete; + entitiesToDelete.reserve(ids.size()); for (auto id : ids) { EntityItemPointer entity; { @@ -696,7 +697,9 @@ void EntityTree::deleteEntitiesByID(const std::vector& ids, bool f } }); } else { - SetOfEntities entitiesToDelete; + std::vector domainEntitiesIDs; + std::vector entitiesToDelete; + entitiesToDelete.reserve(ids.size()); QUuid sessionID = DependencyManager::get()->getSessionUUID(); withWriteLock([&] { for (auto id : ids) { @@ -707,11 +710,10 @@ void EntityTree::deleteEntitiesByID(const std::vector& ids, bool f } if (entity) { if (entity->isDomainEntity()) { - if (_simulation) { - _simulation->queueEraseDomainEntity(entity->getID()); - } + // domain-entity deletes must round-trip through entity-server + domainEntitiesIDs.push_back(id); } else if (force || entity->isLocalEntity() || entity->isMyAvatarEntity()) { - entitiesToDelete.insert(entity); + entitiesToDelete.push_back(entity); entity->collectChildrenForDelete(entitiesToDelete, sessionID); } } @@ -720,10 +722,15 @@ void EntityTree::deleteEntitiesByID(const std::vector& ids, bool f deleteEntitiesByPointer(entitiesToDelete); } }); + if (!domainEntitiesIDs.empty() && _simulation) { + for (auto id : domainEntitiesIDs) { + _simulation->queueEraseDomainEntity(id); + } + } } } -void EntityTree::deleteEntitiesByPointer(const SetOfEntities& entities) { +void EntityTree::deleteEntitiesByPointer(const std::vector& entities) { // tree must be write-locked before calling this method //TODO: assert(treeIsLocked); // NOTE: there is no entity validation (i.e. is entity in tree?) nor snarfing of children beyond this point. @@ -2398,25 +2405,28 @@ int EntityTree::processEraseMessage(ReceivedMessage& message, const SharedNodePo // domain-entity deletion can trigger deletion of other entities the entity-server doesn't know about // so we must recurse down the children and collect consequential deletes however // we must first identify all domain-entities in idsToDelete so as to not overstep entity-server's authority - SetOfEntities domainEntities; + std::vector domainEntities; + domainEntities.reserve(idsToDelete.size()); for (auto id : idsToDelete) { EntityItemPointer entity = _entityMap.value(id); if (entity && entity->isDomainEntity()) { - domainEntities.insert(entity); + domainEntities.push_back(entity); } } // now we recurse domain-entities children and snarf consequential entities + // which are nomally just local-entities and myAvatar-entities auto nodeList = DependencyManager::get(); QUuid sessionID = nodeList->getSessionUUID(); // NOTE: normally a null sessionID would be bad, as that would cause the collectDhildrenForDelete() method below - // to snarf domain entities for which the interface-client is not authorized to delete without explicit instructions + // to snarf domain-entities for which the interface-client is not authorized to delete without explicit instructions // from the entity-server, however it is ok here because that would mean: // (a) interface-client is not connected to a domain which means... // (b) we should never get here (since this would correspond to a message from the entity-server) but... // (c) who cares? When not connected to a domain the interface-client can do whatever it wants. - SetOfEntities entitiesToDelete; + std::vector entitiesToDelete; + entitiesToDelete.reserve(domainEntities.size()); for (auto entity : domainEntities) { - entitiesToDelete.insert(entity); + entitiesToDelete.push_back(entity); entity->collectChildrenForDelete(entitiesToDelete, sessionID); } @@ -2431,6 +2441,7 @@ int EntityTree::processEraseMessage(ReceivedMessage& message, const SharedNodePo // This version skips over the header // NOTE: Caller must write-lock the tree before calling this. int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, const SharedNodePointer& sourceNode) { + // NOTE: this is called on entity-server when receiving a delete request from an interface-client or agent //TODO: assert(treeIsLocked); assert(getIsServer()); #ifdef EXTRA_ERASE_DEBUGGING diff --git a/libraries/entities/src/EntityTree.h b/libraries/entities/src/EntityTree.h index dc26b0a9ce..7b84e40ddd 100644 --- a/libraries/entities/src/EntityTree.h +++ b/libraries/entities/src/EntityTree.h @@ -128,7 +128,7 @@ public: void deleteEntity(const EntityItemID& entityID, bool force = false, bool ignoreWarnings = true); void deleteEntitiesByID(const std::vector& entityIDs, bool force = false, bool ignoreWarnings = true); - void deleteEntitiesByPointer(const SetOfEntities& entities); + void deleteEntitiesByPointer(const std::vector& entities); EntityItemPointer findEntityByID(const QUuid& id) const; EntityItemPointer findEntityByEntityItemID(const EntityItemID& entityID) const; @@ -293,7 +293,7 @@ signals: protected: - void recursivelyFilterAndCollectForDelete(const EntityItemPointer& entity, SetOfEntities& entitiesToDelete, bool force) const; + void recursivelyFilterAndCollectForDelete(const EntityItemPointer& entity, std::vector& entitiesToDelete, bool force) const; void processRemovedEntities(const DeleteEntityOperator& theOperator); bool updateEntity(EntityItemPointer entity, const EntityItemProperties& properties, const SharedNodePointer& senderNode = SharedNodePointer(nullptr)); diff --git a/libraries/physics/src/PhysicalEntitySimulation.cpp b/libraries/physics/src/PhysicalEntitySimulation.cpp index d83708b2a2..b5ba65a098 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.cpp +++ b/libraries/physics/src/PhysicalEntitySimulation.cpp @@ -175,7 +175,8 @@ void PhysicalEntitySimulation::processDeadEntities() { return; } PROFILE_RANGE(simulation_physics, "Deletes"); - SetOfEntities entitiesToDeleteImmediately; + std::vector entitiesToDeleteImmediately; + entitiesToDeleteImmediately.reserve(_deadEntitiesToRemoveFromTree.size()); QUuid sessionID = Physics::getSessionUUID(); QMutexLocker lock(&_mutex); for (auto entity : _deadEntitiesToRemoveFromTree) { @@ -187,7 +188,7 @@ void PhysicalEntitySimulation::processDeadEntities() { // interface-client can't delete domainEntities outright, they must roundtrip through the entity-server _entityPacketSender->queueEraseEntityMessage(entity->getID()); } else if (entity->isLocalEntity() || entity->isMyAvatarEntity()) { - entitiesToDeleteImmediately.insert(entity); + entitiesToDeleteImmediately.push_back(entity); entity->collectChildrenForDelete(entitiesToDeleteImmediately, sessionID); } } From 0f2d9027e16558225ef4e163aa0d04b4c52a8043 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 28 Oct 2019 08:19:14 -0700 Subject: [PATCH 13/22] fix indentation --- libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp index 01cc86f8b5..0ca3362be7 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp @@ -343,7 +343,7 @@ void Avatar::removeAvatarEntitiesFromTree() { _avatarEntitiesLock.withReadLock([&] { avatarEntityIDs = _packedAvatarEntityData.keys(); }); - std::vector ids; + std::vector ids; ids.reserve(avatarEntityIDs.size()); foreach (auto id, avatarEntityIDs) { ids.push_back(id); From de44cdaf25460c74d2ccf4f9777c3ed7d60a9b18 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 13 Nov 2019 15:27:05 -0800 Subject: [PATCH 14/22] remove unnecessary check in if clause --- libraries/entities/src/EntityTree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 94eaceb63e..fed9090ddb 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -658,7 +658,7 @@ void EntityTree::recursivelyFilterAndCollectForDelete(const EntityItemPointer& e bool wasChanged = false; auto startFilter = usecTimestampNow(); EntityItemProperties dummyProperties; - allowed = force || filterProperties(entity, dummyProperties, dummyProperties, wasChanged, FilterType::Delete); + allowed = filterProperties(entity, dummyProperties, dummyProperties, wasChanged, FilterType::Delete); auto endFilter = usecTimestampNow(); _totalFilterTime += endFilter - startFilter; } From 28f51f6204d3a496dfe783d1da6db1dc9fce53e8 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 13 Nov 2019 15:27:17 -0800 Subject: [PATCH 15/22] add comments --- libraries/entities/src/EntitySimulation.cpp | 2 ++ libraries/physics/src/PhysicalEntitySimulation.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libraries/entities/src/EntitySimulation.cpp b/libraries/entities/src/EntitySimulation.cpp index 246a82c88d..c7eb906efb 100644 --- a/libraries/entities/src/EntitySimulation.cpp +++ b/libraries/entities/src/EntitySimulation.cpp @@ -43,6 +43,7 @@ void EntitySimulation::updateEntities() { } void EntitySimulation::removeEntityFromInternalLists(EntityItemPointer entity) { + // protected: _mutex lock is guaranteed // remove from all internal lists except _deadEntitiesToRemoveFromTree _entitiesToSort.remove(entity); _simpleKinematicEntities.remove(entity); @@ -144,6 +145,7 @@ void EntitySimulation::sortEntitiesThatMoved() { } void EntitySimulation::addEntityToInternalLists(EntityItemPointer entity) { + // protected: _mutex lock is guaranteed if (entity->isMortal()) { _mortalEntities.insert(entity); uint64_t expiry = entity->getExpiry(); diff --git a/libraries/physics/src/PhysicalEntitySimulation.cpp b/libraries/physics/src/PhysicalEntitySimulation.cpp index b5ba65a098..4a2ee9184f 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.cpp +++ b/libraries/physics/src/PhysicalEntitySimulation.cpp @@ -171,6 +171,8 @@ void PhysicalEntitySimulation::processChangedEntity(const EntityItemPointer& ent } void PhysicalEntitySimulation::processDeadEntities() { + // Note: this override is a complete rewite of the base class's method because we cannot assume all entities + // are domain entities, and the consequence of trying to delete a domain-entity in this case is very different. if (_deadEntitiesToRemoveFromTree.empty()) { return; } From b231dadba5066ca204fb3fa94b04852e4625abf5 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 13 Nov 2019 15:27:47 -0800 Subject: [PATCH 16/22] add check for local-entity when changing phys properties --- libraries/entities/src/EntityScriptingInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index 944286656e..9f0174e33d 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -821,7 +821,7 @@ QUuid EntityScriptingInterface::editEntity(const QUuid& id, const EntityItemProp // flag for simulation ownership, or upgrade existing ownership priority // (actual bids for simulation ownership are sent by the PhysicalEntitySimulation) entity->upgradeScriptSimulationPriority(properties.computeSimulationBidPriority()); - if (entity->isMyAvatarEntity() || simulationOwner.getID() == sessionID) { + if (entity->isLocalEntity() || entity->isMyAvatarEntity() || simulationOwner.getID() == sessionID) { // we own the simulation --> copy ALL restricted properties properties.copySimulationRestrictedProperties(entity); } else { From b5ca93a0194d0f6a51bdbd6cc43b880cf8362956 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 13 Nov 2019 15:28:16 -0800 Subject: [PATCH 17/22] remove redundant checks in 'if' clause --- libraries/entities/src/EntityItem.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index 70be7a4d66..2a0fb893cf 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -3237,13 +3237,12 @@ void EntityItem::retrieveMarketplacePublicKey() { void EntityItem::collectChildrenForDelete(std::vector& entitiesToDelete, const QUuid& sessionID) const { // Deleting an entity has consequences for its children, however there are rules dictating what can be deleted. - // This method helps enforce those rules for the children of entity (not for this entity). + // This method helps enforce those rules: not for this entity, but for its children. for (SpatiallyNestablePointer child : getChildren()) { if (child && child->getNestableType() == NestableType::Entity) { EntityItemPointer childEntity = std::static_pointer_cast(child); - // NOTE: null sessionID means "collect ALL known entities", else we only collect: local-entities and authorized avatar-entities - if (sessionID.isNull() || childEntity->isLocalEntity() || (childEntity->isAvatarEntity() && - (childEntity->isMyAvatarEntity() || childEntity->getOwningAvatarID() == sessionID))) { + // NOTE: null sessionID means "collect ALL known children", else we only collect: local-entities and myAvatar-entities + if (sessionID.isNull() || childEntity->isLocalEntity() || childEntity->isMyAvatarEntity()) { if (std::find(entitiesToDelete.begin(), entitiesToDelete.end(), childEntity) == entitiesToDelete.end()) { entitiesToDelete.push_back(childEntity); childEntity->collectChildrenForDelete(entitiesToDelete, sessionID); @@ -3417,7 +3416,7 @@ void EntityItem::prepareForSimulationOwnershipBid(EntityItemProperties& properti properties.setSimulationOwner(Physics::getSessionUUID(), priority); setPendingOwnershipPriority(priority); - // ANDREW TODO: figure out if it would be OK to NOT bother set these properties here + // TODO: figure out if it would be OK to NOT bother set these properties here properties.setEntityHostType(getEntityHostType()); properties.setOwningAvatarID(getOwningAvatarID()); setLastBroadcast(now); // for debug/physics status icons From dbeea4038d483434ab89ceab49daa2fd9780eb59 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 13 Nov 2019 15:29:14 -0800 Subject: [PATCH 18/22] remove unused argument --- libraries/entities-renderer/src/EntityTreeRenderer.cpp | 5 ++--- libraries/entities-renderer/src/EntityTreeRenderer.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index fa18783b98..58499e07b6 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -260,8 +260,7 @@ void EntityTreeRenderer::clearDomainAndNonOwnedEntities() { _renderablesToUpdate = savedRenderables; _entitiesInScene = savedEntities; - auto sessionUUID = getTree()->getMyAvatarSessionUUID(); - if (_layeredZones.clearDomainAndNonOwnedZones(sessionUUID)) { + if (_layeredZones.clearDomainAndNonOwnedZones()) { applyLayeredZones(); } @@ -1215,7 +1214,7 @@ void EntityTreeRenderer::updateZone(const EntityItemID& id) { } } -bool EntityTreeRenderer::LayeredZones::clearDomainAndNonOwnedZones(const QUuid& sessionUUID) { +bool EntityTreeRenderer::LayeredZones::clearDomainAndNonOwnedZones() { bool zonesChanged = false; auto it = begin(); diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.h b/libraries/entities-renderer/src/EntityTreeRenderer.h index 6a5152b219..1deadc254e 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.h +++ b/libraries/entities-renderer/src/EntityTreeRenderer.h @@ -230,7 +230,7 @@ private: class LayeredZones : public std::vector { public: - bool clearDomainAndNonOwnedZones(const QUuid& sessionUUID); + bool clearDomainAndNonOwnedZones(); void sort() { std::sort(begin(), end(), std::less()); } bool equals(const LayeredZones& other) const; From 9dd0105ba5f2a2483a872ed9eea518a430e9649f Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 13 Nov 2019 15:29:48 -0800 Subject: [PATCH 19/22] only one copy of entityIDs instead of two --- .../avatars-renderer/src/avatars-renderer/Avatar.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp index 0ca3362be7..8a57740857 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp @@ -339,14 +339,12 @@ void Avatar::removeAvatarEntitiesFromTree() { auto treeRenderer = DependencyManager::get(); EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr; if (entityTree) { - QList avatarEntityIDs; - _avatarEntitiesLock.withReadLock([&] { - avatarEntityIDs = _packedAvatarEntityData.keys(); - }); std::vector ids; - ids.reserve(avatarEntityIDs.size()); - foreach (auto id, avatarEntityIDs) { - ids.push_back(id); + ids.reserve(_packedAvatarEntityData.size()); + PackedAvatarEntityMap::const_iterator itr = _packedAvatarEntityData.constBegin(); + while (itr != _packedAvatarEntityData.constEnd()) { + ids.push_back(itr.key()); + ++itr; } bool force = true; bool ignoreWarnings = true; From 7692e858a10e4189f8ee68520fe52bfbb7893ba3 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 13 Nov 2019 15:30:16 -0800 Subject: [PATCH 20/22] use EntityItemID rather than QUuid --- interface/src/avatar/MyAvatar.cpp | 54 ++++++++++++------------------- interface/src/avatar/MyAvatar.h | 14 ++++---- 2 files changed, 27 insertions(+), 41 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 667c315121..503a404000 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1587,24 +1587,20 @@ void MyAvatar::handleChangedAvatarEntityData() { // AvatarData::_packedAvatarEntityData via deeper logic. // move the lists to minimize lock time - std::vector cachedBlobsToDelete; - std::vector cachedBlobsToUpdate; - std::vector idsToDelete; - idsToDelete.reserve(_entitiesToDelete.size()); - std::vector entitiesToAdd; - std::vector entitiesToUpdate; + std::vector cachedBlobsToDelete; + std::vector cachedBlobsToUpdate; + std::vector entitiesToDelete; + std::vector entitiesToAdd; + std::vector entitiesToUpdate; _avatarEntitiesLock.withWriteLock([&] { - cachedBlobsToDelete = std::move(_cachedAvatarEntityBlobsToDelete); - cachedBlobsToUpdate = std::move(_cachedAvatarEntityBlobsToAddOrUpdate); - foreach (auto id, _entitiesToDelete) { - idsToDelete.push_back(id); - } - _entitiesToDelete.clear(); - entitiesToAdd = std::move(_entitiesToAdd); - entitiesToUpdate = std::move(_entitiesToUpdate); + cachedBlobsToDelete.swap(_cachedAvatarEntityBlobsToDelete); + cachedBlobsToUpdate.swap(_cachedAvatarEntityBlobsToAddOrUpdate); + entitiesToDelete.swap(_entitiesToDelete); + entitiesToAdd.swap(_entitiesToAdd); + entitiesToUpdate.swap(_entitiesToUpdate); }); - auto removeAllInstancesHelper = [] (const QUuid& id, std::vector& v) { + auto removeAllInstancesHelper = [] (const EntityItemID& id, std::vector& v) { uint32_t i = 0; while (i < v.size()) { if (id == v[i]) { @@ -1617,7 +1613,7 @@ void MyAvatar::handleChangedAvatarEntityData() { }; // remove delete-add and delete-update overlap - for (const auto& id : idsToDelete) { + for (const auto& id : entitiesToDelete) { removeAllInstancesHelper(id, cachedBlobsToUpdate); removeAllInstancesHelper(id, entitiesToAdd); removeAllInstancesHelper(id, entitiesToUpdate); @@ -1631,9 +1627,7 @@ void MyAvatar::handleChangedAvatarEntityData() { } // DELETE real entities - entityTree->withWriteLock([&] { - entityTree->deleteEntitiesByID(idsToDelete); - }); + entityTree->deleteEntitiesByID(entitiesToDelete); // ADD real entities EntityEditPacketSender* packetSender = qApp->getEntityEditPacketSender(); @@ -1704,7 +1698,7 @@ void MyAvatar::handleChangedAvatarEntityData() { _needToSaveAvatarEntitySettings = true; } // also remove from list of stale blobs to avoid failed entity lookup later - std::set::iterator blobItr = _staleCachedAvatarEntityBlobs.find(id); + std::set::iterator blobItr = _staleCachedAvatarEntityBlobs.find(id); if (blobItr != _staleCachedAvatarEntityBlobs.end()) { _staleCachedAvatarEntityBlobs.erase(blobItr); } @@ -1746,7 +1740,7 @@ void MyAvatar::handleChangedAvatarEntityData() { // we have a client traits handler // flag removed entities as deleted so that changes are sent next frame _avatarEntitiesLock.withWriteLock([&] { - for (const auto& id : idsToDelete) { + for (const auto& id : entitiesToDelete) { if (_packedAvatarEntityData.find(id) != _packedAvatarEntityData.end()) { _clientTraitsHandler->markInstancedTraitDeleted(AvatarTraits::AvatarEntity, id); } @@ -1772,9 +1766,9 @@ bool MyAvatar::updateStaleAvatarEntityBlobs() const { return false; } - std::set staleBlobs = std::move(_staleCachedAvatarEntityBlobs); + std::set staleIDs = std::move(_staleCachedAvatarEntityBlobs); int32_t numFound = 0; - for (const auto& id : staleBlobs) { + for (const auto& id : staleIDs) { bool found = false; EntityItemProperties properties; entityTree->withReadLock([&] { @@ -1859,7 +1853,7 @@ void MyAvatar::setAvatarEntityData(const AvatarEntityMap& avatarEntityData) { ++constItr; } // find and erase deleted IDs from _cachedAvatarEntityBlobs - std::vector deletedIDs; + std::vector deletedIDs; AvatarEntityMap::iterator itr = _cachedAvatarEntityBlobs.begin(); while (itr != _cachedAvatarEntityBlobs.end()) { QUuid id = itr.key(); @@ -2491,16 +2485,8 @@ void MyAvatar::clearWornAvatarEntities() { _avatarEntitiesLock.withReadLock([&] { avatarEntityIDs = _packedAvatarEntityData.keys(); }); - auto treeRenderer = DependencyManager::get(); - EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr; - if (entityTree) { - for (auto entityID : avatarEntityIDs) { - auto entity = entityTree->findEntityByID(entityID); - if (entity && isWearableEntity(entity)) { - treeRenderer->deleteEntity(entityID); - clearAvatarEntity(entityID); - } - } + for (auto entityID : avatarEntityIDs) { + removeWornAvatarEntity(entityID); } } diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 5a59e6129a..cac9f54be5 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -2970,19 +2970,19 @@ private: // correctly stored in _cachedAvatarEntityBlobs. These come from loadAvatarEntityDataFromSettings() and // setAvatarEntityData(). These changes need to be extracted from _cachedAvatarEntityBlobs and applied to // real EntityItems. - std::vector _entitiesToDelete; - std::vector _entitiesToAdd; - std::vector _entitiesToUpdate; + std::vector _entitiesToDelete; + std::vector _entitiesToAdd; + std::vector _entitiesToUpdate; // // The _cachedAvatarEntityBlobsToDelete/Add/Update lists are for changes whose "authoritative sources" are // already reflected in real EntityItems. These changes need to be propagated to _cachedAvatarEntityBlobs // and eventually to settings. - std::vector _cachedAvatarEntityBlobsToDelete; - std::vector _cachedAvatarEntityBlobsToAddOrUpdate; - std::vector _cachedAvatarEntityBlobUpdatesToSkip; + std::vector _cachedAvatarEntityBlobsToDelete; + std::vector _cachedAvatarEntityBlobsToAddOrUpdate; + std::vector _cachedAvatarEntityBlobUpdatesToSkip; // // Also these lists for tracking delayed changes to blobs and Settings - mutable std::set _staleCachedAvatarEntityBlobs; + mutable std::set _staleCachedAvatarEntityBlobs; // // keep a ScriptEngine around so we don't have to instantiate on the fly (these are very slow to create/delete) mutable std::mutex _scriptEngineLock; From ec872bfcf84929b2fbdb2b9352dc12cf21fe6b8a Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 14 Nov 2019 08:12:39 -0800 Subject: [PATCH 21/22] remove unused variable --- libraries/entities/src/EntityScriptingInterface.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index 9f0174e33d..d68747b96c 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -1649,12 +1649,9 @@ bool EntityScriptingInterface::actionWorker(const QUuid& entityID, return false; } - auto nodeList = DependencyManager::get(); - const QUuid myNodeID = nodeList->getSessionUUID(); - EntityItemPointer entity; bool doTransmit = false; - _entityTree->withWriteLock([this, &entity, entityID, myNodeID, &doTransmit, actor] { + _entityTree->withWriteLock([this, &entity, entityID, &doTransmit, actor] { EntitySimulationPointer simulation = _entityTree->getSimulation(); entity = _entityTree->findEntityByEntityItemID(entityID); if (!entity) { From 5229b0c0f3bc97dcd1239198f60620fab67486bb Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 14 Nov 2019 15:45:52 -0800 Subject: [PATCH 22/22] Various cleanup and CR --- interface/src/Application.cpp | 4 --- .../scripting/ScreenshareScriptingInterface.h | 4 +-- screenshare/src/screenshareApp.html | 15 --------- screenshare/src/screenshareApp.js | 33 ++++++++++--------- screenshare/src/screenshareMainProcess.js | 10 +++--- screenshare/src/styles.css | 4 --- 6 files changed, 24 insertions(+), 46 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index f62196323d..28e3368b30 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -889,10 +889,6 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { DependencyManager::set(); DependencyManager::set(); DependencyManager::set(); - -#ifdef HAVE_DDE - DependencyManager::set(); -#endif DependencyManager::set(); DependencyManager::set(); DependencyManager::set(); diff --git a/interface/src/scripting/ScreenshareScriptingInterface.h b/interface/src/scripting/ScreenshareScriptingInterface.h index d64daa6c6b..432f730e28 100644 --- a/interface/src/scripting/ScreenshareScriptingInterface.h +++ b/interface/src/scripting/ScreenshareScriptingInterface.h @@ -22,10 +22,10 @@ class ScreenshareScriptingInterface : public QObject, public Dependency { Q_OBJECT public: - ScreenshareScriptingInterface(); + ScreenshareScriptingInterface(); ~ScreenshareScriptingInterface(); - Q_INVOKABLE void startScreenshare(const QUuid& screenshareZoneID, const QUuid& smartboardEntityID, const bool& isPresenter = false); + Q_INVOKABLE void startScreenshare(const QUuid& screenshareZoneID, const QUuid& smartboardEntityID, const bool& isPresenter = false); Q_INVOKABLE void stopScreenshare(); signals: diff --git a/screenshare/src/screenshareApp.html b/screenshare/src/screenshareApp.html index ed722f7fde..c647bd58a3 100644 --- a/screenshare/src/screenshareApp.html +++ b/screenshare/src/screenshareApp.html @@ -1,5 +1,4 @@ @@ -23,26 +21,13 @@ See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.
-
- - - - - - - - - -
-