mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 11:29:50 +02:00
Added joints position and combined rotation to scripting interface
This commit is contained in:
parent
8cd101ac57
commit
b4deed775e
2 changed files with 31 additions and 1 deletions
|
@ -705,6 +705,30 @@ QStringList Avatar::getJointNames() const {
|
||||||
return _skeletonModel.isActive() ? _skeletonModel.getGeometry()->getFBXGeometry().getJointNames() : QStringList();
|
return _skeletonModel.isActive() ? _skeletonModel.getGeometry()->getFBXGeometry().getJointNames() : QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glm::vec3 Avatar::getJointPosition(int index) const {
|
||||||
|
glm::vec3 position(0,0,0);
|
||||||
|
_skeletonModel.getJointPosition(index, position);
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::vec3 Avatar::getJointPosition(const QString& name) const {
|
||||||
|
glm::vec3 position(0,0,0);
|
||||||
|
_skeletonModel.getJointPosition(getJointIndex(name), position);
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::quat Avatar::getJointCombinedRotation(int index) const {
|
||||||
|
glm::quat rotation;
|
||||||
|
_skeletonModel.getJointCombinedRotation(index, rotation);
|
||||||
|
return rotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::quat Avatar::getJointCombinedRotation(const QString& name) const {
|
||||||
|
glm::quat rotation;
|
||||||
|
_skeletonModel.getJointCombinedRotation(getJointIndex(name), rotation);
|
||||||
|
return rotation;
|
||||||
|
}
|
||||||
|
|
||||||
void Avatar::setFaceModelURL(const QUrl& faceModelURL) {
|
void Avatar::setFaceModelURL(const QUrl& faceModelURL) {
|
||||||
AvatarData::setFaceModelURL(faceModelURL);
|
AvatarData::setFaceModelURL(faceModelURL);
|
||||||
const QUrl DEFAULT_FACE_MODEL_URL = QUrl::fromLocalFile(Application::resourcesPath() + "meshes/defaultAvatar_head.fst");
|
const QUrl DEFAULT_FACE_MODEL_URL = QUrl::fromLocalFile(Application::resourcesPath() + "meshes/defaultAvatar_head.fst");
|
||||||
|
@ -725,6 +749,7 @@ void Avatar::setAttachmentData(const QVector<AttachmentData>& attachmentData) {
|
||||||
// make sure we have as many models as attachments
|
// make sure we have as many models as attachments
|
||||||
while (_attachmentModels.size() < attachmentData.size()) {
|
while (_attachmentModels.size() < attachmentData.size()) {
|
||||||
Model* model = new Model(this);
|
Model* model = new Model(this);
|
||||||
|
model->setSnapModelToCenter(true);
|
||||||
model->init();
|
model->init();
|
||||||
_attachmentModels.append(model);
|
_attachmentModels.append(model);
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,7 +152,12 @@ public:
|
||||||
|
|
||||||
quint32 getCollisionGroups() const { return _collisionGroups; }
|
quint32 getCollisionGroups() const { return _collisionGroups; }
|
||||||
virtual void setCollisionGroups(quint32 collisionGroups) { _collisionGroups = (collisionGroups & VALID_COLLISION_GROUPS); }
|
virtual void setCollisionGroups(quint32 collisionGroups) { _collisionGroups = (collisionGroups & VALID_COLLISION_GROUPS); }
|
||||||
|
|
||||||
|
Q_INVOKABLE glm::vec3 getJointPosition(int index) const;
|
||||||
|
Q_INVOKABLE glm::vec3 getJointPosition(const QString& name) const;
|
||||||
|
Q_INVOKABLE glm::quat getJointCombinedRotation(int index) const;
|
||||||
|
Q_INVOKABLE glm::quat getJointCombinedRotation(const QString& name) const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void updateCollisionGroups();
|
void updateCollisionGroups();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue