diff options
Diffstat (limited to 'indra/llcharacter')
-rw-r--r-- | indra/llcharacter/llcharacter.h | 6 | ||||
-rw-r--r-- | indra/llcharacter/llvisualparam.cpp | 29 | ||||
-rw-r--r-- | indra/llcharacter/llvisualparam.h | 12 | ||||
-rw-r--r-- | indra/llcharacter/tests/lljoint_test.cpp | 2 |
4 files changed, 45 insertions, 4 deletions
diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index cd8f9e63fb..1507686f67 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -203,9 +203,9 @@ public: void addVisualParam(LLVisualParam *param); void addSharedVisualParam(LLVisualParam *param); - BOOL setVisualParamWeight(LLVisualParam *which_param, F32 weight, BOOL set_by_user = FALSE ); - BOOL setVisualParamWeight(const char* param_name, F32 weight, BOOL set_by_user = FALSE ); - BOOL setVisualParamWeight(S32 index, F32 weight, BOOL set_by_user = FALSE ); + virtual BOOL setVisualParamWeight(LLVisualParam *which_param, F32 weight, BOOL set_by_user = FALSE ); + virtual BOOL setVisualParamWeight(const char* param_name, F32 weight, BOOL set_by_user = FALSE ); + virtual BOOL setVisualParamWeight(S32 index, F32 weight, BOOL set_by_user = FALSE ); // get visual param weight by param or name F32 getVisualParamWeight(LLVisualParam *distortion); diff --git a/indra/llcharacter/llvisualparam.cpp b/indra/llcharacter/llvisualparam.cpp index d7a144e00c..c4763c6331 100644 --- a/indra/llcharacter/llvisualparam.cpp +++ b/indra/llcharacter/llvisualparam.cpp @@ -147,6 +147,21 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node) return TRUE; } +//virtual +void LLVisualParamInfo::toStream(std::ostream &out) +{ + out << mID << "\t"; + out << mName << "\t"; + out << mDisplayName << "\t"; + out << mMinName << "\t"; + out << mMaxName << "\t"; + out << mGroup << "\t"; + out << mMinWeight << "\t"; + out << mMaxWeight << "\t"; + out << mDefaultWeight << "\t"; + out << mSex << "\t"; +} + //----------------------------------------------------------------------------- // LLVisualParam() //----------------------------------------------------------------------------- @@ -288,3 +303,17 @@ void LLVisualParam::stopAnimating(BOOL set_by_user) setWeight(mTargetWeight, set_by_user); } } + +//virtual +BOOL LLVisualParam::linkDrivenParams(visual_param_mapper mapper, bool only_cross_params) +{ + // nothing to do for non-driver parameters + return TRUE; +} + +//virtual +void LLVisualParam::resetDrivenParams() +{ + // nothing to do for non-driver parameters + return; +} diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h index 25c41e8509..e6503d611d 100644 --- a/indra/llcharacter/llvisualparam.h +++ b/indra/llcharacter/llvisualparam.h @@ -36,6 +36,7 @@ #include "v3math.h" #include "llstring.h" #include "llxmltree.h" +#include <boost/function.hpp> class LLPolyMesh; class LLXmlTreeNode; @@ -68,6 +69,10 @@ public: virtual ~LLVisualParamInfo() {}; virtual BOOL parseXml(LLXmlTreeNode *node); + + S32 getID() const { return mID; } + + virtual void toStream(std::ostream &out); protected: S32 mID; // ID associated with VisualParam @@ -91,6 +96,9 @@ protected: //----------------------------------------------------------------------------- class LLVisualParam { +protected: + typedef boost::function<LLVisualParam*(S32)> visual_param_mapper; + public: LLVisualParam(); virtual ~LLVisualParam(); @@ -111,6 +119,9 @@ public: virtual void animate(F32 delta, BOOL set_by_user); virtual void stopAnimating(BOOL set_by_user); + virtual BOOL linkDrivenParams(visual_param_mapper mapper, bool only_cross_params); + virtual void resetDrivenParams(); + // Interface methods S32 getID() const { return mID; } void setID(S32 id) { llassert(!mInfo); mID = id; } @@ -150,6 +161,7 @@ protected: S32 mID; // id for storing weight/morphtarget compares compactly LLVisualParamInfo *mInfo; + }; #endif // LL_LLVisualParam_H diff --git a/indra/llcharacter/tests/lljoint_test.cpp b/indra/llcharacter/tests/lljoint_test.cpp index e43e164dd1..06e455883b 100644 --- a/indra/llcharacter/tests/lljoint_test.cpp +++ b/indra/llcharacter/tests/lljoint_test.cpp @@ -1,5 +1,5 @@ /** - * @file lljoint_tut.cpp + * @file lljoint_test.cpp * @author Adroit * @date 2007-03 * @brief lljoint test cases. |