mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-26 01:35:14 +02:00
36 lines
1.2 KiB
C++
36 lines
1.2 KiB
C++
//
|
|
// AnimationObject.cpp
|
|
// libraries/animation/src/
|
|
//
|
|
// Created by Andrzej Kapolka on 4/17/14.
|
|
// Copyright (c) 2014 High Fidelity, Inc. All rights reserved.
|
|
//
|
|
// Distributed under the Apache License, Version 2.0.
|
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
//
|
|
|
|
#include <QScriptEngine>
|
|
|
|
#include "AnimationCache.h"
|
|
#include "AnimationObject.h"
|
|
|
|
QStringList AnimationObject::getJointNames() const {
|
|
return qscriptvalue_cast<AnimationPointer>(thisObject())->getJointNames();
|
|
}
|
|
|
|
QVector<FBXAnimationFrame> AnimationObject::getFrames() const {
|
|
return qscriptvalue_cast<AnimationPointer>(thisObject())->getFrames();
|
|
}
|
|
|
|
QVector<glm::quat> AnimationFrameObject::getRotations() const {
|
|
return qscriptvalue_cast<FBXAnimationFrame>(thisObject()).rotations;
|
|
}
|
|
|
|
void registerAnimationTypes(QScriptEngine* engine) {
|
|
qScriptRegisterSequenceMetaType<QVector<FBXAnimationFrame> >(engine);
|
|
engine->setDefaultPrototype(qMetaTypeId<FBXAnimationFrame>(), engine->newQObject(
|
|
new AnimationFrameObject(), QScriptEngine::ScriptOwnership));
|
|
engine->setDefaultPrototype(qMetaTypeId<AnimationPointer>(), engine->newQObject(
|
|
new AnimationObject(), QScriptEngine::ScriptOwnership));
|
|
}
|
|
|