diff options
Diffstat (limited to 'indra/llcharacter')
| -rw-r--r-- | indra/llcharacter/CMakeLists.txt | 16 | ||||
| -rw-r--r-- | indra/llcharacter/llcharacter.cpp | 25 | ||||
| -rw-r--r-- | indra/llcharacter/llcharacter.h | 1 | ||||
| -rw-r--r-- | indra/llcharacter/lleditingmotion.h | 15 | ||||
| -rw-r--r-- | indra/llcharacter/lljoint.h | 7 | ||||
| -rw-r--r-- | indra/llcharacter/llkeyframemotion.cpp | 2 | ||||
| -rw-r--r-- | indra/llcharacter/llkeyframestandmotion.h | 5 | ||||
| -rw-r--r-- | indra/llcharacter/llpose.h | 7 | ||||
| -rw-r--r-- | indra/llcharacter/llvisualparam.h | 6 |
9 files changed, 61 insertions, 23 deletions
diff --git a/indra/llcharacter/CMakeLists.txt b/indra/llcharacter/CMakeLists.txt index 6795652136..9e35555d78 100644 --- a/indra/llcharacter/CMakeLists.txt +++ b/indra/llcharacter/CMakeLists.txt @@ -68,3 +68,19 @@ target_link_libraries( ) include(LibraryInstall) + +if (USE_PRECOMPILED_HEADERS) + target_precompile_headers(llcharacter REUSE_FROM llprecompiled) +endif () + + +if (LL_TESTS) + include(LLAddBuildTest) +# SET(llcharacter_TEST_SOURCE_FILES +# ) +# LL_ADD_PROJECT_UNIT_TESTS(llcharacter "${llcharacter_TEST_SOURCE_FILES}") + + #set(TEST_DEBUG on) + set(test_libs llcommon llmath) + LL_ADD_INTEGRATION_TEST(lljoint "lljoint.cpp" "${test_libs}") +endif() diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp index 8efcd9dd29..6a66c06b62 100644 --- a/indra/llcharacter/llcharacter.cpp +++ b/indra/llcharacter/llcharacter.cpp @@ -307,6 +307,31 @@ bool LLCharacter::setVisualParamWeight(S32 index, F32 weight) } //----------------------------------------------------------------------------- +// setVisualParamWeight() +//----------------------------------------------------------------------------- +bool LLCharacter::setVisualParamWeight(S32 index, S32 type, F32 weight) +{ + visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index); + if (index_iter != mVisualParamIndexMap.end()) + { + LLVisualParam* param = index_iter->second; + if (param->getWearableType() == type) + { + param->setWeight(weight); + return true; + } + else + { + // setVisualParamWeight at the moment is only used in writeToAvatar. + // The type is supposed to match since wearable is a subset of avatar by type. + llassert(false); + LL_WARNS() << "Visual param index " << index << " is not of type " << type << LL_ENDL; + } + } + return false; +} + +//----------------------------------------------------------------------------- // getVisualParamWeight() //----------------------------------------------------------------------------- F32 LLCharacter::getVisualParamWeight(LLVisualParam *which_param) diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index 079bcd132a..689e3f7d7c 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -195,6 +195,7 @@ public: virtual bool setVisualParamWeight(const LLVisualParam *which_param, F32 weight); virtual bool setVisualParamWeight(const char* param_name, F32 weight); virtual bool setVisualParamWeight(S32 index, F32 weight); + virtual bool setVisualParamWeight(S32 index, S32 type, F32 weight); // get visual param weight by param or name F32 getVisualParamWeight(LLVisualParam *distortion); diff --git a/indra/llcharacter/lleditingmotion.h b/indra/llcharacter/lleditingmotion.h index f94756d43d..a3c0ee94b7 100644 --- a/indra/llcharacter/lleditingmotion.h +++ b/indra/llcharacter/lleditingmotion.h @@ -42,8 +42,7 @@ //----------------------------------------------------------------------------- // class LLEditingMotion //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLEditingMotion : +class alignas(16) LLEditingMotion : public LLMotion { LL_ALIGN_NEW @@ -110,11 +109,11 @@ public: //------------------------------------------------------------------------- // joint states to be animated //------------------------------------------------------------------------- - LL_ALIGN_16(LLJoint mParentJoint); - LL_ALIGN_16(LLJoint mShoulderJoint); - LL_ALIGN_16(LLJoint mElbowJoint); - LL_ALIGN_16(LLJoint mWristJoint); - LL_ALIGN_16(LLJoint mTarget); + LLJoint mParentJoint; + LLJoint mShoulderJoint; + LLJoint mElbowJoint; + LLJoint mWristJoint; + LLJoint mTarget; LLJointSolverRP3 mIKSolver; LLCharacter *mCharacter; @@ -129,7 +128,7 @@ public: static S32 sHandPose; static S32 sHandPosePriority; LLVector3 mLastSelectPt; -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLKEYFRAMEMOTION_H diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index b58dc797f8..481fb0a1bb 100644 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -86,8 +86,7 @@ inline bool operator!=(const LLVector3OverrideMap& a, const LLVector3OverrideMap //----------------------------------------------------------------------------- // class LLJoint //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLJoint +class alignas(16) LLJoint { LL_ALIGN_NEW public: @@ -118,7 +117,7 @@ public: }; protected: // explicit transformation members - LL_ALIGN_16(LLMatrix4a mWorldMatrix); + LLMatrix4a mWorldMatrix; LLXformMatrix mXform; std::string mName; @@ -302,6 +301,6 @@ public: // These are used in checks of whether a pos/scale override is considered significant. bool aboveJointPosThreshold(const LLVector3& pos) const; bool aboveJointScaleThreshold(const LLVector3& scale) const; -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLJOINT_H diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index be1c74a908..4e5a920230 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -589,7 +589,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact } else { - LL_WARNS() << "Failed to allocate buffer: " << anim_file_size << mID << LL_ENDL; + LL_WARNS() << "Failed to allocate buffer: " << anim_file_size << " " << mID << LL_ENDL; } delete anim_file; anim_file = NULL; diff --git a/indra/llcharacter/llkeyframestandmotion.h b/indra/llcharacter/llkeyframestandmotion.h index df458c7a0c..7d1acb7c5a 100644 --- a/indra/llcharacter/llkeyframestandmotion.h +++ b/indra/llcharacter/llkeyframestandmotion.h @@ -37,8 +37,7 @@ //----------------------------------------------------------------------------- // class LLKeyframeStandMotion //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLKeyframeStandMotion : +class alignas(16) LLKeyframeStandMotion : public LLKeyframeMotion { LL_ALIGN_NEW @@ -112,7 +111,7 @@ public: bool mTrackAnkles; S32 mFrameNum; -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLKEYFRAMESTANDMOTION_H diff --git a/indra/llcharacter/llpose.h b/indra/llcharacter/llpose.h index f2032220e0..fbcd482211 100644 --- a/indra/llcharacter/llpose.h +++ b/indra/llcharacter/llpose.h @@ -80,8 +80,7 @@ public: const S32 JSB_NUM_JOINT_STATES = 6; -LL_ALIGN_PREFIX(16) -class LLJointStateBlender +class alignas(16) LLJointStateBlender { LL_ALIGN_NEW protected: @@ -98,8 +97,8 @@ public: void resetCachedJoint(); public: - LL_ALIGN_16(LLJoint mJointCache); -} LL_ALIGN_POSTFIX(16); + LLJoint mJointCache; +}; class LLMotion; diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h index 8d2c4a3723..edaecaf96e 100644 --- a/indra/llcharacter/llvisualparam.h +++ b/indra/llcharacter/llvisualparam.h @@ -101,8 +101,7 @@ protected: // An interface class for a generalized parametric modification of the avatar mesh // Contains data that is specific to each Avatar //----------------------------------------------------------------------------- -LL_ALIGN_PREFIX(16) -class LLVisualParam +class alignas(16) LLVisualParam { public: typedef std::function<LLVisualParam*(S32)> visual_param_mapper; @@ -120,6 +119,7 @@ public: // Pure virtuals //virtual bool parseData( LLXmlTreeNode *node ) = 0; virtual void apply( ESex avatar_sex ) = 0; + virtual S32 getWearableType() const = 0; // Default functions virtual void setWeight(F32 weight); virtual void setAnimationTarget( F32 target_value); @@ -181,6 +181,6 @@ protected: S32 mID; // id for storing weight/morphtarget compares compactly LLVisualParamInfo *mInfo; EParamLocation mParamLocation; // where does this visual param live? -} LL_ALIGN_POSTFIX(16); +}; #endif // LL_LLVisualParam_H |
