diff options
Diffstat (limited to 'linden/indra/newview/emeraldboobutils.h')
-rw-r--r-- | linden/indra/newview/emeraldboobutils.h | 197 |
1 files changed, 197 insertions, 0 deletions
diff --git a/linden/indra/newview/emeraldboobutils.h b/linden/indra/newview/emeraldboobutils.h new file mode 100644 index 0000000..26008f9 --- /dev/null +++ b/linden/indra/newview/emeraldboobutils.h | |||
@@ -0,0 +1,197 @@ | |||
1 | #ifndef __emeraldboobutils_h | ||
2 | #define __emeraldboobutils_h | ||
3 | |||
4 | #include <iostream> | ||
5 | #include <list> | ||
6 | |||
7 | #include "stdtypes.h" | ||
8 | #include "v3math.h" | ||
9 | #include "llquaternion.h" | ||
10 | |||
11 | struct EmeraldGlobalBoobConfig | ||
12 | { | ||
13 | bool enabled; | ||
14 | F32 mass; | ||
15 | F32 hardness; | ||
16 | F32 zMax; | ||
17 | F32 velMin; | ||
18 | F32 velMax; | ||
19 | F32 zInfluence; | ||
20 | F32 friction; | ||
21 | F32 XYInfluence; | ||
22 | |||
23 | EmeraldGlobalBoobConfig() | ||
24 | : enabled(false), | ||
25 | mass(6.4f), | ||
26 | hardness(0.67f), | ||
27 | zMax(1.29f), | ||
28 | velMin(0.0027f*0.017f), | ||
29 | velMax(0.0027f), | ||
30 | zInfluence(0.0f), | ||
31 | friction(0.35f), | ||
32 | XYInfluence(0.3f) | ||
33 | { | ||
34 | } | ||
35 | |||
36 | bool operator==(const EmeraldGlobalBoobConfig &other) const | ||
37 | { | ||
38 | return | ||
39 | enabled == other.enabled && | ||
40 | mass == other.mass && | ||
41 | zMax == other.zMax && | ||
42 | velMax == other.velMax && | ||
43 | velMin == other.velMin && | ||
44 | zInfluence == other.zInfluence && | ||
45 | XYInfluence == other.XYInfluence && | ||
46 | friction == other.friction; | ||
47 | } | ||
48 | }; | ||
49 | |||
50 | std::ostream &operator<<(std::ostream &os, const EmeraldGlobalBoobConfig &v); | ||
51 | |||
52 | struct EmeraldAvatarLocalBoobConfig | ||
53 | { | ||
54 | F32 actualBoobGrav; | ||
55 | F32 actualButtGrav; | ||
56 | F32 actualFatGrav; | ||
57 | F32 boobSize; | ||
58 | |||
59 | EmeraldAvatarLocalBoobConfig() | ||
60 | : actualBoobGrav(0.0f), | ||
61 | actualButtGrav(0.0f), | ||
62 | actualFatGrav(0.0f), | ||
63 | boobSize(0.0f) | ||
64 | { | ||
65 | } | ||
66 | |||
67 | bool operator==(const EmeraldAvatarLocalBoobConfig &other) const | ||
68 | { | ||
69 | return | ||
70 | actualBoobGrav == other.actualBoobGrav && | ||
71 | actualButtGrav == other.actualButtGrav && | ||
72 | actualFatGrav == other.actualFatGrav && | ||
73 | boobSize == other.boobSize; | ||
74 | } | ||
75 | |||
76 | }; | ||
77 | |||
78 | std::ostream &operator<<(std::ostream &os, const EmeraldAvatarLocalBoobConfig &v); | ||
79 | |||
80 | struct EmeraldBoobBounceState; | ||
81 | |||
82 | struct EmeraldBoobState | ||
83 | { | ||
84 | F32 boobGrav; | ||
85 | LLVector3 chestPosition; | ||
86 | LLQuaternion chestRotation; | ||
87 | F32 elapsedTime; | ||
88 | F32 frameDuration; | ||
89 | LLVector3 chestDisplacement; | ||
90 | LLVector3 localChestDisplacement; | ||
91 | LLVector3 displacementForce; | ||
92 | F32 mysteryValue; | ||
93 | std::list<EmeraldBoobBounceState> bounceStates; | ||
94 | |||
95 | EmeraldBoobState() | ||
96 | : boobGrav(0.0f), | ||
97 | chestPosition(0.0f,0.0f,0.0f), | ||
98 | chestRotation(0.0f,0.0f,0.0f,1.0f), | ||
99 | elapsedTime(0.0f), | ||
100 | frameDuration(0.0f), | ||
101 | chestDisplacement(0.0f,0.0f,0.0f), | ||
102 | localChestDisplacement(0.0f,0.0f,0.0f), | ||
103 | displacementForce(0.0f,0.0f,0.0f), | ||
104 | mysteryValue(0.0f) | ||
105 | { | ||
106 | } | ||
107 | |||
108 | bool operator==(const EmeraldBoobState &other) const | ||
109 | { | ||
110 | return | ||
111 | boobGrav == other.boobGrav && | ||
112 | chestPosition == other.chestPosition && | ||
113 | chestRotation == other.chestRotation && | ||
114 | elapsedTime == other.elapsedTime && | ||
115 | frameDuration == other.frameDuration && | ||
116 | chestDisplacement == other.chestDisplacement && | ||
117 | localChestDisplacement == other.localChestDisplacement && | ||
118 | displacementForce == other.displacementForce && | ||
119 | mysteryValue == other.mysteryValue && | ||
120 | bounceStates == other.bounceStates; | ||
121 | } | ||
122 | }; | ||
123 | |||
124 | std::ostream &operator<<(std::ostream &os, const EmeraldBoobState &v); | ||
125 | |||
126 | struct EmeraldBoobInputs | ||
127 | { | ||
128 | LLVector3 chestPosition; | ||
129 | LLQuaternion chestRotation; | ||
130 | F32 elapsedTime; | ||
131 | bool appearanceFlag; | ||
132 | bool appearanceAnimating; | ||
133 | S32 type; | ||
134 | |||
135 | EmeraldBoobInputs() | ||
136 | : chestPosition(0.0f,0.0f,0.0f), | ||
137 | chestRotation(0.0f,0.0f,0.0f,1.0f), | ||
138 | elapsedTime(0.0f), | ||
139 | appearanceFlag(false), | ||
140 | appearanceAnimating(false), | ||
141 | type(0) | ||
142 | { | ||
143 | } | ||
144 | |||
145 | bool operator==(const EmeraldBoobInputs &other) const | ||
146 | { | ||
147 | return | ||
148 | chestPosition == other.chestPosition && | ||
149 | chestRotation == other.chestRotation && | ||
150 | elapsedTime == other.elapsedTime && | ||
151 | appearanceFlag == other.appearanceFlag && | ||
152 | appearanceAnimating == other.appearanceAnimating && | ||
153 | type == other.type; | ||
154 | } | ||
155 | }; | ||
156 | |||
157 | std::ostream &operator<<(std::ostream &os, const EmeraldBoobInputs &v); | ||
158 | |||
159 | struct EmeraldBoobBounceState | ||
160 | { | ||
161 | F32 bounceStart; | ||
162 | F32 bounceStartAmplitude; | ||
163 | F32 bounceStartFrameDuration; | ||
164 | |||
165 | EmeraldBoobBounceState() | ||
166 | : bounceStart(0.0f), | ||
167 | bounceStartAmplitude(0.0f), | ||
168 | bounceStartFrameDuration(0.0f) | ||
169 | { | ||
170 | }; | ||
171 | |||
172 | bool operator==(const EmeraldBoobBounceState &other) const | ||
173 | { | ||
174 | return | ||
175 | bounceStart == other.bounceStart && | ||
176 | bounceStartAmplitude == other.bounceStartAmplitude && | ||
177 | bounceStartFrameDuration == other.bounceStartFrameDuration; | ||
178 | } | ||
179 | }; | ||
180 | |||
181 | std::ostream &operator<<(std::ostream &os, const EmeraldBoobBounceState &v); | ||
182 | |||
183 | |||
184 | struct EmeraldBoobUtils | ||
185 | { | ||
186 | public: | ||
187 | static EmeraldBoobState idleUpdate(const EmeraldGlobalBoobConfig &config, const EmeraldAvatarLocalBoobConfig &localConfig, const EmeraldBoobState &oldState, const EmeraldBoobInputs &inputs); | ||
188 | |||
189 | static F32 convertMass(F32 displayMass); | ||
190 | static F32 convertHardness(F32 displayHardness); | ||
191 | static F32 convertVelMax(F32 displayVelMax); | ||
192 | static F32 convertFriction(F32 displayFriction); | ||
193 | static F32 convertVelMin(F32 displayVelMin); | ||
194 | }; | ||
195 | |||
196 | |||
197 | #endif | ||