From 8ac06c4059f696dcac5fec67a1241fbb52c2c079 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 27 Jul 2015 08:48:16 -0700 Subject: [PATCH 1/4] remove friend class from Avatar --- interface/src/avatar/Avatar.h | 13 +++++++------ interface/src/avatar/AvatarManager.cpp | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index a587e69642..8ae4b9fb4d 100644 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -186,9 +186,10 @@ public: virtual void computeShapeInfo(ShapeInfo& shapeInfo); - friend class AvatarManager; + void setMotionState(AvatarMotionState* motionState) { _motionState = motionState; } + AvatarMotionState* getMotionState() { return _motionState; } -signals: + signals: void collisionWithAvatar(const QUuid& myUUID, const QUuid& theirUUID, const CollisionInfo& collision); protected: @@ -218,7 +219,7 @@ protected: glm::vec3 _worldUpDirection; float _stringLength; bool _moving; ///< set when position is changing - + // protected methods... glm::vec3 getBodyRightDirection() const { return getOrientation() * IDENTITY_RIGHT; } glm::vec3 getBodyUpDirection() const { return getOrientation() * IDENTITY_UP; } @@ -243,7 +244,7 @@ protected: virtual void updateJointMappings(); render::ItemID _renderItemID; - + private: bool _initialized; NetworkTexturePointer _billboardTexture; @@ -251,9 +252,9 @@ private: bool _isLookAtTarget; void renderBillboard(RenderArgs* renderArgs); - + float getBillboardSize() const; - + static int _jointConesID; int _voiceSphereID; diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index ead330a41f..ee59a01e07 100644 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -179,11 +179,11 @@ AvatarSharedPointer AvatarManager::addAvatar(const QUuid& sessionUUID, const QWe // protected void AvatarManager::removeAvatarMotionState(AvatarSharedPointer avatar) { auto rawPointer = std::static_pointer_cast(avatar); - AvatarMotionState* motionState= rawPointer->_motionState; + AvatarMotionState* motionState = rawPointer->getMotionState(); if (motionState) { // clean up physics stuff motionState->clearObjectBackPointer(); - rawPointer->_motionState = nullptr; + rawPointer->setMotionState(nullptr); _avatarMotionStates.remove(motionState); _motionStatesToAdd.remove(motionState); _motionStatesToDelete.push_back(motionState); @@ -307,7 +307,7 @@ void AvatarManager::updateAvatarPhysicsShape(const QUuid& id) { AvatarHash::iterator avatarItr = _avatarHash.find(id); if (avatarItr != _avatarHash.end()) { auto avatar = std::static_pointer_cast(avatarItr.value()); - AvatarMotionState* motionState = avatar->_motionState; + AvatarMotionState* motionState = avatar->getMotionState(); if (motionState) { motionState->addDirtyFlags(EntityItem::DIRTY_SHAPE); } else { @@ -316,7 +316,7 @@ void AvatarManager::updateAvatarPhysicsShape(const QUuid& id) { btCollisionShape* shape = ObjectMotionState::getShapeManager()->getShape(shapeInfo); if (shape) { AvatarMotionState* motionState = new AvatarMotionState(avatar.get(), shape); - avatar->_motionState = motionState; + avatar->setMotionState(motionState); _motionStatesToAdd.insert(motionState); _avatarMotionStates.insert(motionState); } From 7e582830415b351d40e3366ab4f77bf6b53b7194 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 27 Jul 2015 08:54:08 -0700 Subject: [PATCH 2/4] change the methods that aren't called from outside the class to be private --- interface/src/avatar/MyAvatar.h | 131 +++++++++++++++----------------- 1 file changed, 62 insertions(+), 69 deletions(-) diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 802c92ec2c..4fd66c0347 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -39,51 +39,40 @@ public: MyAvatar(RigPointer rig); ~MyAvatar(); - QByteArray toByteArray(); + void reset(); void update(float deltaTime); - void simulate(float deltaTime); void preRender(RenderArgs* renderArgs); - void updateFromTrackers(float deltaTime); - virtual void render(RenderArgs* renderArgs, const glm::vec3& cameraPositio) override; - virtual void renderBody(RenderArgs* renderArgs, ViewFrustum* renderFrustum, float glowLevel = 0.0f) override; - virtual bool shouldRenderHead(const RenderArgs* renderArgs) const override; - - // setters void setLeanScale(float scale) { _leanScale = scale; } - void setShouldRenderLocally(bool shouldRender) { _shouldRender = shouldRender; } void setRealWorldFieldOfView(float realWorldFov) { _realWorldFieldOfView.set(realWorldFov); } - // getters float getLeanScale() const { return _leanScale; } Q_INVOKABLE glm::vec3 getDefaultEyePosition() const; - bool getShouldRenderLocally() const { return _shouldRender; } + float getRealWorldFieldOfView() { return _realWorldFieldOfView.get(); } - + const QList& getAnimationHandles() const { return _rig->getAnimationHandles(); } AnimationHandlePointer addAnimationHandle() { return _rig->createAnimationHandle(); } void removeAnimationHandle(const AnimationHandlePointer& handle) { _rig->removeAnimationHandle(handle); } - /// Allows scripts to run animations. 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()); /// Stops an animation as identified by a URL. Q_INVOKABLE void stopAnimation(const QString& url); - + /// Starts an animation by its role, using the provided URL and parameters if the avatar doesn't have a custom /// animation for the role. Q_INVOKABLE void startAnimationByRole(const QString& role, const QString& url = QString(), 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()); - + float priority = 1.0f, bool loop = false, bool hold = false, float firstFrame = 0.0f, + float lastFrame = FLT_MAX, const QStringList& maskedJoints = QStringList()); /// Stops an animation identified by its role. Q_INVOKABLE void stopAnimationByRole(const QString& role); - Q_INVOKABLE AnimationDetails getAnimationDetailsByRole(const QString& role); Q_INVOKABLE AnimationDetails getAnimationDetails(const QString& url); - + void clearJointAnimationPriorities(); + // get/set avatar data void saveData(); void loadData(); @@ -94,41 +83,32 @@ public: // Set what driving keys are being pressed to control thrust levels void clearDriveKeys(); void setDriveKeys(int key, float val) { _driveKeys[key] = val; }; - bool getDriveKeys(int key) { return _driveKeys[key] != 0.0f; }; - void relayDriveKeysToCharacterController(); - bool isMyAvatar() const { return true; } - eyeContactTarget getEyeContactTarget(); - virtual int parseDataFromBuffer(const QByteArray& buffer); - static void sendKillAvatar(); - + Q_INVOKABLE glm::vec3 getTrackedHeadPosition() const { return _trackedHeadPosition; } Q_INVOKABLE glm::vec3 getHeadPosition() const { return getHead()->getPosition(); } Q_INVOKABLE float getHeadFinalYaw() const { return getHead()->getFinalYaw(); } Q_INVOKABLE float getHeadFinalRoll() const { return getHead()->getFinalRoll(); } Q_INVOKABLE float getHeadFinalPitch() const { return getHead()->getFinalPitch(); } Q_INVOKABLE float getHeadDeltaPitch() const { return getHead()->getDeltaPitch(); } - + Q_INVOKABLE glm::vec3 getEyePosition() const { return getHead()->getEyePosition(); } - + Q_INVOKABLE glm::vec3 getTargetAvatarPosition() const { return _targetAvatarPosition; } + AvatarWeakPointer getLookAtTargetAvatar() const { return _lookAtTargetAvatar; } void updateLookAtTargetAvatar(); void clearLookAtTargetAvatar(); - - virtual void setJointRotations(QVector jointRotations); - virtual void setJointData(int index, const glm::quat& rotation); - virtual void clearJointData(int index); - virtual void clearJointsData(); Q_INVOKABLE void useFullAvatarURL(const QUrl& fullAvatarURL, const QString& modelName = QString()); Q_INVOKABLE void useHeadURL(const QUrl& headURL, const QString& modelName = QString()); Q_INVOKABLE void useBodyURL(const QUrl& bodyURL, const QString& modelName = QString()); - Q_INVOKABLE void useHeadAndBodyURLs(const QUrl& headURL, const QUrl& bodyURL, const QString& headName = QString(), const QString& bodyName = QString()); + Q_INVOKABLE void useHeadAndBodyURLs(const QUrl& headURL, const QUrl& bodyURL, + const QString& headName = QString(), const QString& bodyName = QString()); Q_INVOKABLE bool getUseFullAvatar() const { return _useFullAvatar; } Q_INVOKABLE const QUrl& getFullAvatarURLFromPreferences() const { return _fullAvatarURLFromPreferences; } @@ -143,48 +123,30 @@ public: virtual void setAttachmentData(const QVector& attachmentData); - virtual glm::vec3 getSkeletonPosition() const; - void updateLocalAABox(); DynamicCharacterController* getCharacterController() { return &_characterController; } - - void clearJointAnimationPriorities(); - glm::vec3 getScriptedMotorVelocity() const { return _scriptedMotorVelocity; } - float getScriptedMotorTimescale() const { return _scriptedMotorTimescale; } - QString getScriptedMotorFrame() const; - - void setScriptedMotorVelocity(const glm::vec3& velocity); - void setScriptedMotorTimescale(float timescale); - void setScriptedMotorFrame(QString frame); const QString& getCollisionSoundURL() {return _collisionSoundURL; } void setCollisionSoundURL(const QString& url); void clearScriptableSettings(); - virtual void attach(const QString& modelURL, const QString& jointName = QString(), - const glm::vec3& translation = glm::vec3(), const glm::quat& rotation = glm::quat(), float scale = 1.0f, - bool allowDuplicates = false, bool useSaved = true); - /// Renders a laser pointer for UI picking - void renderLaserPointers(gpu::Batch& batch); + glm::vec3 getLaserPointerTipPosition(const PalmData* palm); - - const RecorderPointer getRecorder() const { return _recorder; } - const PlayerPointer getPlayer() const { return _player; } - + float getBoomLength() const { return _boomLength; } void setBoomLength(float boomLength) { _boomLength = boomLength; } - + static const float ZOOM_MIN; static const float ZOOM_MAX; static const float ZOOM_DEFAULT; - + public slots: void increaseSize(); void decreaseSize(); void resetSize(); - + void goToLocation(const glm::vec3& newPosition, bool hasOrientation = false, const glm::quat& newOrientation = glm::quat(), bool shouldFaceLocation = false); @@ -204,7 +166,7 @@ public slots: void clearReferential(); bool setModelReferential(const QUuid& id); bool setJointReferential(const QUuid& id, int jointIndex); - + bool isRecording(); qint64 recorderElapsed(); void startRecording(); @@ -213,7 +175,7 @@ public slots: void loadLastRecording(); virtual void rebuildSkeletonBody(); - + signals: void transformChanged(); void newCollisionSoundURL(const QUrl& url); @@ -221,6 +183,37 @@ signals: private: + QByteArray toByteArray(); + void simulate(float deltaTime); + void updateFromTrackers(float deltaTime); + virtual void render(RenderArgs* renderArgs, const glm::vec3& cameraPositio) override; + virtual void renderBody(RenderArgs* renderArgs, ViewFrustum* renderFrustum, float glowLevel = 0.0f) override; + virtual bool shouldRenderHead(const RenderArgs* renderArgs) const override; + void setShouldRenderLocally(bool shouldRender) { _shouldRender = shouldRender; } + bool getShouldRenderLocally() const { return _shouldRender; } + bool getDriveKeys(int key) { return _driveKeys[key] != 0.0f; }; + bool isMyAvatar() const { return true; } + virtual int parseDataFromBuffer(const QByteArray& buffer); + virtual void setJointRotations(QVector jointRotations); + virtual void setJointData(int index, const glm::quat& rotation); + virtual void clearJointData(int index); + virtual void clearJointsData(); + virtual glm::vec3 getSkeletonPosition() const; + void updateLocalAABox(); + glm::vec3 getScriptedMotorVelocity() const { return _scriptedMotorVelocity; } + float getScriptedMotorTimescale() const { return _scriptedMotorTimescale; } + QString getScriptedMotorFrame() const; + void setScriptedMotorVelocity(const glm::vec3& velocity); + void setScriptedMotorTimescale(float timescale); + void setScriptedMotorFrame(QString frame); + virtual void attach(const QString& modelURL, const QString& jointName = QString(), + const glm::vec3& translation = glm::vec3(), const glm::quat& rotation = glm::quat(), float scale = 1.0f, + bool allowDuplicates = false, bool useSaved = true); + + void renderLaserPointers(gpu::Batch& batch); + const RecorderPointer getRecorder() const { return _recorder; } + const PlayerPointer getPlayer() const { return _player; } + bool cameraInsideHead() const; // These are made private for MyAvatar so that you will use the "use" methods instead @@ -235,7 +228,7 @@ private: bool _wasPushing; bool _isPushing; bool _isBraking; - + float _boomLength; float _trapDuration; // seconds that avatar has been trapped by collisions @@ -256,30 +249,30 @@ private: bool _shouldRender; bool _billboardValid; float _oculusYawOffset; - + bool _feetTouchFloor; eyeContactTarget _eyeContactTarget; RecorderPointer _recorder; - + glm::vec3 _trackedHeadPosition; - + Setting::Handle _realWorldFieldOfView; - - // private methods + + // private methods void updateOrientation(float deltaTime); glm::vec3 applyKeyboardMotor(float deltaTime, const glm::vec3& velocity, bool isHovering); glm::vec3 applyScriptedMotor(float deltaTime, const glm::vec3& velocity); void updatePosition(float deltaTime); void updateCollisionSound(const glm::vec3& penetration, float deltaTime, float frequency); void maybeUpdateBillboard(); - + // Avatar Preferences bool _useFullAvatar = false; QUrl _fullAvatarURLFromPreferences; QUrl _headURLFromPreferences; QUrl _skeletonURLFromPreferences; - + QString _headModelName; QString _bodyModelName; QString _fullAvatarModelName; From 81375e47e07e02f9dd6798536e629d51242c53ce Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 27 Jul 2015 09:07:26 -0700 Subject: [PATCH 3/4] remove methods from MyAvatar: setJointRotations setJointData clearJointData clearJointsData --- interface/src/avatar/MyAvatar.cpp | 27 --------------------------- interface/src/avatar/MyAvatar.h | 4 ---- 2 files changed, 31 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 0dceb79402..fe4d4bc3cb 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -900,33 +900,6 @@ glm::vec3 MyAvatar::getDefaultEyePosition() const { const float SCRIPT_PRIORITY = DEFAULT_PRIORITY + 1.0f; const float RECORDER_PRIORITY = SCRIPT_PRIORITY + 1.0f; -void MyAvatar::setJointRotations(QVector jointRotations) { - int numStates = glm::min(_skeletonModel.getJointStateCount(), jointRotations.size()); - for (int i = 0; i < numStates; ++i) { - // HACK: ATM only Recorder calls setJointRotations() so we hardcode its priority here - _skeletonModel.setJointState(i, true, jointRotations[i], RECORDER_PRIORITY); - } -} - -void MyAvatar::setJointData(int index, const glm::quat& rotation) { - if (QThread::currentThread() == thread()) { - // HACK: ATM only JS scripts call setJointData() on MyAvatar so we hardcode the priority - _skeletonModel.setJointState(index, true, rotation, SCRIPT_PRIORITY); - } -} - -void MyAvatar::clearJointData(int index) { - if (QThread::currentThread() == thread()) { - // HACK: ATM only JS scripts call clearJointData() on MyAvatar so we hardcode the priority - _skeletonModel.setJointState(index, false, glm::quat(), 0.0f); - _skeletonModel.clearJointAnimationPriority(index); - } -} - -void MyAvatar::clearJointsData() { - clearJointAnimationPriorities(); -} - void MyAvatar::clearJointAnimationPriorities() { int numStates = _skeletonModel.getJointStateCount(); for (int i = 0; i < numStates; ++i) { diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 4fd66c0347..f208b68520 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -194,10 +194,6 @@ private: bool getDriveKeys(int key) { return _driveKeys[key] != 0.0f; }; bool isMyAvatar() const { return true; } virtual int parseDataFromBuffer(const QByteArray& buffer); - virtual void setJointRotations(QVector jointRotations); - virtual void setJointData(int index, const glm::quat& rotation); - virtual void clearJointData(int index); - virtual void clearJointsData(); virtual glm::vec3 getSkeletonPosition() const; void updateLocalAABox(); glm::vec3 getScriptedMotorVelocity() const { return _scriptedMotorVelocity; } From 5ae15d46b40877c6cac412382ef6bbda56e26637 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 27 Jul 2015 16:42:54 -0700 Subject: [PATCH 4/4] add some javascript callable stuff back to MyAvatar --- interface/src/avatar/MyAvatar.cpp | 29 ++++++++++++++++++- interface/src/avatar/MyAvatar.h | 5 ++++ interface/src/avatar/SkeletonModel.h | 42 ++++++++++++++-------------- libraries/render-utils/src/Model.cpp | 4 --- libraries/render-utils/src/Model.h | 5 ---- 5 files changed, 54 insertions(+), 31 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index fe4d4bc3cb..f29c21f114 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -900,10 +900,37 @@ glm::vec3 MyAvatar::getDefaultEyePosition() const { const float SCRIPT_PRIORITY = DEFAULT_PRIORITY + 1.0f; const float RECORDER_PRIORITY = SCRIPT_PRIORITY + 1.0f; +void MyAvatar::setJointRotations(QVector jointRotations) { + int numStates = glm::min(_skeletonModel.getJointStateCount(), jointRotations.size()); + for (int i = 0; i < numStates; ++i) { + // HACK: ATM only Recorder calls setJointRotations() so we hardcode its priority here + _skeletonModel.setJointState(i, true, jointRotations[i], RECORDER_PRIORITY); + } +} + +void MyAvatar::setJointData(int index, const glm::quat& rotation) { + if (QThread::currentThread() == thread()) { + // HACK: ATM only JS scripts call setJointData() on MyAvatar so we hardcode the priority + _rig->setJointState(index, true, rotation, SCRIPT_PRIORITY); + } +} + +void MyAvatar::clearJointData(int index) { + if (QThread::currentThread() == thread()) { + // HACK: ATM only JS scripts call clearJointData() on MyAvatar so we hardcode the priority + _rig->setJointState(index, false, glm::quat(), 0.0f); + _rig->clearJointAnimationPriority(index); + } +} + +void MyAvatar::clearJointsData() { + clearJointAnimationPriorities(); +} + void MyAvatar::clearJointAnimationPriorities() { int numStates = _skeletonModel.getJointStateCount(); for (int i = 0; i < numStates; ++i) { - _skeletonModel.clearJointAnimationPriority(i); + _rig->clearJointAnimationPriority(i); } } diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index e83deddf16..4dfe0611af 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -104,6 +104,11 @@ public: void updateLookAtTargetAvatar(); void clearLookAtTargetAvatar(); + virtual void setJointRotations(QVector jointRotations); + virtual void setJointData(int index, const glm::quat& rotation); + virtual void clearJointData(int index); + virtual void clearJointsData(); + Q_INVOKABLE void useFullAvatarURL(const QUrl& fullAvatarURL, const QString& modelName = QString()); Q_INVOKABLE void useHeadURL(const QUrl& headURL, const QString& modelName = QString()); Q_INVOKABLE void useBodyURL(const QUrl& bodyURL, const QString& modelName = QString()); diff --git a/interface/src/avatar/SkeletonModel.h b/interface/src/avatar/SkeletonModel.h index 14dc2da3f0..5d76ac1149 100644 --- a/interface/src/avatar/SkeletonModel.h +++ b/interface/src/avatar/SkeletonModel.h @@ -22,68 +22,68 @@ class MuscleConstraint; /// A skeleton loaded from a model. class SkeletonModel : public Model { Q_OBJECT - + public: SkeletonModel(Avatar* owningAvatar, QObject* parent = nullptr, RigPointer rig = nullptr); ~SkeletonModel(); - + virtual void initJointStates(QVector states); void simulate(float deltaTime, bool fullUpdate = true); void renderIKConstraints(gpu::Batch& batch); - + /// Returns the index of the left hand joint, or -1 if not found. int getLeftHandJointIndex() const { return isActive() ? _geometry->getFBXGeometry().leftHandJointIndex : -1; } - + /// Returns the index of the right hand joint, or -1 if not found. int getRightHandJointIndex() const { return isActive() ? _geometry->getFBXGeometry().rightHandJointIndex : -1; } /// Retrieve the position of the left hand /// \return true whether or not the position was found bool getLeftHandPosition(glm::vec3& position) const; - + /// Retrieve the position of the right hand /// \return true whether or not the position was found bool getRightHandPosition(glm::vec3& position) const; - + /// Restores some fraction of the default position of the left hand. /// \param fraction the fraction of the default position to restore /// \return whether or not the left hand joint was found bool restoreLeftHandPosition(float fraction = 1.0f, float priority = 1.0f); - + /// Gets the position of the left shoulder. /// \return whether or not the left shoulder joint was found bool getLeftShoulderPosition(glm::vec3& position) const; - + /// Returns the extended length from the left hand to its last free ancestor. float getLeftArmLength() const; - + /// Restores some fraction of the default position of the right hand. /// \param fraction the fraction of the default position to restore /// \return whether or not the right hand joint was found bool restoreRightHandPosition(float fraction = 1.0f, float priority = 1.0f); - + /// Gets the position of the right shoulder. /// \return whether or not the right shoulder joint was found bool getRightShoulderPosition(glm::vec3& position) const; - + /// Returns the extended length from the right hand to its first free ancestor. float getRightArmLength() const; /// Returns the position of the head joint. /// \return whether or not the head was found bool getHeadPosition(glm::vec3& headPosition) const; - + /// Returns the position of the neck joint. /// \return whether or not the neck was found bool getNeckPosition(glm::vec3& neckPosition) const; - + /// Returns the rotation of the neck joint's parent from default orientation /// \return whether or not the neck was found bool getNeckParentRotationFromDefaultOrientation(glm::quat& neckParentRotation) const; - + /// Retrieve the positions of up to two eye meshes. /// \return whether or not both eye meshes were found bool getEyePositions(glm::vec3& firstEyePosition, glm::vec3& secondEyePosition) const; @@ -119,12 +119,12 @@ protected: /// \param jointIndex index of joint in model /// \param position position of joint in model-frame void applyHandPosition(int jointIndex, const glm::vec3& position); - + void applyPalmData(int jointIndex, PalmData& palm); - + /// Updates the state of the joint at the specified index. - virtual void updateJointState(int index); - + virtual void updateJointState(int index); + void maybeUpdateLeanRotation(const JointState& parentState, int index); void maybeUpdateNeckRotation(const JointState& parentState, const FBXJoint& joint, int index); void maybeUpdateEyeRotation(const JointState& parentState, const FBXJoint& joint, int index); @@ -137,9 +137,9 @@ protected: private: void renderJointConstraints(gpu::Batch& batch, int jointIndex); - void renderOrientationDirections(gpu::Batch& batch, int jointIndex, + void renderOrientationDirections(gpu::Batch& batch, int jointIndex, glm::vec3 position, const glm::quat& orientation, float size); - + struct OrientationLineIDs { int _up; int _front; @@ -154,7 +154,7 @@ private: void setHandPosition(int jointIndex, const glm::vec3& position, const glm::quat& rotation); bool getEyeModelPositions(glm::vec3& firstEyePosition, glm::vec3& secondEyePosition) const; - + Avatar* _owningAvatar; CapsuleShape _boundingShape; diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index a316da0f99..1f7b67ef05 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -1052,10 +1052,6 @@ void Model::clearJointState(int index) { _rig->clearJointState(index); } -void Model::clearJointAnimationPriority(int index) { - _rig->clearJointAnimationPriority(index); -} - void Model::setJointState(int index, bool valid, const glm::quat& rotation, float priority) { _rig->setJointState(index, valid, rotation, priority); } diff --git a/libraries/render-utils/src/Model.h b/libraries/render-utils/src/Model.h index 45d7ce63ab..fc8347581b 100644 --- a/libraries/render-utils/src/Model.h +++ b/libraries/render-utils/src/Model.h @@ -21,7 +21,6 @@ #include #include -#include #include #include #include @@ -150,10 +149,6 @@ public: /// Sets the distance parameter used for LOD computations. void setLODDistance(float distance) { _lodDistance = distance; } - const QList& getRunningAnimations() const { return _rig->getRunningAnimations(); } - /// Clear the joint animation priority - void clearJointAnimationPriority(int index); - void setScaleToFit(bool scaleToFit, float largestDimension = 0.0f, bool forceRescale = false); bool getScaleToFit() const { return _scaleToFit; } /// is scale to fit enabled