mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Implemented MyAvatar.prefetchAnimation() JS method
This commit is contained in:
parent
936c55a94e
commit
e1d0a97807
3 changed files with 8 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -265,6 +265,7 @@ public:
|
|||
SimpleMovingAverage _averageLateralSpeed { 10 };
|
||||
|
||||
std::map<QString, AnimNode::Pointer> _origRoleAnimations;
|
||||
std::vector<AnimNode::Pointer> _prefetchedAnimations;
|
||||
|
||||
private:
|
||||
QMap<int, StateHandler> _stateHandlers;
|
||||
|
|
Loading…
Reference in a new issue