mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
Merge branch 'master' into Anim_memory_reduction
This commit is contained in:
commit
a5118d8a31
12 changed files with 99 additions and 9 deletions
|
@ -74,6 +74,7 @@
|
|||
#include <Midi.h>
|
||||
#include <AudioInjectorManager.h>
|
||||
#include <AvatarBookmarks.h>
|
||||
#include <CrashHelpers.h>
|
||||
#include <CursorManager.h>
|
||||
#include <VirtualPadManager.h>
|
||||
#include <DebugDraw.h>
|
||||
|
@ -2679,6 +2680,8 @@ void Application::updateHeartbeat() const {
|
|||
}
|
||||
|
||||
void Application::onAboutToQuit() {
|
||||
setCrashAnnotation("shutdown", "1");
|
||||
|
||||
// quickly save AvatarEntityData before the EntityTree is dismantled
|
||||
getMyAvatar()->saveAvatarEntityDataToSettings();
|
||||
|
||||
|
@ -2717,6 +2720,11 @@ void Application::onAboutToQuit() {
|
|||
|
||||
cleanupBeforeQuit();
|
||||
|
||||
if (_crashOnShutdown) {
|
||||
// triggered by crash menu
|
||||
crash::nullDeref();
|
||||
}
|
||||
|
||||
getRefreshRateManager().setRefreshRateRegime(RefreshRateManager::RefreshRateRegime::SHUTDOWN);
|
||||
}
|
||||
|
||||
|
@ -9527,6 +9535,14 @@ void Application::showUrlHandler(const QUrl& url) {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
// used to test "shutdown" crash annotation.
|
||||
void Application::crashOnShutdown() {
|
||||
qDebug() << "crashOnShutdown(), ON PURPOSE!";
|
||||
_crashOnShutdown = true;
|
||||
quit();
|
||||
}
|
||||
|
||||
void Application::overrideEntry(){
|
||||
_overrideEntry = true;
|
||||
}
|
||||
|
|
|
@ -497,6 +497,9 @@ public slots:
|
|||
bool gpuTextureMemSizeStable();
|
||||
void showUrlHandler(const QUrl& url);
|
||||
|
||||
// used to test "shutdown" crash annotation.
|
||||
void crashOnShutdown();
|
||||
|
||||
private slots:
|
||||
void onDesktopRootItemCreated(QQuickItem* qmlContext);
|
||||
void onDesktopRootContextCreated(QQmlContext* qmlContext);
|
||||
|
@ -844,5 +847,7 @@ private:
|
|||
bool _overrideEntry { false };
|
||||
|
||||
VisionSqueeze _visionSqueeze;
|
||||
|
||||
bool _crashOnShutdown { false };
|
||||
};
|
||||
#endif // hifi_Application_h
|
||||
|
|
|
@ -763,6 +763,8 @@ Menu::Menu() {
|
|||
action = addActionToQMenuAndActionHash(crashMenu, MenuOption::CrashNewFaultThreaded);
|
||||
connect(action, &QAction::triggered, qApp, []() { std::thread(crash::newFault).join(); });
|
||||
|
||||
addActionToQMenuAndActionHash(crashMenu, MenuOption::CrashOnShutdown, 0, qApp, SLOT(crashOnShutdown()));
|
||||
|
||||
// Developer > Show Statistics
|
||||
addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::Stats, 0, true);
|
||||
|
||||
|
|
|
@ -72,6 +72,7 @@ namespace MenuOption {
|
|||
const QString CrashNullDereferenceThreaded = "Null Dereference (threaded)";
|
||||
const QString CrashAbort = "Abort";
|
||||
const QString CrashAbortThreaded = "Abort (threaded)";
|
||||
const QString CrashOnShutdown = "Crash During Shutdown";
|
||||
const QString CrashOutOfBoundsVectorAccess = "Out of Bounds Vector Access";
|
||||
const QString CrashOutOfBoundsVectorAccessThreaded = "Out of Bounds Vector Access (threaded)";
|
||||
const QString CrashNewFault = "New Fault";
|
||||
|
|
|
@ -60,6 +60,13 @@ void AnimNode::setCurrentFrame(float frame) {
|
|||
}
|
||||
}
|
||||
|
||||
void AnimNode::setActive(bool active) {
|
||||
setActiveInternal(active);
|
||||
for (auto&& child : _children) {
|
||||
child->setActiveInternal(active);
|
||||
}
|
||||
}
|
||||
|
||||
void AnimNode::processOutputJoints(AnimVariantMap& triggersOut) const {
|
||||
if (!_skeleton) {
|
||||
return;
|
||||
|
|
|
@ -73,6 +73,7 @@ public:
|
|||
}
|
||||
|
||||
void setCurrentFrame(float frame);
|
||||
void setActive(bool active);
|
||||
|
||||
template <typename F>
|
||||
bool traverse(F func) {
|
||||
|
@ -104,6 +105,7 @@ protected:
|
|||
|
||||
virtual void setCurrentFrameInternal(float frame) {}
|
||||
virtual void setSkeletonInternal(AnimSkeleton::ConstPointer skeleton) { _skeleton = skeleton; }
|
||||
virtual void setActiveInternal(bool active) {}
|
||||
|
||||
// for AnimDebugDraw rendering
|
||||
virtual const AnimPoseVec& getPosesInternal() const = 0;
|
||||
|
@ -116,6 +118,7 @@ protected:
|
|||
AnimSkeleton::ConstPointer _skeleton;
|
||||
std::weak_ptr<AnimNode> _parent;
|
||||
std::vector<QString> _outputJointNames;
|
||||
bool _active { false };
|
||||
|
||||
// no copies
|
||||
AnimNode(const AnimNode&) = delete;
|
||||
|
|
|
@ -21,12 +21,16 @@ AnimRandomSwitch::~AnimRandomSwitch() {
|
|||
|
||||
}
|
||||
|
||||
void AnimRandomSwitch::setActiveInternal(bool active) {
|
||||
_active = active;
|
||||
_triggerNewRandomState = active;
|
||||
}
|
||||
|
||||
const AnimPoseVec& AnimRandomSwitch::evaluate(const AnimVariantMap& animVars, const AnimContext& context, float dt, AnimVariantMap& triggersOut) {
|
||||
float parentDebugAlpha = context.getDebugAlpha(_id);
|
||||
|
||||
AnimRandomSwitch::RandomSwitchState::Pointer desiredState = _currentState;
|
||||
if (abs(_randomSwitchEvaluationCount - context.getEvaluationCount()) > 1 || animVars.lookup(_triggerRandomSwitchVar, false)) {
|
||||
|
||||
if (_triggerNewRandomState || animVars.lookup(_triggerRandomSwitchVar, false)) {
|
||||
// filter states different to the last random state and with priorities.
|
||||
bool currentStateHasPriority = false;
|
||||
std::vector<RandomSwitchState::Pointer> randomStatesToConsider;
|
||||
|
@ -56,8 +60,9 @@ const AnimPoseVec& AnimRandomSwitch::evaluate(const AnimVariantMap& animVars, co
|
|||
}
|
||||
lowerBound = upperBound;
|
||||
}
|
||||
if (abs(_randomSwitchEvaluationCount - context.getEvaluationCount()) > 1) {
|
||||
if (_triggerNewRandomState) {
|
||||
switchRandomState(animVars, context, desiredState, false);
|
||||
_triggerNewRandomState = false;
|
||||
} else {
|
||||
// firing a random switch, be sure that we aren't completing a previously triggered transition
|
||||
if (currentStateHasPriority) {
|
||||
|
@ -70,7 +75,6 @@ const AnimPoseVec& AnimRandomSwitch::evaluate(const AnimVariantMap& animVars, co
|
|||
}
|
||||
_triggerTime = randFloatInRange(_triggerTimeMin, _triggerTimeMax);
|
||||
_randomSwitchTime = randFloatInRange(_randomSwitchTimeMin, _randomSwitchTimeMax);
|
||||
|
||||
} else {
|
||||
|
||||
// here we are checking to see if we want a temporary movement
|
||||
|
@ -143,7 +147,6 @@ const AnimPoseVec& AnimRandomSwitch::evaluate(const AnimVariantMap& animVars, co
|
|||
_poses = currentStateNode->evaluate(animVars, context, dt, triggersOut);
|
||||
}
|
||||
|
||||
_randomSwitchEvaluationCount = context.getEvaluationCount();
|
||||
processOutputJoints(triggersOut);
|
||||
|
||||
context.addStateMachineInfo(_id, _currentState->getID(), _previousState->getID(), _duringInterp, _alpha);
|
||||
|
@ -165,8 +168,16 @@ void AnimRandomSwitch::addState(RandomSwitchState::Pointer randomState) {
|
|||
}
|
||||
|
||||
void AnimRandomSwitch::switchRandomState(const AnimVariantMap& animVars, const AnimContext& context, RandomSwitchState::Pointer desiredState, bool shouldInterp) {
|
||||
|
||||
auto prevStateNode = _children[_currentState->getChildIndex()];
|
||||
auto nextStateNode = _children[desiredState->getChildIndex()];
|
||||
|
||||
// activate/deactivate states
|
||||
prevStateNode->setActive(false);
|
||||
nextStateNode->setActive(true);
|
||||
|
||||
_lastPlayedState = nextStateNode->getID();
|
||||
|
||||
if (shouldInterp) {
|
||||
|
||||
bool interpActive = _duringInterp;
|
||||
|
|
|
@ -151,10 +151,11 @@ protected:
|
|||
|
||||
// for AnimDebugDraw rendering
|
||||
virtual const AnimPoseVec& getPosesInternal() const override;
|
||||
virtual void setActiveInternal(bool active) override;
|
||||
|
||||
AnimPoseVec _poses;
|
||||
|
||||
int _randomSwitchEvaluationCount { 0 };
|
||||
bool _triggerNewRandomState = false;
|
||||
// interpolation state
|
||||
bool _duringInterp = false;
|
||||
InterpType _interpType { InterpType::SnapshotPrev };
|
||||
|
|
|
@ -128,6 +128,10 @@ void AnimStateMachine::switchState(const AnimVariantMap& animVars, const AnimCon
|
|||
auto prevStateNode = _children[_currentState->getChildIndex()];
|
||||
auto nextStateNode = _children[desiredState->getChildIndex()];
|
||||
|
||||
// activate/deactivate states
|
||||
prevStateNode->setActive(false);
|
||||
nextStateNode->setActive(true);
|
||||
|
||||
bool interpActive = _duringInterp;
|
||||
_duringInterp = true;
|
||||
_alpha = 0.0f;
|
||||
|
|
|
@ -78,13 +78,16 @@ TreeNodeBase* ScriptsModel::getTreeNodeFromIndex(const QModelIndex& index) const
|
|||
}
|
||||
|
||||
QModelIndex ScriptsModel::index(int row, int column, const QModelIndex& parent) const {
|
||||
if (row < 0 || column < 0) {
|
||||
if (row < 0 || row >= rowCount(parent) || column < 0 || column >= columnCount(parent)) {
|
||||
return QModelIndex();
|
||||
}
|
||||
return createIndex(row, column, getFolderNodes(static_cast<TreeNodeFolder*>(getTreeNodeFromIndex(parent))).at(row));
|
||||
}
|
||||
|
||||
QModelIndex ScriptsModel::parent(const QModelIndex& child) const {
|
||||
if (!child.isValid()) {
|
||||
return QModelIndex();
|
||||
}
|
||||
TreeNodeFolder* parent = (static_cast<TreeNodeBase*>(child.internalPointer()))->getParent();
|
||||
if (!parent) {
|
||||
return QModelIndex();
|
||||
|
|
|
@ -139,6 +139,28 @@ Rectangle {
|
|||
opacity: emoteIndicator.source.toString().indexOf("Icon.svg") > -1 ? 1.0 : 0.0
|
||||
}
|
||||
|
||||
Image {
|
||||
id: lockIcon
|
||||
width: 12
|
||||
height: 12
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 2
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 0
|
||||
source: "images/lock_Icon.svg"
|
||||
fillMode: Image.PreserveAspectFit
|
||||
mipmap: true
|
||||
visible: false
|
||||
}
|
||||
|
||||
ColorOverlay {
|
||||
id: lockIconColorOverlay
|
||||
anchors.fill: lockIcon
|
||||
source: lockIcon
|
||||
color: "#ffffff"
|
||||
visible: drawerContainer.keepDrawerExpanded
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: emoteIndicatorMouseArea
|
||||
anchors.fill: parent
|
||||
|
@ -147,14 +169,21 @@ Rectangle {
|
|||
onClicked: {
|
||||
Tablet.playSound(TabletEnums.ButtonClick);
|
||||
drawerContainer.keepDrawerExpanded = !drawerContainer.keepDrawerExpanded;
|
||||
// If the drawer is no longer expanded, disable this MouseArea (which will close
|
||||
// the emote tray) until the user's cursor leaves the MouseArea (see `onExited()` below).
|
||||
if (!drawerContainer.keepDrawerExpanded) {
|
||||
emoteIndicatorMouseArea.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
onEntered: {
|
||||
Tablet.playSound(TabletEnums.ButtonHover);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onExited: {
|
||||
emoteIndicatorMouseArea.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.6, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 42 64" style="enable-background:new 0 0 42 64;" xml:space="preserve">
|
||||
<path d="M36.8,22.8v-7.1C36.8,7,29.7,0,21,0S5.2,7,5.2,15.7v7.1C2.2,23.8,0,26.7,0,30v26.3C0,60.5,3.5,64,7.8,64h26.5
|
||||
c4.3,0,7.8-3.5,7.8-7.7V30C42,26.7,39.8,23.8,36.8,22.8z M27.1,50.5c0,3.3-2.8,6.1-6.1,6.1s-6.1-2.7-6.1-6.1v-2.3
|
||||
c0-3.3,2.8-6.1,6.1-6.1s6.1,2.7,6.1,6.1V50.5z M30,22.4H12v-6.7c0-4.9,4-8.9,9-8.9s9,4,9,8.9V22.4z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 686 B |
Loading…
Reference in a new issue