mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 15:24:03 +02:00
Remove unnecessary arguments
This commit is contained in:
parent
5a664fd778
commit
cde025c8ad
2 changed files with 11 additions and 12 deletions
|
@ -17,6 +17,7 @@ ScriptableAvatar::ScriptableAvatar(ScriptEngine* scriptEngine) : _scriptEngine(s
|
||||||
connect(_scriptEngine, SIGNAL(update(float)), this, SLOT(update(float)));
|
connect(_scriptEngine, SIGNAL(update(float)), this, SLOT(update(float)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hold and priority unused but kept so that client side JS can run.
|
||||||
void ScriptableAvatar::startAnimation(const QString& url, float fps, float priority,
|
void ScriptableAvatar::startAnimation(const QString& url, float fps, float priority,
|
||||||
bool loop, bool hold, float firstFrame, float lastFrame, const QStringList& maskedJoints) {
|
bool loop, bool hold, float firstFrame, float lastFrame, const QStringList& maskedJoints) {
|
||||||
if (QThread::currentThread() != thread()) {
|
if (QThread::currentThread() != thread()) {
|
||||||
|
@ -27,22 +28,22 @@ void ScriptableAvatar::startAnimation(const QString& url, float fps, float prior
|
||||||
}
|
}
|
||||||
_animation = _scriptEngine->getAnimationCache()->getAnimation(url);
|
_animation = _scriptEngine->getAnimationCache()->getAnimation(url);
|
||||||
_animationDetails = AnimationDetails("", QUrl(url), fps, 0, loop, hold, false, firstFrame, lastFrame, true, firstFrame);
|
_animationDetails = AnimationDetails("", QUrl(url), fps, 0, loop, hold, false, firstFrame, lastFrame, true, firstFrame);
|
||||||
|
_maskedJoints = maskedJoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptableAvatar::stopAnimation(const QString& url) {
|
void ScriptableAvatar::stopAnimation() {
|
||||||
if (QThread::currentThread() != thread()) {
|
if (QThread::currentThread() != thread()) {
|
||||||
QMetaObject::invokeMethod(this, "stopAnimation", Q_ARG(const QString&, url));
|
QMetaObject::invokeMethod(this, "stopAnimation");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_animation.clear();
|
_animation.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
AnimationDetails ScriptableAvatar::getAnimationDetails(const QString& url) {
|
AnimationDetails ScriptableAvatar::getAnimationDetails() {
|
||||||
if (QThread::currentThread() != thread()) {
|
if (QThread::currentThread() != thread()) {
|
||||||
AnimationDetails result;
|
AnimationDetails result;
|
||||||
QMetaObject::invokeMethod(this, "getAnimationDetails", Qt::BlockingQueuedConnection,
|
QMetaObject::invokeMethod(this, "getAnimationDetails", Qt::BlockingQueuedConnection,
|
||||||
Q_RETURN_ARG(AnimationDetails, result),
|
Q_RETURN_ARG(AnimationDetails, result));
|
||||||
Q_ARG(const QString&, url));
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return _animationDetails;
|
return _animationDetails;
|
||||||
|
@ -72,11 +73,11 @@ void ScriptableAvatar::update(float deltatime) {
|
||||||
|
|
||||||
for (int i = 0; i < modelJoints.size(); i++) {
|
for (int i = 0; i < modelJoints.size(); i++) {
|
||||||
int mapping = animationJoints.indexOf(modelJoints[i]);
|
int mapping = animationJoints.indexOf(modelJoints[i]);
|
||||||
if (mapping != -1) {
|
if (mapping != -1 && !_maskedJoints.contains(modelJoints[i])) {
|
||||||
JointData& data = _jointData[i];
|
JointData& data = _jointData[i];
|
||||||
data.valid = true;
|
data.valid = true;
|
||||||
data.rotation = safeMix(floorFrame.rotations.at(i), ceilFrame.rotations.at(i), frameFraction);
|
data.rotation = safeMix(floorFrame.rotations.at(i), ceilFrame.rotations.at(i), frameFraction);
|
||||||
} else if (i < _jointData.size()) {
|
} else {
|
||||||
_jointData[i].valid = false;
|
_jointData[i].valid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,11 +24,8 @@ public:
|
||||||
/// Allows scripts to run animations.
|
/// Allows scripts to run animations.
|
||||||
Q_INVOKABLE void startAnimation(const QString& url, float fps = 30.0f, float priority = 1.0f, bool loop = false,
|
Q_INVOKABLE void startAnimation(const QString& url, float fps = 30.0f, float priority = 1.0f, bool loop = false,
|
||||||
bool hold = false, float firstFrame = 0.0f, float lastFrame = FLT_MAX, const QStringList& maskedJoints = QStringList());
|
bool hold = false, float firstFrame = 0.0f, float lastFrame = FLT_MAX, const QStringList& maskedJoints = QStringList());
|
||||||
|
Q_INVOKABLE void stopAnimation();
|
||||||
/// Stops an animation as identified by a URL.
|
Q_INVOKABLE AnimationDetails getAnimationDetails();
|
||||||
Q_INVOKABLE void stopAnimation(const QString& url);
|
|
||||||
|
|
||||||
Q_INVOKABLE AnimationDetails getAnimationDetails(const QString& url);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void update(float deltatime);
|
void update(float deltatime);
|
||||||
|
@ -37,6 +34,7 @@ private:
|
||||||
ScriptEngine* _scriptEngine;
|
ScriptEngine* _scriptEngine;
|
||||||
AnimationPointer _animation;
|
AnimationPointer _animation;
|
||||||
AnimationDetails _animationDetails;
|
AnimationDetails _animationDetails;
|
||||||
|
QStringList _maskedJoints;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_ScriptableAvatar_h
|
#endif // hifi_ScriptableAvatar_h
|
Loading…
Reference in a new issue