13 #ifndef hifi_ScriptAvatarData_h
14 #define hifi_ScriptAvatarData_h
16 #include <QtCore/QObject>
18 #include "AvatarData.h"
20 class ScriptAvatarData :
public QObject {
26 Q_PROPERTY(glm::vec3 position READ getPosition)
27 Q_PROPERTY(
float scale READ getTargetScale)
28 Q_PROPERTY(glm::vec3 handPosition READ getHandPosition)
29 Q_PROPERTY(
float bodyPitch READ getBodyPitch)
30 Q_PROPERTY(
float bodyYaw READ getBodyYaw)
31 Q_PROPERTY(
float bodyRoll READ getBodyRoll)
32 Q_PROPERTY(glm::quat orientation READ getOrientation)
33 Q_PROPERTY(glm::quat headOrientation READ getHeadOrientation)
34 Q_PROPERTY(
float headPitch READ getHeadPitch)
35 Q_PROPERTY(
float headYaw READ getHeadYaw)
36 Q_PROPERTY(
float headRoll READ getHeadRoll)
40 Q_PROPERTY(glm::vec3 velocity READ getVelocity)
41 Q_PROPERTY(glm::vec3 angularVelocity READ getAngularVelocity)
46 Q_PROPERTY(QUuid sessionUUID READ getSessionUUID)
47 Q_PROPERTY(QString displayName READ getDisplayName NOTIFY displayNameChanged)
48 Q_PROPERTY(QString sessionDisplayName READ getSessionDisplayName NOTIFY sessionDisplayNameChanged)
49 Q_PROPERTY(
bool isReplicated READ getIsReplicated)
50 Q_PROPERTY(
bool lookAtSnappingEnabled READ getLookAtSnappingEnabled NOTIFY lookAtSnappingChanged)
55 Q_PROPERTY(QString skeletonModelURL READ getSkeletonModelURLFromScript NOTIFY skeletonModelURLChanged)
56 Q_PROPERTY(QVector<AttachmentData> attachmentData READ getAttachmentData)
57 Q_PROPERTY(QStringList jointNames READ getJointNames)
62 Q_PROPERTY(
float audioLoudness READ getAudioLoudness)
63 Q_PROPERTY(
float audioAverageLoudness READ getAudioAverageLoudness)
68 Q_PROPERTY(glm::mat4 sensorToWorldMatrix READ getSensorToWorldMatrix)
69 Q_PROPERTY(glm::mat4 controllerLeftHandMatrix READ getControllerLeftHandMatrix)
70 Q_PROPERTY(glm::mat4 controllerRightHandMatrix READ getControllerRightHandMatrix)
72 Q_PROPERTY(
bool hasPriority READ getHasPriority)
75 ScriptAvatarData(AvatarSharedPointer avatarData);
80 glm::vec3 getPosition()
const;
81 float getTargetScale()
const;
82 glm::vec3 getHandPosition()
const;
83 float getBodyPitch()
const;
84 float getBodyYaw()
const;
85 float getBodyRoll()
const;
86 glm::quat getOrientation()
const;
87 glm::quat getHeadOrientation()
const;
88 float getHeadPitch()
const;
89 float getHeadYaw()
const;
90 float getHeadRoll()
const;
94 glm::vec3 getVelocity()
const;
95 glm::vec3 getAngularVelocity()
const;
100 QUuid getSessionUUID()
const;
101 QString getDisplayName()
const;
102 QString getSessionDisplayName()
const;
103 bool getIsReplicated()
const;
104 bool getLookAtSnappingEnabled()
const;
109 QString getSkeletonModelURLFromScript()
const;
117 Q_INVOKABLE
char getHandState()
const;
127 Q_INVOKABLE glm::quat getJointRotation(
int index)
const;
139 Q_INVOKABLE glm::vec3 getJointTranslation(
int index)
const;
149 Q_INVOKABLE glm::quat getJointRotation(
const QString& name)
const;
161 Q_INVOKABLE glm::vec3 getJointTranslation(
const QString& name)
const;
169 Q_INVOKABLE QVector<glm::quat> getJointRotations()
const;
180 Q_INVOKABLE QVector<glm::vec3> getJointTranslations()
const;
189 Q_INVOKABLE
bool isJointDataValid(
const QString& name)
const;
198 Q_INVOKABLE
int getJointIndex(
const QString& name)
const;
205 Q_INVOKABLE QStringList getJointNames()
const;
214 Q_INVOKABLE QVector<AttachmentData> getAttachmentData()
const;
216 #if DEV_BUILD || PR_BUILD
217 Q_INVOKABLE AvatarEntityMap getAvatarEntities()
const;
223 float getAudioLoudness()
const;
224 float getAudioAverageLoudness()
const;
229 glm::mat4 getSensorToWorldMatrix()
const;
230 glm::mat4 getControllerLeftHandMatrix()
const;
231 glm::mat4 getControllerRightHandMatrix()
const;
233 bool getHasPriority()
const;
242 void displayNameChanged();
249 void sessionDisplayNameChanged();
256 void skeletonModelURLChanged();
264 void lookAtSnappingChanged(
bool enabled);
275 glm::quat getAbsoluteJointRotationInObjectFrame(
int index)
const;
284 glm::vec3 getAbsoluteJointTranslationInObjectFrame(
int index)
const;
287 std::weak_ptr<AvatarData> _avatarData;