diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-06-01 15:08:59 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-06-01 15:08:59 +0100 |
commit | e86839fac19753d0fa4006296c7f8909fe781013 (patch) | |
tree | f65f6ae403736fb48012a9334a95730f88e2ae1e /indra/llcharacter | |
parent | 39bcae574f410f93d26c95ec2398f3653678e997 (diff) |
SL-915 - WIP on dynamic joint box tracking
Diffstat (limited to 'indra/llcharacter')
-rw-r--r-- | indra/llcharacter/lljoint.cpp | 53 | ||||
-rw-r--r-- | indra/llcharacter/lljoint.h | 22 |
2 files changed, 75 insertions, 0 deletions
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 07fcd99701..68355cbbdc 100644 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -97,6 +97,46 @@ void LLVector3OverrideMap::clear() } //----------------------------------------------------------------------------- +// LLJointRiggingInfo +//----------------------------------------------------------------------------- +LLJointRiggingInfo::LLJointRiggingInfo() +{ + mRiggedExtents[0].clear(); + mRiggedExtents[1].clear(); + mIsRiggedTo = false; +} + +bool LLJointRiggingInfo::isRiggedTo() const +{ + return mIsRiggedTo; +} + +void LLJointRiggingInfo::setIsRiggedTo(bool val) +{ + mIsRiggedTo = val; +} + +LLVector4a *LLJointRiggingInfo::getRiggedExtents() +{ + return mRiggedExtents; +} + +const LLVector4a *LLJointRiggingInfo::getRiggedExtents() const +{ + return mRiggedExtents; +} + +// Combine two rigging info states. +// - isRiggedTo if either of the source infos are rigged to +// - box is union of the two sources +void LLJointRiggingInfo::merge(const LLJointRiggingInfo& other) +{ + mIsRiggedTo = mIsRiggedTo || other.mIsRiggedTo; + update_min_max(mRiggedExtents[0], mRiggedExtents[1], other.mRiggedExtents[0]); + update_min_max(mRiggedExtents[0], mRiggedExtents[1], other.mRiggedExtents[1]); +} + +//----------------------------------------------------------------------------- // LLJoint() // Class Constructor //----------------------------------------------------------------------------- @@ -598,6 +638,19 @@ void LLJoint::showAttachmentPosOverrides(const std::string& av_info) const } //-------------------------------------------------------------------- +// getRiggingInfo() +//-------------------------------------------------------------------- +LLJointRiggingInfo& LLJoint::getRiggingInfo() +{ + return mRiggingInfo; +} + +const LLJointRiggingInfo& LLJoint::getRiggingInfo() const +{ + return mRiggingInfo; +} + +//-------------------------------------------------------------------- // updatePos() //-------------------------------------------------------------------- void LLJoint::updatePos(const std::string& av_info) diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 8112d246f2..ff1e967188 100644 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -70,6 +70,23 @@ private: map_type m_map; }; +// Stores information related to associated rigged mesh vertices +// Extents are in joint space +// isRiggedTo is based on the state of all currently associated rigged meshes +class LLJointRiggingInfo +{ +public: + LLJointRiggingInfo(); + bool isRiggedTo() const; + void setIsRiggedTo(bool val); + LLVector4a *getRiggedExtents(); + const LLVector4a *getRiggedExtents() const; + void merge(const LLJointRiggingInfo& other); +private: + LL_ALIGN_16(LLVector4a mRiggedExtents[2]); + bool mIsRiggedTo; +}; + inline bool operator==(const LLVector3OverrideMap& a, const LLVector3OverrideMap& b) { return a.getMap() == b.getMap(); @@ -158,6 +175,11 @@ public: LLVector3OverrideMap m_attachmentScaleOverrides; LLVector3 m_scaleBeforeOverrides; + // Rigging Info + LLJointRiggingInfo mRiggingInfo; + LLJointRiggingInfo& getRiggingInfo(); + const LLJointRiggingInfo& getRiggingInfo() const; + void updatePos(const std::string& av_info); void updateScale(const std::string& av_info); |