00001
00032 #ifndef LL_LLDRIVERPARAM_H
00033 #define LL_LLDRIVERPARAM_H
00034
00035 #include "llvoavatar.h"
00036 #include "llviewervisualparam.h"
00037
00038
00039
00040 struct LLDrivenEntryInfo
00041 {
00042 LLDrivenEntryInfo( S32 id, F32 min1, F32 max1, F32 max2, F32 min2 )
00043 : mDrivenID( id ), mMin1( min1 ), mMax1( max1 ), mMax2( max2 ), mMin2( min2 ) {}
00044 S32 mDrivenID;
00045 F32 mMin1;
00046 F32 mMax1;
00047 F32 mMax2;
00048 F32 mMin2;
00049 };
00050
00051 struct LLDrivenEntry
00052 {
00053 LLDrivenEntry( LLViewerVisualParam* param, LLDrivenEntryInfo *info )
00054 : mParam( param ), mInfo( info ) {}
00055 LLViewerVisualParam* mParam;
00056 LLDrivenEntryInfo* mInfo;
00057 };
00058
00059
00060
00061 class LLDriverParamInfo : public LLViewerVisualParamInfo
00062 {
00063 friend class LLDriverParam;
00064 public:
00065 LLDriverParamInfo();
00066 ~LLDriverParamInfo() {};
00067
00068 BOOL parseXml(LLXmlTreeNode* node);
00069
00070 protected:
00071 typedef std::deque<LLDrivenEntryInfo> entry_info_list_t;
00072 entry_info_list_t mDrivenInfoList;
00073 };
00074
00075
00076
00077 class LLDriverParam : public LLViewerVisualParam
00078 {
00079 public:
00080 LLDriverParam(LLVOAvatar *avatarp);
00081 ~LLDriverParam();
00082
00083
00084 LLDriverParamInfo* getInfo() const { return (LLDriverParamInfo*)mInfo; }
00085
00086 BOOL setInfo(LLDriverParamInfo *info);
00087
00088
00090 void apply( ESex sex ) {}
00091 void setWeight(F32 weight, BOOL set_by_user);
00092 void setAnimationTarget( F32 target_value, BOOL set_by_user );
00093 void stopAnimating(BOOL set_by_user);
00094
00095
00096 F32 getTotalDistortion();
00097 const LLVector3& getAvgDistortion();
00098 F32 getMaxDistortion();
00099 LLVector3 getVertexDistortion(S32 index, LLPolyMesh *poly_mesh);
00100 const LLVector3* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh);
00101 const LLVector3* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh);
00102 protected:
00103 F32 getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight);
00104
00105
00106 LLVector3 mDefaultVec;
00107 typedef std::vector<LLDrivenEntry> entry_list_t;
00108 entry_list_t mDriven;
00109 LLViewerVisualParam* mCurrentDistortionParam;
00110
00111 LLVOAvatar* mAvatarp;
00112 };
00113
00114 #endif // LL_LLDRIVERPARAM_H