merged the json from the ik 2 bone pr into the new animation json

This commit is contained in:
amantley 2018-08-06 14:27:09 -07:00
parent 08889b627a
commit f1990378fd
3 changed files with 1462 additions and 1419 deletions
interface/resources/avatar
libraries/animation/src

File diff suppressed because it is too large Load diff

View file

@ -25,7 +25,6 @@ AnimBlendLinear::~AnimBlendLinear() {
}
const AnimPoseVec& AnimBlendLinear::evaluate(const AnimVariantMap& animVars, const AnimContext& context, float dt, AnimVariantMap& triggersOut) {
qCDebug(animation) << "in blend linear ++++++++++++++++" << _alphaVar << ": " << QString::number(_alpha, 'f', 3) << " parent id: " << _id << " and alpha " << _animStack[_id];
_alpha = animVars.lookup(_alphaVar, _alpha);
float parentAlpha = _animStack[_id];
@ -42,7 +41,6 @@ const AnimPoseVec& AnimBlendLinear::evaluate(const AnimVariantMap& animVars, con
float clampedAlpha = glm::clamp(_alpha, 0.0f, (float)(_children.size() - 1));
size_t prevPoseIndex = glm::floor(clampedAlpha);
size_t nextPoseIndex = glm::ceil(clampedAlpha);
float alpha = glm::fract(clampedAlpha);
if (prevPoseIndex == nextPoseIndex) {
if (nextPoseIndex == 0) {
nextPoseIndex = 1;
@ -50,9 +48,9 @@ const AnimPoseVec& AnimBlendLinear::evaluate(const AnimVariantMap& animVars, con
prevPoseIndex = (nextPoseIndex - 1);
}
}
float alpha = clampedAlpha - (float)prevPoseIndex;
evaluateAndBlendChildren(animVars, context, triggersOut, alpha, prevPoseIndex, nextPoseIndex, dt);
qCDebug(animation) << "linear blend alpha " << alpha << " and _alpha " << _alpha <<" next pose " << _children[nextPoseIndex]->getID() << " previous pose " << _children[prevPoseIndex]->getID();
float weight2 = _alpha - (float)prevPoseIndex;
float weight1 = 1.0f - weight2;
_animStack[_children[prevPoseIndex]->getID()] = weight1 * parentAlpha;

View file

@ -49,7 +49,6 @@ static float calculateAlpha(const float speed, const std::vector<float>& charact
const AnimPoseVec& AnimBlendLinearMove::evaluate(const AnimVariantMap& animVars, const AnimContext& context, float dt, AnimVariantMap& triggersOut) {
qCDebug(animation) << "in blend linear move " << _alphaVar << ": " << _alpha << " band id: " << _id << " parent alpha " << _animStack[_id];
assert(_children.size() == _characteristicSpeeds.size());
_desiredSpeed = animVars.lookup(_desiredSpeedVar, _desiredSpeed);