12 #ifndef hifi_SkeletonModel_h
13 #define hifi_SkeletonModel_h
15 #include "CauterizedModel.h"
18 class MuscleConstraint;
21 using SkeletonModelPointer = std::shared_ptr<SkeletonModel>;
22 using SkeletonModelWeakPointer = std::weak_ptr<SkeletonModel>;
26 using Parent = CauterizedModel;
31 SkeletonModel(Avatar* owningAvatar, QObject* parent =
nullptr);
34 Q_INVOKABLE
void setURL(
const QUrl& url)
override;
35 Q_INVOKABLE
void setTextures(
const QVariantMap& textures)
override;
37 void initJointStates()
override;
39 void simulate(
float deltaTime,
bool fullUpdate =
true)
override;
40 glm::vec3 avoidCrossedEyes(
const glm::vec3& lookAt);
41 void updateRig(
float deltaTime, glm::mat4 parentTransform)
override;
42 void updateAttitude(
const glm::quat& orientation);
44 bool getIsJointOverridden(
int jointIndex)
const;
52 bool getLeftGrabPosition(glm::vec3& position)
const;
53 bool getRightGrabPosition(glm::vec3& position)
const;
74 bool getLocalNeckPosition(glm::vec3& neckPosition)
const;
78 bool getEyePositions(glm::vec3& firstEyePosition, glm::vec3& secondEyePosition)
const;
84 void renderBoundingCollisionShapes(RenderArgs* args, gpu::Batch& batch,
float scale,
float alpha);
85 float getBoundingCapsuleRadius()
const {
return _boundingCapsuleRadius; }
86 float getBoundingCapsuleHeight()
const {
return _boundingCapsuleHeight; }
87 const glm::vec3 getBoundingCapsuleOffset()
const {
return _boundingCapsuleLocalOffset; }
91 float getHeadClipDistance()
const {
return _headClipDistance; }
93 void onInvalidate()
override;
97 void skeletonLoaded();
101 void computeBoundingShape();
103 bool getEyeModelPositions(glm::vec3& firstEyePosition, glm::vec3& secondEyePosition)
const;
105 Avatar* _owningAvatar;
107 glm::vec3 _boundingCapsuleLocalOffset;
108 float _boundingCapsuleRadius;
109 float _boundingCapsuleHeight;
111 glm::vec3 _defaultEyeModelPosition;
113 float _headClipDistance;
116 bool _texturesLoaded {
false };
A skeleton loaded from a model.
Definition: SkeletonModel.h:25
bool getLeftHandPosition(glm::vec3 &position) const
Definition: SkeletonModel.cpp:245
glm::vec3 getDefaultEyeModelPosition() const
Definition: SkeletonModel.cpp:310
float getLeftArmLength() const
Returns the extended length from the left hand to its last free ancestor.
bool getEyePositions(glm::vec3 &firstEyePosition, glm::vec3 &secondEyePosition) const
Definition: SkeletonModel.cpp:301
bool getNeckPosition(glm::vec3 &neckPosition) const
Definition: SkeletonModel.cpp:257
bool getRightHandPosition(glm::vec3 &position) const
Definition: SkeletonModel.cpp:249
int getRightHandJointIndex() const
Returns the index of the right hand joint, or -1 if not found.
Definition: SkeletonModel.h:50
bool getHeadPosition(glm::vec3 &headPosition) const
Definition: SkeletonModel.cpp:253
Q_INVOKABLE void setURL(const QUrl &url) override
Sets the URL of the model to render.
Definition: SkeletonModel.cpp:46
int getLeftHandJointIndex() const
Returns the index of the left hand joint, or -1 if not found.
Definition: SkeletonModel.h:47