allow AnimationHandle to be set from AnimationDetails

This commit is contained in:
ZappoMan 2014-11-12 13:36:08 -08:00
parent 50bf5db50f
commit 96705bfd74
3 changed files with 18 additions and 1 deletions

View file

@ -97,6 +97,23 @@ AnimationDetails AnimationHandle::getAnimationDetails() const {
return details;
}
void AnimationHandle::setAnimationDetails(const AnimationDetails& details) {
setRole(details.role);
setURL(details.url);
setFPS(details.fps);
setPriority(details.priority);
setLoop(details.loop);
setHold(details.hold);
setStartAutomatically(details.startAutomatically);
setFirstFrame(details.firstFrame);
setLastFrame(details.lastFrame);
setRunning(details.running);
setFrameIndex(details.frameIndex);
// NOTE: AnimationDetails doesn't support maskedJoints
//setMaskedJoints(const QStringList& maskedJoints);
}
void AnimationHandle::simulate(float deltaTime) {
_frameIndex += deltaTime * _fps;

View file

@ -70,6 +70,7 @@ public:
float getFrameIndex() const { return _frameIndex; }
AnimationDetails getAnimationDetails() const;
void setAnimationDetails(const AnimationDetails& details);
signals:

View file

@ -1527,7 +1527,6 @@ void Model::endScene(RenderMode mode, RenderArgs* args) {
int opaqueMeshPartsRendered = 0;
// now, for each model in the scene, render the mesh portions
float alpha = 1.0f; // at this point we don't support per model alphas
foreach(Model* model, _modelsInScene) {
opaqueMeshPartsRendered += model->renderMeshes(batch, mode, false, DEFAULT_ALPHA_THRESHOLD, false, false, false, args);
}