From 33f66ac2344f996a2310b179173232b98c8bd026 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 27 Aug 2014 16:52:52 -0400 Subject: WIP on attachment offset management in joints --- indra/llcharacter/lljoint.h | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'indra/llcharacter/lljoint.h') diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index b65d6979d4..f6f1cd2fe4 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -88,8 +88,6 @@ public: U32 mDirtyFlags; BOOL mUpdateXform; - BOOL mResetAfterRestoreOldXform; - // describes the skin binding pose LLVector3 mSkinOffset; @@ -103,6 +101,25 @@ public: static S32 sNumTouches; static S32 sNumUpdates; + struct AttachmentOverrideRecord + { + AttachmentOverrideRecord() + { + } + LLVector3 pos; + std::string name; + + bool operator<(const AttachmentOverrideRecord& other) const + { + return name < other.name; + } + }; + typedef std::map attachment_map_t; + attachment_map_t m_attachmentOverrides; + LLVector3 m_posBeforeOverrides; + + void updatePos(); + public: LLJoint(); LLJoint(S32 joint_num); @@ -188,15 +205,13 @@ public: void setDefaultFromCurrentXform( void ); void storeCurrentXform( const LLVector3& pos ); + void addAttachmentPosOverride( const LLVector3& pos, const std::string& attachment_name ); + void removeAttachmentPosOverride( const std::string& attachment_name ); + //Accessor for the joint id LLUUID getId( void ) { return mId; } //Setter for the joints id void setId( const LLUUID& id ) { mId = id;} - - //If the old transform flag has been set, then the reset logic in avatar needs to be aware(test) of it - const BOOL doesJointNeedToBeReset( void ) const { return mResetAfterRestoreOldXform; } - void setJointResetFlag( bool val ) { mResetAfterRestoreOldXform = val; } - }; #endif // LL_LLJOINT_H -- cgit v1.2.3 From 2cb14c7fdcf835816176d6edc0c05b99bcb39873 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 28 Aug 2014 17:32:22 -0400 Subject: MAINT-4158 WIP - track position overrides requested by attachments so they can be undone intelligently --- indra/llcharacter/lljoint.h | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'indra/llcharacter/lljoint.h') diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index f6f1cd2fe4..0ef054d9c1 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -79,8 +79,6 @@ protected: // explicit transformation members LLXformMatrix mXform; - LLXformMatrix mOldXform; - LLXformMatrix mDefaultXform; LLUUID mId; @@ -103,16 +101,9 @@ public: struct AttachmentOverrideRecord { - AttachmentOverrideRecord() - { - } + AttachmentOverrideRecord(); LLVector3 pos; std::string name; - - bool operator<(const AttachmentOverrideRecord& other) const - { - return name < other.name; - } }; typedef std::map attachment_map_t; attachment_map_t m_attachmentOverrides; @@ -177,7 +168,7 @@ public: // get/set local scale const LLVector3& getScale(); void setScale( const LLVector3& scale ); - void storeScaleForReset( const LLVector3& scale ); + // get/set world matrix const LLMatrix4 &getWorldMatrix(); void setWorldMatrix( const LLMatrix4& mat ); @@ -200,10 +191,6 @@ public: virtual BOOL isAnimatable() const { return TRUE; } S32 getJointNum() const { return mJointNum; } - - void restoreOldXform( void ); - void setDefaultFromCurrentXform( void ); - void storeCurrentXform( const LLVector3& pos ); void addAttachmentPosOverride( const LLVector3& pos, const std::string& attachment_name ); void removeAttachmentPosOverride( const std::string& attachment_name ); -- cgit v1.2.3 From b6ad3bd54dd4d48a0b984bc92a31bab7c9f90e75 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 8 Oct 2014 11:45:12 -0400 Subject: Switched to keying joint offsets by mesh id --- indra/llcharacter/lljoint.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'indra/llcharacter/lljoint.h') diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 0ef054d9c1..951cafad94 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -103,13 +103,12 @@ public: { AttachmentOverrideRecord(); LLVector3 pos; - std::string name; }; - typedef std::map attachment_map_t; + typedef std::map attachment_map_t; attachment_map_t m_attachmentOverrides; LLVector3 m_posBeforeOverrides; - void updatePos(); + void updatePos(const std::string& av_info); public: LLJoint(); @@ -192,8 +191,8 @@ public: S32 getJointNum() const { return mJointNum; } - void addAttachmentPosOverride( const LLVector3& pos, const std::string& attachment_name ); - void removeAttachmentPosOverride( const std::string& attachment_name ); + void addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh_id, const std::string& av_info ); + void removeAttachmentPosOverride( const LLUUID& mesh_id, const std::string& av_info ); //Accessor for the joint id LLUUID getId( void ) { return mId; } -- cgit v1.2.3 From 5c8d902c1bab6f0577750e8e2470384a31880947 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 17 Oct 2014 15:00:18 -0400 Subject: SL-93 WIP - refactoring LLPosOverrideMap for reusability --- indra/llcharacter/lljoint.h | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'indra/llcharacter/lljoint.h') diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 951cafad94..f8639af3de 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -46,6 +46,20 @@ const U32 LL_FACE_JOINT_NUM = 30; const S32 LL_CHARACTER_MAX_PRIORITY = 7; const F32 LL_MAX_PELVIS_OFFSET = 5.f; +class LLPosOverrideMap +{ +public: + LLPosOverrideMap() {} + bool findActiveOverride(LLUUID& mesh_id, LLVector3& pos) const; + void showJointPosOverrides(std::ostringstream& os) const; + U32 count() const; + void add(const LLUUID& mesh_id, const LLVector3& pos); + bool remove(const LLUUID& mesh_id); +private: + typedef std::map map_type; + map_type m_map; +}; + //----------------------------------------------------------------------------- // class LLJoint //----------------------------------------------------------------------------- @@ -99,13 +113,7 @@ public: static S32 sNumTouches; static S32 sNumUpdates; - struct AttachmentOverrideRecord - { - AttachmentOverrideRecord(); - LLVector3 pos; - }; - typedef std::map attachment_map_t; - attachment_map_t m_attachmentOverrides; + LLPosOverrideMap m_attachmentOverrides; LLVector3 m_posBeforeOverrides; void updatePos(const std::string& av_info); -- cgit v1.2.3 From 7fec81b102e92e1a4e5a36fde077ef9b82cc7123 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 3 Nov 2014 05:46:31 -0500 Subject: SL-93 WIP - pelvis fixup offsets --- indra/llcharacter/lljoint.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llcharacter/lljoint.h') diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index f8639af3de..56da8e83b2 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -201,6 +201,7 @@ public: void addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh_id, const std::string& av_info ); void removeAttachmentPosOverride( const LLUUID& mesh_id, const std::string& av_info ); + bool hasAttachmentPosOverride( LLVector3& pos, LLUUID& mesh_id ) const; //Accessor for the joint id LLUUID getId( void ) { return mId; } -- cgit v1.2.3 From b1884d40f5ba74d1d39be1abad7dc416905c6caf Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Sat, 15 Nov 2014 14:29:39 -0500 Subject: MAINT-4537 WIP - more joint position management during outfit changes --- indra/llcharacter/lljoint.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llcharacter/lljoint.h') diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 56da8e83b2..2abe1d6db1 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -55,6 +55,7 @@ public: U32 count() const; void add(const LLUUID& mesh_id, const LLVector3& pos); bool remove(const LLUUID& mesh_id); + void clear(); private: typedef std::map map_type; map_type m_map; @@ -202,6 +203,7 @@ public: void addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh_id, const std::string& av_info ); void removeAttachmentPosOverride( const LLUUID& mesh_id, const std::string& av_info ); bool hasAttachmentPosOverride( LLVector3& pos, LLUUID& mesh_id ) const; + void clearAttachmentPosOverrides(); //Accessor for the joint id LLUUID getId( void ) { return mId; } -- cgit v1.2.3