Implemented MyAvatar.prefetchAnimation() JS method

This commit is contained in:
Anthony J. Thibault 2015-11-10 16:51:48 -08:00
parent 936c55a94e
commit e1d0a97807
3 changed files with 8 additions and 2 deletions

View file

@ -20,7 +20,9 @@ for (i = 0; i < l; i++) {
print(roles[i]);
}
// replace point with the bird!
MyAvatar.prefetchAnimation(THE_BIRD_RIGHT_URL);
// replace point animations with the bird!
MyAvatar.overrideRoleAnimation("rightHandPointIntro", THE_BIRD_RIGHT_URL, 30, false, 0, 12);
MyAvatar.overrideRoleAnimation("rightHandPointHold", THE_BIRD_RIGHT_URL, 30, false, 12, 12);
MyAvatar.overrideRoleAnimation("rightHandPointOutro", THE_BIRD_RIGHT_URL, 30, false, 19, 30);

View file

@ -180,7 +180,10 @@ void Rig::restoreRoleAnimation(const QString& role) {
void Rig::prefetchAnimation(const QString& url) {
if (_enableAnimGraph) {
// TODO:
// This will begin loading the NetworkGeometry for the given URL.
// which should speed us up if we request it later via overrideAnimation.
auto clipNode = std::make_shared<AnimClip>("prefetch", url, 0, 0, 1.0, false);
_prefetchedAnimations.push_back(clipNode);
}
}

View file

@ -265,6 +265,7 @@ public:
SimpleMovingAverage _averageLateralSpeed { 10 };
std::map<QString, AnimNode::Pointer> _origRoleAnimations;
std::vector<AnimNode::Pointer> _prefetchedAnimations;
private:
QMap<int, StateHandler> _stateHandlers;