diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/lldriverparam.h | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/newview/lldriverparam.h')
-rw-r--r-- | linden/indra/newview/lldriverparam.h | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/linden/indra/newview/lldriverparam.h b/linden/indra/newview/lldriverparam.h new file mode 100644 index 0000000..b40d5d9 --- /dev/null +++ b/linden/indra/newview/lldriverparam.h | |||
@@ -0,0 +1,109 @@ | |||
1 | /** | ||
2 | * @file lldriverparam.h | ||
3 | * @brief A visual parameter that drives (controls) other visual parameters. | ||
4 | * | ||
5 | * Copyright (c) 2002-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #ifndef LL_LLDRIVERPARAM_H | ||
29 | #define LL_LLDRIVERPARAM_H | ||
30 | |||
31 | #include "llvoavatar.h" | ||
32 | #include "llviewervisualparam.h" | ||
33 | |||
34 | //----------------------------------------------------------------------------- | ||
35 | |||
36 | struct LLDrivenEntryInfo | ||
37 | { | ||
38 | LLDrivenEntryInfo( S32 id, F32 min1, F32 max1, F32 max2, F32 min2 ) | ||
39 | : mDrivenID( id ), mMin1( min1 ), mMax1( max1 ), mMax2( max2 ), mMin2( min2 ) {} | ||
40 | S32 mDrivenID; | ||
41 | F32 mMin1; | ||
42 | F32 mMax1; | ||
43 | F32 mMax2; | ||
44 | F32 mMin2; | ||
45 | }; | ||
46 | |||
47 | struct LLDrivenEntry | ||
48 | { | ||
49 | LLDrivenEntry( LLViewerVisualParam* param, LLDrivenEntryInfo *info ) | ||
50 | : mParam( param ), mInfo( info ) {} | ||
51 | LLViewerVisualParam* mParam; | ||
52 | LLDrivenEntryInfo* mInfo; | ||
53 | }; | ||
54 | |||
55 | //----------------------------------------------------------------------------- | ||
56 | |||
57 | class LLDriverParamInfo : public LLViewerVisualParamInfo | ||
58 | { | ||
59 | friend class LLDriverParam; | ||
60 | public: | ||
61 | LLDriverParamInfo(); | ||
62 | /*virtual*/ ~LLDriverParamInfo() {}; | ||
63 | |||
64 | /*virtual*/ BOOL parseXml(LLXmlTreeNode* node); | ||
65 | |||
66 | protected: | ||
67 | typedef std::deque<LLDrivenEntryInfo> entry_info_list_t; | ||
68 | entry_info_list_t mDrivenInfoList; | ||
69 | }; | ||
70 | |||
71 | //----------------------------------------------------------------------------- | ||
72 | |||
73 | class LLDriverParam : public LLViewerVisualParam | ||
74 | { | ||
75 | public: | ||
76 | LLDriverParam(LLVOAvatar *avatarp); | ||
77 | ~LLDriverParam(); | ||
78 | |||
79 | // Special: These functions are overridden by child classes | ||
80 | LLDriverParamInfo* getInfo() const { return (LLDriverParamInfo*)mInfo; } | ||
81 | // This sets mInfo and calls initialization functions | ||
82 | BOOL setInfo(LLDriverParamInfo *info); | ||
83 | |||
84 | // LLVisualParam Virtual functions | ||
85 | ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); | ||
86 | /*virtual*/ void apply( ESex sex ) {} // apply is called separately for each driven param. | ||
87 | /*virtual*/ void setWeight(F32 weight, BOOL set_by_user); | ||
88 | /*virtual*/ void setAnimationTarget( F32 target_value, BOOL set_by_user ); | ||
89 | /*virtual*/ void stopAnimating(BOOL set_by_user); | ||
90 | |||
91 | // LLViewerVisualParam Virtual functions | ||
92 | /*virtual*/ F32 getTotalDistortion(); | ||
93 | /*virtual*/ const LLVector3& getAvgDistortion(); | ||
94 | /*virtual*/ F32 getMaxDistortion(); | ||
95 | /*virtual*/ LLVector3 getVertexDistortion(S32 index, LLPolyMesh *poly_mesh); | ||
96 | /*virtual*/ const LLVector3* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh); | ||
97 | /*virtual*/ const LLVector3* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh); | ||
98 | protected: | ||
99 | F32 getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight); | ||
100 | |||
101 | |||
102 | LLVector3 mDefaultVec; // temp holder | ||
103 | typedef std::vector<LLDrivenEntry> entry_list_t; | ||
104 | entry_list_t mDriven; | ||
105 | LLViewerVisualParam* mCurrentDistortionParam; | ||
106 | LLVOAvatar* mAvatarp; | ||
107 | }; | ||
108 | |||
109 | #endif // LL_LLDRIVERPARAM_H | ||