mirror of
https://github.com/JulianGro/overte.git
synced 2025-06-04 02:20:20 +02:00
Set activation when switching random states
This commit is contained in:
parent
7f1f6dba31
commit
acbeb326a7
2 changed files with 8 additions and 2 deletions
|
@ -45,7 +45,6 @@ public:
|
||||||
bool getEnableDebugDrawIKChains() const { return _enableDebugDrawIKChains; }
|
bool getEnableDebugDrawIKChains() const { return _enableDebugDrawIKChains; }
|
||||||
const glm::mat4& getGeometryToRigMatrix() const { return _geometryToRigMatrix; }
|
const glm::mat4& getGeometryToRigMatrix() const { return _geometryToRigMatrix; }
|
||||||
const glm::mat4& getRigToWorldMatrix() const { return _rigToWorldMatrix; }
|
const glm::mat4& getRigToWorldMatrix() const { return _rigToWorldMatrix; }
|
||||||
int getEvaluationCount() const { return _evaluationCount; }
|
|
||||||
|
|
||||||
float getDebugAlpha(const QString& key) const {
|
float getDebugAlpha(const QString& key) const {
|
||||||
auto it = _debugAlphaMap.find(key);
|
auto it = _debugAlphaMap.find(key);
|
||||||
|
@ -87,7 +86,6 @@ protected:
|
||||||
bool _enableDebugDrawIKChains { false };
|
bool _enableDebugDrawIKChains { false };
|
||||||
glm::mat4 _geometryToRigMatrix;
|
glm::mat4 _geometryToRigMatrix;
|
||||||
glm::mat4 _rigToWorldMatrix;
|
glm::mat4 _rigToWorldMatrix;
|
||||||
int _evaluationCount{ 0 };
|
|
||||||
|
|
||||||
// used for debugging internal state of animation system.
|
// used for debugging internal state of animation system.
|
||||||
mutable DebugAlphaMap _debugAlphaMap;
|
mutable DebugAlphaMap _debugAlphaMap;
|
||||||
|
|
|
@ -168,8 +168,16 @@ void AnimRandomSwitch::addState(RandomSwitchState::Pointer randomState) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimRandomSwitch::switchRandomState(const AnimVariantMap& animVars, const AnimContext& context, RandomSwitchState::Pointer desiredState, bool shouldInterp) {
|
void AnimRandomSwitch::switchRandomState(const AnimVariantMap& animVars, const AnimContext& context, RandomSwitchState::Pointer desiredState, bool shouldInterp) {
|
||||||
|
|
||||||
|
auto prevStateNode = _children[_currentState->getChildIndex()];
|
||||||
auto nextStateNode = _children[desiredState->getChildIndex()];
|
auto nextStateNode = _children[desiredState->getChildIndex()];
|
||||||
|
|
||||||
|
// activate/deactivate states
|
||||||
|
prevStateNode->setActive(false);
|
||||||
|
nextStateNode->setActive(true);
|
||||||
|
|
||||||
_lastPlayedState = nextStateNode->getID();
|
_lastPlayedState = nextStateNode->getID();
|
||||||
|
|
||||||
if (shouldInterp) {
|
if (shouldInterp) {
|
||||||
|
|
||||||
bool interpActive = _duringInterp;
|
bool interpActive = _duringInterp;
|
||||||
|
|
Loading…
Reference in a new issue