mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 17:03:58 +02:00
Joint rotations manipulation helper
This commit is contained in:
parent
18ff497443
commit
ff0a5df2d6
3 changed files with 18 additions and 0 deletions
|
@ -683,6 +683,21 @@ glm::quat AvatarData::getJointRotation(const QString& name) const {
|
|||
return getJointRotation(getJointIndex(name));
|
||||
}
|
||||
|
||||
QVector<glm::quat> AvatarData::getJointRotations() const {
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QVector<glm::quat> result;
|
||||
QMetaObject::invokeMethod(const_cast<AvatarData*>(this),
|
||||
"getJointRotation", Qt::BlockingQueuedConnection,
|
||||
Q_RETURN_ARG(QVector<glm::quat>, result));
|
||||
return result;
|
||||
}
|
||||
QVector<glm::quat> jointRotations(_jointData.size());
|
||||
for (int i = 0; i < _jointData.size(); ++i) {
|
||||
jointRotations[i] = _jointData[i].rotation;
|
||||
}
|
||||
return jointRotations;
|
||||
}
|
||||
|
||||
bool AvatarData::hasIdentityChangedAfterParsing(const QByteArray &packet) {
|
||||
QDataStream packetStream(packet);
|
||||
packetStream.skipRawData(numBytesForPacketHeader(packet));
|
||||
|
|
|
@ -210,6 +210,8 @@ public:
|
|||
Q_INVOKABLE void clearJointData(const QString& name);
|
||||
Q_INVOKABLE bool isJointDataValid(const QString& name) const;
|
||||
Q_INVOKABLE glm::quat getJointRotation(const QString& name) const;
|
||||
|
||||
QVector<glm::quat> getJointRotations() const;
|
||||
|
||||
/// Returns the index of the joint with the specified name, or -1 if not found/unknown.
|
||||
Q_INVOKABLE virtual int getJointIndex(const QString& name) const { return _jointIndices.value(name) - 1; }
|
||||
|
|
|
@ -56,6 +56,7 @@ public:
|
|||
|
||||
void setBlendshape(QString name, float val);
|
||||
const QVector<float>& getBlendshapeCoefficients() const { return _blendshapeCoefficients; }
|
||||
void setBlendshapeCoefficients(const QVector<float>& blendshapeCoefficients) { _blendshapeCoefficients = blendshapeCoefficients; }
|
||||
|
||||
float getPupilDilation() const { return _pupilDilation; }
|
||||
void setPupilDilation(float pupilDilation) { _pupilDilation = pupilDilation; }
|
||||
|
|
Loading…
Reference in a new issue