aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcharacter
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:27 -0500
committerJacek Antonelli2008-08-15 23:45:27 -0500
commita8a62201ba762e98dff92cf49033e577fc34d8d4 (patch)
tree11f8513c5cdc222f2fac0c93eb724c089803c200 /linden/indra/llcharacter
parentSecond Life viewer sources 1.18.6.4-RC (diff)
downloadmeta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.zip
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.gz
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.bz2
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.xz
Second Life viewer sources 1.19.0.0
Diffstat (limited to '')
-rw-r--r--linden/indra/llcharacter/llanimationstates.cpp4
-rw-r--r--linden/indra/llcharacter/llanimationstates.h4
-rw-r--r--linden/indra/llcharacter/llbvhloader.cpp4
-rw-r--r--linden/indra/llcharacter/llbvhloader.h4
-rw-r--r--linden/indra/llcharacter/llcharacter.cpp4
-rw-r--r--linden/indra/llcharacter/llcharacter.h4
-rw-r--r--linden/indra/llcharacter/llcharacter_vc9.vcproj420
-rw-r--r--linden/indra/llcharacter/lleditingmotion.cpp88
-rw-r--r--linden/indra/llcharacter/lleditingmotion.h14
-rw-r--r--linden/indra/llcharacter/llgesture.cpp4
-rw-r--r--linden/indra/llcharacter/llgesture.h4
-rw-r--r--linden/indra/llcharacter/llhandmotion.cpp4
-rw-r--r--linden/indra/llcharacter/llhandmotion.h6
-rw-r--r--linden/indra/llcharacter/llheadrotmotion.cpp73
-rw-r--r--linden/indra/llcharacter/llheadrotmotion.h14
-rw-r--r--linden/indra/llcharacter/lljoint.cpp4
-rw-r--r--linden/indra/llcharacter/lljoint.h8
-rw-r--r--linden/indra/llcharacter/lljointsolverrp3.cpp4
-rw-r--r--linden/indra/llcharacter/lljointsolverrp3.h4
-rw-r--r--linden/indra/llcharacter/lljointstate.h40
-rw-r--r--linden/indra/llcharacter/llkeyframefallmotion.cpp19
-rw-r--r--linden/indra/llcharacter/llkeyframefallmotion.h6
-rw-r--r--linden/indra/llcharacter/llkeyframemotion.cpp241
-rw-r--r--linden/indra/llcharacter/llkeyframemotion.h18
-rw-r--r--linden/indra/llcharacter/llkeyframemotionparam.cpp5
-rw-r--r--linden/indra/llcharacter/llkeyframemotionparam.h5
-rw-r--r--linden/indra/llcharacter/llkeyframestandmotion.cpp4
-rw-r--r--linden/indra/llcharacter/llkeyframestandmotion.h18
-rw-r--r--linden/indra/llcharacter/llkeyframewalkmotion.cpp47
-rw-r--r--linden/indra/llcharacter/llkeyframewalkmotion.h10
-rw-r--r--linden/indra/llcharacter/llmotion.cpp6
-rw-r--r--linden/indra/llcharacter/llmotion.h6
-rw-r--r--linden/indra/llcharacter/llmotioncontroller.cpp4
-rw-r--r--linden/indra/llcharacter/llmotioncontroller.h4
-rw-r--r--linden/indra/llcharacter/llmultigesture.cpp4
-rw-r--r--linden/indra/llcharacter/llmultigesture.h4
-rw-r--r--linden/indra/llcharacter/llpose.cpp20
-rw-r--r--linden/indra/llcharacter/llpose.h22
-rw-r--r--linden/indra/llcharacter/llstatemachine.cpp4
-rw-r--r--linden/indra/llcharacter/llstatemachine.h4
-rw-r--r--linden/indra/llcharacter/lltargetingmotion.cpp18
-rw-r--r--linden/indra/llcharacter/lltargetingmotion.h6
-rw-r--r--linden/indra/llcharacter/llvisualparam.cpp4
-rw-r--r--linden/indra/llcharacter/llvisualparam.h4
44 files changed, 842 insertions, 352 deletions
diff --git a/linden/indra/llcharacter/llanimationstates.cpp b/linden/indra/llcharacter/llanimationstates.cpp
index 05c0ca3..81e15c7 100644
--- a/linden/indra/llcharacter/llanimationstates.cpp
+++ b/linden/indra/llcharacter/llanimationstates.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llanimationstates.h b/linden/indra/llcharacter/llanimationstates.h
index e23f3b5..b2ed27a 100644
--- a/linden/indra/llcharacter/llanimationstates.h
+++ b/linden/indra/llcharacter/llanimationstates.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llbvhloader.cpp b/linden/indra/llcharacter/llbvhloader.cpp
index 26dc4e1..e6e49f8 100644
--- a/linden/indra/llcharacter/llbvhloader.cpp
+++ b/linden/indra/llcharacter/llbvhloader.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llbvhloader.h b/linden/indra/llcharacter/llbvhloader.h
index c9a49f7..3935ebe 100644
--- a/linden/indra/llcharacter/llbvhloader.h
+++ b/linden/indra/llcharacter/llbvhloader.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llcharacter.cpp b/linden/indra/llcharacter/llcharacter.cpp
index 5718a20..af4c5aa 100644
--- a/linden/indra/llcharacter/llcharacter.cpp
+++ b/linden/indra/llcharacter/llcharacter.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llcharacter.h b/linden/indra/llcharacter/llcharacter.h
index a0de93d..6699796 100644
--- a/linden/indra/llcharacter/llcharacter.h
+++ b/linden/indra/llcharacter/llcharacter.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llcharacter_vc9.vcproj b/linden/indra/llcharacter/llcharacter_vc9.vcproj
new file mode 100644
index 0000000..13e3b14
--- /dev/null
+++ b/linden/indra/llcharacter/llcharacter_vc9.vcproj
@@ -0,0 +1,420 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="9.00"
5 Name="llcharacter"
6 ProjectGUID="{5EA5DDF0-C7E1-4F49-BEF5-9246A4656B2E}"
7 RootNamespace="llcharacter"
8 Keyword="Win32Proj"
9 TargetFrameworkVersion="131072"
10 >
11 <Platforms>
12 <Platform
13 Name="Win32"
14 />
15 </Platforms>
16 <ToolFiles>
17 </ToolFiles>
18 <Configurations>
19 <Configuration
20 Name="Debug|Win32"
21 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
22 IntermediateDirectory="Debug"
23 ConfigurationType="4"
24 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
25 CharacterSet="1"
26 >
27 <Tool
28 Name="VCPreBuildEventTool"
29 />
30 <Tool
31 Name="VCCustomBuildTool"
32 />
33 <Tool
34 Name="VCXMLDataGeneratorTool"
35 />
36 <Tool
37 Name="VCWebServiceProxyGeneratorTool"
38 />
39 <Tool
40 Name="VCMIDLTool"
41 />
42 <Tool
43 Name="VCCLCompilerTool"
44 Optimization="0"
45 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llmessage;..\llxml;..\..\libraries\i686-win32\include;..\..\libraries\include\"
46 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
47 MinimalRebuild="true"
48 BasicRuntimeChecks="3"
49 RuntimeLibrary="1"
50 StructMemberAlignment="4"
51 TreatWChar_tAsBuiltInType="false"
52 ForceConformanceInForLoopScope="true"
53 UsePrecompiledHeader="0"
54 WarningLevel="3"
55 WarnAsError="true"
56 Detect64BitPortabilityProblems="false"
57 DebugInformationFormat="4"
58 />
59 <Tool
60 Name="VCManagedResourceCompilerTool"
61 />
62 <Tool
63 Name="VCResourceCompilerTool"
64 />
65 <Tool
66 Name="VCPreLinkEventTool"
67 />
68 <Tool
69 Name="VCLibrarianTool"
70 OutputFile="$(OutDir)/llcharacter.lib"
71 />
72 <Tool
73 Name="VCALinkTool"
74 />
75 <Tool
76 Name="VCXDCMakeTool"
77 />
78 <Tool
79 Name="VCBscMakeTool"
80 />
81 <Tool
82 Name="VCFxCopTool"
83 />
84 <Tool
85 Name="VCPostBuildEventTool"
86 />
87 </Configuration>
88 <Configuration
89 Name="Release|Win32"
90 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
91 IntermediateDirectory="Release"
92 ConfigurationType="4"
93 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
94 CharacterSet="1"
95 >
96 <Tool
97 Name="VCPreBuildEventTool"
98 />
99 <Tool
100 Name="VCCustomBuildTool"
101 />
102 <Tool
103 Name="VCXMLDataGeneratorTool"
104 />
105 <Tool
106 Name="VCWebServiceProxyGeneratorTool"
107 />
108 <Tool
109 Name="VCMIDLTool"
110 />
111 <Tool
112 Name="VCCLCompilerTool"
113 AdditionalOptions="/Oy-"
114 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llmessage;..\llxml;..\..\libraries\i686-win32\include;..\..\libraries\include\"
115 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
116 RuntimeLibrary="0"
117 StructMemberAlignment="0"
118 TreatWChar_tAsBuiltInType="false"
119 ForceConformanceInForLoopScope="true"
120 UsePrecompiledHeader="0"
121 WarningLevel="3"
122 WarnAsError="true"
123 Detect64BitPortabilityProblems="false"
124 DebugInformationFormat="3"
125 />
126 <Tool
127 Name="VCManagedResourceCompilerTool"
128 />
129 <Tool
130 Name="VCResourceCompilerTool"
131 />
132 <Tool
133 Name="VCPreLinkEventTool"
134 />
135 <Tool
136 Name="VCLibrarianTool"
137 OutputFile="$(OutDir)/llcharacter.lib"
138 />
139 <Tool
140 Name="VCALinkTool"
141 />
142 <Tool
143 Name="VCXDCMakeTool"
144 />
145 <Tool
146 Name="VCBscMakeTool"
147 />
148 <Tool
149 Name="VCFxCopTool"
150 />
151 <Tool
152 Name="VCPostBuildEventTool"
153 />
154 </Configuration>
155 <Configuration
156 Name="ReleaseNoOpt|Win32"
157 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
158 IntermediateDirectory="$(ConfigurationName)"
159 ConfigurationType="4"
160 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
161 CharacterSet="1"
162 >
163 <Tool
164 Name="VCPreBuildEventTool"
165 />
166 <Tool
167 Name="VCCustomBuildTool"
168 />
169 <Tool
170 Name="VCXMLDataGeneratorTool"
171 />
172 <Tool
173 Name="VCWebServiceProxyGeneratorTool"
174 />
175 <Tool
176 Name="VCMIDLTool"
177 />
178 <Tool
179 Name="VCCLCompilerTool"
180 AdditionalOptions="/Oy-"
181 Optimization="0"
182 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llmessage;..\llxml;..\..\libraries\i686-win32\include;..\..\libraries\include\"
183 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
184 RuntimeLibrary="0"
185 StructMemberAlignment="0"
186 TreatWChar_tAsBuiltInType="false"
187 ForceConformanceInForLoopScope="true"
188 UsePrecompiledHeader="0"
189 WarningLevel="3"
190 WarnAsError="true"
191 Detect64BitPortabilityProblems="false"
192 DebugInformationFormat="3"
193 />
194 <Tool
195 Name="VCManagedResourceCompilerTool"
196 />
197 <Tool
198 Name="VCResourceCompilerTool"
199 />
200 <Tool
201 Name="VCPreLinkEventTool"
202 />
203 <Tool
204 Name="VCLibrarianTool"
205 OutputFile="$(OutDir)/llcharacter.lib"
206 />
207 <Tool
208 Name="VCALinkTool"
209 />
210 <Tool
211 Name="VCXDCMakeTool"
212 />
213 <Tool
214 Name="VCBscMakeTool"
215 />
216 <Tool
217 Name="VCFxCopTool"
218 />
219 <Tool
220 Name="VCPostBuildEventTool"
221 />
222 </Configuration>
223 </Configurations>
224 <References>
225 </References>
226 <Files>
227 <Filter
228 Name="Source Files"
229 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
230 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
231 >
232 <File
233 RelativePath=".\llanimationstates.cpp"
234 >
235 </File>
236 <File
237 RelativePath=".\llbvhloader.cpp"
238 >
239 </File>
240 <File
241 RelativePath=".\llcharacter.cpp"
242 >
243 </File>
244 <File
245 RelativePath=".\lleditingmotion.cpp"
246 >
247 </File>
248 <File
249 RelativePath=".\llgesture.cpp"
250 >
251 </File>
252 <File
253 RelativePath=".\llhandmotion.cpp"
254 >
255 </File>
256 <File
257 RelativePath=".\llheadrotmotion.cpp"
258 >
259 </File>
260 <File
261 RelativePath=".\lljoint.cpp"
262 >
263 </File>
264 <File
265 RelativePath=".\lljointsolverrp3.cpp"
266 >
267 </File>
268 <File
269 RelativePath=".\llkeyframefallmotion.cpp"
270 >
271 </File>
272 <File
273 RelativePath=".\llkeyframemotion.cpp"
274 >
275 </File>
276 <File
277 RelativePath=".\llkeyframemotionparam.cpp"
278 >
279 </File>
280 <File
281 RelativePath=".\llkeyframestandmotion.cpp"
282 >
283 </File>
284 <File
285 RelativePath=".\llkeyframewalkmotion.cpp"
286 >
287 </File>
288 <File
289 RelativePath=".\llmotion.cpp"
290 >
291 </File>
292 <File
293 RelativePath=".\llmotioncontroller.cpp"
294 >
295 </File>
296 <File
297 RelativePath=".\llmultigesture.cpp"
298 >
299 </File>
300 <File
301 RelativePath=".\llpose.cpp"
302 >
303 </File>
304 <File
305 RelativePath=".\llstatemachine.cpp"
306 >
307 </File>
308 <File
309 RelativePath=".\lltargetingmotion.cpp"
310 >
311 </File>
312 <File
313 RelativePath=".\llvisualparam.cpp"
314 >
315 </File>
316 </Filter>
317 <Filter
318 Name="Header Files"
319 Filter="h;hpp;hxx;hm;inl;inc;xsd"
320 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
321 >
322 <File
323 RelativePath=".\llanimationstates.h"
324 >
325 </File>
326 <File
327 RelativePath=".\llbvhloader.h"
328 >
329 </File>
330 <File
331 RelativePath=".\llcharacter.h"
332 >
333 </File>
334 <File
335 RelativePath=".\lleditingmotion.h"
336 >
337 </File>
338 <File
339 RelativePath=".\llgesture.h"
340 >
341 </File>
342 <File
343 RelativePath=".\llhandmotion.h"
344 >
345 </File>
346 <File
347 RelativePath=".\llheadrotmotion.h"
348 >
349 </File>
350 <File
351 RelativePath=".\lljoint.h"
352 >
353 </File>
354 <File
355 RelativePath=".\lljointsolverrp3.h"
356 >
357 </File>
358 <File
359 RelativePath=".\lljointstate.h"
360 >
361 </File>
362 <File
363 RelativePath=".\llkeyframefallmotion.h"
364 >
365 </File>
366 <File
367 RelativePath=".\llkeyframemotion.h"
368 >
369 </File>
370 <File
371 RelativePath=".\llkeyframemotionparam.h"
372 >
373 </File>
374 <File
375 RelativePath=".\llkeyframestandmotion.h"
376 >
377 </File>
378 <File
379 RelativePath=".\llkeyframewalkmotion.h"
380 >
381 </File>
382 <File
383 RelativePath=".\llmotion.h"
384 >
385 </File>
386 <File
387 RelativePath=".\llmotioncontroller.h"
388 >
389 </File>
390 <File
391 RelativePath=".\llmultigesture.h"
392 >
393 </File>
394 <File
395 RelativePath=".\llpose.h"
396 >
397 </File>
398 <File
399 RelativePath=".\llstatemachine.h"
400 >
401 </File>
402 <File
403 RelativePath=".\lltargetingmotion.h"
404 >
405 </File>
406 <File
407 RelativePath=".\llvisualparam.h"
408 >
409 </File>
410 </Filter>
411 <Filter
412 Name="Resource Files"
413 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
414 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
415 >
416 </Filter>
417 </Files>
418 <Globals>
419 </Globals>
420</VisualStudioProject>
diff --git a/linden/indra/llcharacter/lleditingmotion.cpp b/linden/indra/llcharacter/lleditingmotion.cpp
index c2519c2..c693e6d 100644
--- a/linden/indra/llcharacter/lleditingmotion.cpp
+++ b/linden/indra/llcharacter/lleditingmotion.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -64,6 +64,12 @@ LLEditingMotion::LLEditingMotion( const LLUUID &id) : LLMotion(id)
64 mElbowJoint.addChild( &mWristJoint ); 64 mElbowJoint.addChild( &mWristJoint );
65 65
66 mName = "editing"; 66 mName = "editing";
67
68 mParentState = new LLJointState;
69 mShoulderState = new LLJointState;
70 mElbowState = new LLJointState;
71 mWristState = new LLJointState;
72 mTorsoState = new LLJointState;
67} 73}
68 74
69 75
@@ -93,13 +99,13 @@ LLMotion::LLMotionInitStatus LLEditingMotion::onInitialize(LLCharacter *characte
93 } 99 }
94 100
95 // get the shoulder, elbow, wrist joints from the character 101 // get the shoulder, elbow, wrist joints from the character
96 mParentState.setJoint( mCharacter->getJoint("mShoulderLeft")->getParent() ); 102 mParentState->setJoint( mCharacter->getJoint("mShoulderLeft")->getParent() );
97 mShoulderState.setJoint( mCharacter->getJoint("mShoulderLeft") ); 103 mShoulderState->setJoint( mCharacter->getJoint("mShoulderLeft") );
98 mElbowState.setJoint( mCharacter->getJoint("mElbowLeft") ); 104 mElbowState->setJoint( mCharacter->getJoint("mElbowLeft") );
99 mWristState.setJoint( mCharacter->getJoint("mWristLeft") ); 105 mWristState->setJoint( mCharacter->getJoint("mWristLeft") );
100 mTorsoState.setJoint( mCharacter->getJoint("mTorso")); 106 mTorsoState->setJoint( mCharacter->getJoint("mTorso"));
101 107
102 if ( ! mParentState.getJoint() ) 108 if ( ! mParentState->getJoint() )
103 { 109 {
104 llinfos << getName() << ": Can't get parent joint." << llendl; 110 llinfos << getName() << ": Can't get parent joint." << llendl;
105 return STATUS_FAILURE; 111 return STATUS_FAILURE;
@@ -108,25 +114,25 @@ LLMotion::LLMotionInitStatus LLEditingMotion::onInitialize(LLCharacter *characte
108 mWristOffset = LLVector3(0.0f, 0.2f, 0.0f); 114 mWristOffset = LLVector3(0.0f, 0.2f, 0.0f);
109 115
110 // add joint states to the pose 116 // add joint states to the pose
111 mShoulderState.setUsage(LLJointState::ROT); 117 mShoulderState->setUsage(LLJointState::ROT);
112 mElbowState.setUsage(LLJointState::ROT); 118 mElbowState->setUsage(LLJointState::ROT);
113 mTorsoState.setUsage(LLJointState::ROT); 119 mTorsoState->setUsage(LLJointState::ROT);
114 mWristState.setUsage(LLJointState::ROT); 120 mWristState->setUsage(LLJointState::ROT);
115 addJointState( &mShoulderState ); 121 addJointState( mShoulderState );
116 addJointState( &mElbowState ); 122 addJointState( mElbowState );
117 addJointState( &mTorsoState ); 123 addJointState( mTorsoState );
118 addJointState( &mWristState ); 124 addJointState( mWristState );
119 125
120 // propagate joint positions to kinematic chain 126 // propagate joint positions to kinematic chain
121 mParentJoint.setPosition( mParentState.getJoint()->getWorldPosition() ); 127 mParentJoint.setPosition( mParentState->getJoint()->getWorldPosition() );
122 mShoulderJoint.setPosition( mShoulderState.getJoint()->getPosition() ); 128 mShoulderJoint.setPosition( mShoulderState->getJoint()->getPosition() );
123 mElbowJoint.setPosition( mElbowState.getJoint()->getPosition() ); 129 mElbowJoint.setPosition( mElbowState->getJoint()->getPosition() );
124 mWristJoint.setPosition( mWristState.getJoint()->getPosition() + mWristOffset ); 130 mWristJoint.setPosition( mWristState->getJoint()->getPosition() + mWristOffset );
125 131
126 // propagate current joint rotations to kinematic chain 132 // propagate current joint rotations to kinematic chain
127 mParentJoint.setRotation( mParentState.getJoint()->getWorldRotation() ); 133 mParentJoint.setRotation( mParentState->getJoint()->getWorldRotation() );
128 mShoulderJoint.setRotation( mShoulderState.getJoint()->getRotation() ); 134 mShoulderJoint.setRotation( mShoulderState->getJoint()->getRotation() );
129 mElbowJoint.setRotation( mElbowState.getJoint()->getRotation() ); 135 mElbowJoint.setRotation( mElbowState->getJoint()->getRotation() );
130 136
131 // connect the ikSolver to the chain 137 // connect the ikSolver to the chain
132 mIKSolver.setPoleVector( LLVector3( -1.0f, 1.0f, 0.0f ) ); 138 mIKSolver.setPoleVector( LLVector3( -1.0f, 1.0f, 0.0f ) );
@@ -144,15 +150,15 @@ LLMotion::LLMotionInitStatus LLEditingMotion::onInitialize(LLCharacter *characte
144BOOL LLEditingMotion::onActivate() 150BOOL LLEditingMotion::onActivate()
145{ 151{
146 // propagate joint positions to kinematic chain 152 // propagate joint positions to kinematic chain
147 mParentJoint.setPosition( mParentState.getJoint()->getWorldPosition() ); 153 mParentJoint.setPosition( mParentState->getJoint()->getWorldPosition() );
148 mShoulderJoint.setPosition( mShoulderState.getJoint()->getPosition() ); 154 mShoulderJoint.setPosition( mShoulderState->getJoint()->getPosition() );
149 mElbowJoint.setPosition( mElbowState.getJoint()->getPosition() ); 155 mElbowJoint.setPosition( mElbowState->getJoint()->getPosition() );
150 mWristJoint.setPosition( mWristState.getJoint()->getPosition() + mWristOffset ); 156 mWristJoint.setPosition( mWristState->getJoint()->getPosition() + mWristOffset );
151 157
152 // propagate current joint rotations to kinematic chain 158 // propagate current joint rotations to kinematic chain
153 mParentJoint.setRotation( mParentState.getJoint()->getWorldRotation() ); 159 mParentJoint.setRotation( mParentState->getJoint()->getWorldRotation() );
154 mShoulderJoint.setRotation( mShoulderState.getJoint()->getRotation() ); 160 mShoulderJoint.setRotation( mShoulderState->getJoint()->getRotation() );
155 mElbowJoint.setRotation( mElbowState.getJoint()->getRotation() ); 161 mElbowJoint.setRotation( mElbowState->getJoint()->getRotation() );
156 162
157 return TRUE; 163 return TRUE;
158} 164}
@@ -182,15 +188,15 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
182 focus_pt += mCharacter->getCharacterPosition(); 188 focus_pt += mCharacter->getCharacterPosition();
183 189
184 // propagate joint positions to kinematic chain 190 // propagate joint positions to kinematic chain
185 mParentJoint.setPosition( mParentState.getJoint()->getWorldPosition() ); 191 mParentJoint.setPosition( mParentState->getJoint()->getWorldPosition() );
186 mShoulderJoint.setPosition( mShoulderState.getJoint()->getPosition() ); 192 mShoulderJoint.setPosition( mShoulderState->getJoint()->getPosition() );
187 mElbowJoint.setPosition( mElbowState.getJoint()->getPosition() ); 193 mElbowJoint.setPosition( mElbowState->getJoint()->getPosition() );
188 mWristJoint.setPosition( mWristState.getJoint()->getPosition() + mWristOffset ); 194 mWristJoint.setPosition( mWristState->getJoint()->getPosition() + mWristOffset );
189 195
190 // propagate current joint rotations to kinematic chain 196 // propagate current joint rotations to kinematic chain
191 mParentJoint.setRotation( mParentState.getJoint()->getWorldRotation() ); 197 mParentJoint.setRotation( mParentState->getJoint()->getWorldRotation() );
192 mShoulderJoint.setRotation( mShoulderState.getJoint()->getRotation() ); 198 mShoulderJoint.setRotation( mShoulderState->getJoint()->getRotation() );
193 mElbowJoint.setRotation( mElbowState.getJoint()->getRotation() ); 199 mElbowJoint.setRotation( mElbowState->getJoint()->getRotation() );
194 200
195 // update target position from character 201 // update target position from character
196 LLVector3 target = focus_pt - mParentJoint.getPosition(); 202 LLVector3 target = focus_pt - mParentJoint.getPosition();
@@ -199,7 +205,7 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
199 LLVector3 edit_plane_normal(1.f / F_SQRT2, 1.f / F_SQRT2, 0.f); 205 LLVector3 edit_plane_normal(1.f / F_SQRT2, 1.f / F_SQRT2, 0.f);
200 edit_plane_normal.normVec(); 206 edit_plane_normal.normVec();
201 207
202 edit_plane_normal.rotVec(mTorsoState.getJoint()->getWorldRotation()); 208 edit_plane_normal.rotVec(mTorsoState->getJoint()->getWorldRotation());
203 209
204 F32 dot = edit_plane_normal * target; 210 F32 dot = edit_plane_normal * target;
205 211
@@ -236,9 +242,9 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
236 // now put blended values back into joints 242 // now put blended values back into joints
237 llassert(shoulderRot.isFinite()); 243 llassert(shoulderRot.isFinite());
238 llassert(elbowRot.isFinite()); 244 llassert(elbowRot.isFinite());
239 mShoulderState.setRotation(shoulderRot); 245 mShoulderState->setRotation(shoulderRot);
240 mElbowState.setRotation(elbowRot); 246 mElbowState->setRotation(elbowRot);
241 mWristState.setRotation(LLQuaternion::DEFAULT); 247 mWristState->setRotation(LLQuaternion::DEFAULT);
242 } 248 }
243 249
244 mCharacter->setAnimationData("Hand Pose", &sHandPose); 250 mCharacter->setAnimationData("Hand Pose", &sHandPose);
diff --git a/linden/indra/llcharacter/lleditingmotion.h b/linden/indra/llcharacter/lleditingmotion.h
index 06828fa..3d46343 100644
--- a/linden/indra/llcharacter/lleditingmotion.h
+++ b/linden/indra/llcharacter/lleditingmotion.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -116,11 +116,11 @@ public:
116 LLCharacter *mCharacter; 116 LLCharacter *mCharacter;
117 LLVector3 mWristOffset; 117 LLVector3 mWristOffset;
118 118
119 LLJointState mParentState; 119 LLPointer<LLJointState> mParentState;
120 LLJointState mShoulderState; 120 LLPointer<LLJointState> mShoulderState;
121 LLJointState mElbowState; 121 LLPointer<LLJointState> mElbowState;
122 LLJointState mWristState; 122 LLPointer<LLJointState> mWristState;
123 LLJointState mTorsoState; 123 LLPointer<LLJointState> mTorsoState;
124 124
125 LLJoint mParentJoint; 125 LLJoint mParentJoint;
126 LLJoint mShoulderJoint; 126 LLJoint mShoulderJoint;
diff --git a/linden/indra/llcharacter/llgesture.cpp b/linden/indra/llcharacter/llgesture.cpp
index b3d3127..c124ad0 100644
--- a/linden/indra/llcharacter/llgesture.cpp
+++ b/linden/indra/llcharacter/llgesture.cpp
@@ -11,12 +11,12 @@
11 * ("GPL"), unless you have obtained a separate licensing agreement 11 * ("GPL"), unless you have obtained a separate licensing agreement
12 * ("Other License"), formally executed by you and Linden Lab. Terms of 12 * ("Other License"), formally executed by you and Linden Lab. Terms of
13 * the GPL can be found in doc/GPL-license.txt in this distribution, or 13 * the GPL can be found in doc/GPL-license.txt in this distribution, or
14 * online at http://secondlife.com/developers/opensource/gplv2 14 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
15 * 15 *
16 * There are special exceptions to the terms and conditions of the GPL as 16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception 17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or 18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at http://secondlife.com/developers/opensource/flossexception 19 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
20 * 20 *
21 * By copying, modifying or distributing this software, you acknowledge 21 * By copying, modifying or distributing this software, you acknowledge
22 * that you have read and understood your obligations described above, 22 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llgesture.h b/linden/indra/llcharacter/llgesture.h
index f245a1c..0e4b781 100644
--- a/linden/indra/llcharacter/llgesture.h
+++ b/linden/indra/llcharacter/llgesture.h
@@ -13,12 +13,12 @@
13 * ("GPL"), unless you have obtained a separate licensing agreement 13 * ("GPL"), unless you have obtained a separate licensing agreement
14 * ("Other License"), formally executed by you and Linden Lab. Terms of 14 * ("Other License"), formally executed by you and Linden Lab. Terms of
15 * the GPL can be found in doc/GPL-license.txt in this distribution, or 15 * the GPL can be found in doc/GPL-license.txt in this distribution, or
16 * online at http://secondlife.com/developers/opensource/gplv2 16 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
17 * 17 *
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at http://secondlife.com/developers/opensource/flossexception 21 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 * 22 *
23 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llhandmotion.cpp b/linden/indra/llcharacter/llhandmotion.cpp
index bdaf0f3..3902518 100644
--- a/linden/indra/llcharacter/llhandmotion.cpp
+++ b/linden/indra/llcharacter/llhandmotion.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llhandmotion.h b/linden/indra/llcharacter/llhandmotion.h
index 3729659..548e4de 100644
--- a/linden/indra/llcharacter/llhandmotion.h
+++ b/linden/indra/llcharacter/llhandmotion.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -124,6 +124,8 @@ public:
124 // called when a motion is deactivated 124 // called when a motion is deactivated
125 virtual void onDeactivate(); 125 virtual void onDeactivate();
126 126
127 virtual BOOL canDeprecate() { return FALSE; }
128
127 static LLString getHandPoseName(eHandPose pose); 129 static LLString getHandPoseName(eHandPose pose);
128 static eHandPose getHandPose(LLString posename); 130 static eHandPose getHandPose(LLString posename);
129 131
diff --git a/linden/indra/llcharacter/llheadrotmotion.cpp b/linden/indra/llcharacter/llheadrotmotion.cpp
index e8afb82..f01dfcc 100644
--- a/linden/indra/llcharacter/llheadrotmotion.cpp
+++ b/linden/indra/llcharacter/llheadrotmotion.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -82,6 +82,10 @@ LLHeadRotMotion::LLHeadRotMotion(const LLUUID &id) :
82 mHeadJoint(NULL) 82 mHeadJoint(NULL)
83{ 83{
84 mName = "head_rot"; 84 mName = "head_rot";
85
86 mTorsoState = new LLJointState;
87 mNeckState = new LLJointState;
88 mHeadState = new LLJointState;
85} 89}
86 90
87 91
@@ -130,34 +134,34 @@ LLMotion::LLMotionInitStatus LLHeadRotMotion::onInitialize(LLCharacter *characte
130 return STATUS_FAILURE; 134 return STATUS_FAILURE;
131 } 135 }
132 136
133 mTorsoState.setJoint( character->getJoint("mTorso") ); 137 mTorsoState->setJoint( character->getJoint("mTorso") );
134 if ( ! mTorsoState.getJoint() ) 138 if ( ! mTorsoState->getJoint() )
135 { 139 {
136 llinfos << getName() << ": Can't get torso joint." << llendl; 140 llinfos << getName() << ": Can't get torso joint." << llendl;
137 return STATUS_FAILURE; 141 return STATUS_FAILURE;
138 } 142 }
139 143
140 mNeckState.setJoint( character->getJoint("mNeck") ); 144 mNeckState->setJoint( character->getJoint("mNeck") );
141 if ( ! mNeckState.getJoint() ) 145 if ( ! mNeckState->getJoint() )
142 { 146 {
143 llinfos << getName() << ": Can't get neck joint." << llendl; 147 llinfos << getName() << ": Can't get neck joint." << llendl;
144 return STATUS_FAILURE; 148 return STATUS_FAILURE;
145 } 149 }
146 150
147 mHeadState.setJoint( character->getJoint("mHead") ); 151 mHeadState->setJoint( character->getJoint("mHead") );
148 if ( ! mHeadState.getJoint() ) 152 if ( ! mHeadState->getJoint() )
149 { 153 {
150 llinfos << getName() << ": Can't get head joint." << llendl; 154 llinfos << getName() << ": Can't get head joint." << llendl;
151 return STATUS_FAILURE; 155 return STATUS_FAILURE;
152 } 156 }
153 157
154 mTorsoState.setUsage(LLJointState::ROT); 158 mTorsoState->setUsage(LLJointState::ROT);
155 mNeckState.setUsage(LLJointState::ROT); 159 mNeckState->setUsage(LLJointState::ROT);
156 mHeadState.setUsage(LLJointState::ROT); 160 mHeadState->setUsage(LLJointState::ROT);
157 161
158 addJointState( &mTorsoState ); 162 addJointState( mTorsoState );
159 addJointState( &mNeckState ); 163 addJointState( mNeckState );
160 addJointState( &mHeadState ); 164 addJointState( mHeadState );
161 165
162 mLastHeadRot.loadIdentity(); 166 mLastHeadRot.loadIdentity();
163 167
@@ -240,16 +244,16 @@ BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask)
240 // Set torso target rotation such that it lags behind the head rotation 244 // Set torso target rotation such that it lags behind the head rotation
241 // by a fixed amount. 245 // by a fixed amount.
242 LLQuaternion torso_rot_local = nlerp(TORSO_LAG, LLQuaternion::DEFAULT, head_rot_local ); 246 LLQuaternion torso_rot_local = nlerp(TORSO_LAG, LLQuaternion::DEFAULT, head_rot_local );
243 mTorsoState.setRotation( nlerp(torso_slerp_amt, mTorsoState.getRotation(), torso_rot_local) ); 247 mTorsoState->setRotation( nlerp(torso_slerp_amt, mTorsoState->getRotation(), torso_rot_local) );
244 248
245 head_rot_local = nlerp(head_slerp_amt, mLastHeadRot, head_rot_local); 249 head_rot_local = nlerp(head_slerp_amt, mLastHeadRot, head_rot_local);
246 mLastHeadRot = head_rot_local; 250 mLastHeadRot = head_rot_local;
247 251
248 // Set the head rotation. 252 // Set the head rotation.
249 LLQuaternion torsoRotLocal = mNeckState.getJoint()->getParent()->getWorldRotation() * currentInvRootRotWorld; 253 LLQuaternion torsoRotLocal = mNeckState->getJoint()->getParent()->getWorldRotation() * currentInvRootRotWorld;
250 head_rot_local = head_rot_local * ~torsoRotLocal; 254 head_rot_local = head_rot_local * ~torsoRotLocal;
251 mNeckState.setRotation( nlerp(NECK_LAG, LLQuaternion::DEFAULT, head_rot_local) ); 255 mNeckState->setRotation( nlerp(NECK_LAG, LLQuaternion::DEFAULT, head_rot_local) );
252 mHeadState.setRotation( nlerp(1.f - NECK_LAG, LLQuaternion::DEFAULT, head_rot_local)); 256 mHeadState->setRotation( nlerp(1.f - NECK_LAG, LLQuaternion::DEFAULT, head_rot_local));
253 257
254 return TRUE; 258 return TRUE;
255} 259}
@@ -284,6 +288,9 @@ LLEyeMotion::LLEyeMotion(const LLUUID &id) : LLMotion(id)
284 mHeadJoint = NULL; 288 mHeadJoint = NULL;
285 289
286 mName = "eye_rot"; 290 mName = "eye_rot";
291
292 mLeftEyeState = new LLJointState;
293 mRightEyeState = new LLJointState;
287} 294}
288 295
289 296
@@ -309,25 +316,25 @@ LLMotion::LLMotionInitStatus LLEyeMotion::onInitialize(LLCharacter *character)
309 return STATUS_FAILURE; 316 return STATUS_FAILURE;
310 } 317 }
311 318
312 mLeftEyeState.setJoint( character->getJoint("mEyeLeft") ); 319 mLeftEyeState->setJoint( character->getJoint("mEyeLeft") );
313 if ( ! mLeftEyeState.getJoint() ) 320 if ( ! mLeftEyeState->getJoint() )
314 { 321 {
315 llinfos << getName() << ": Can't get left eyeball joint." << llendl; 322 llinfos << getName() << ": Can't get left eyeball joint." << llendl;
316 return STATUS_FAILURE; 323 return STATUS_FAILURE;
317 } 324 }
318 325
319 mRightEyeState.setJoint( character->getJoint("mEyeRight") ); 326 mRightEyeState->setJoint( character->getJoint("mEyeRight") );
320 if ( ! mRightEyeState.getJoint() ) 327 if ( ! mRightEyeState->getJoint() )
321 { 328 {
322 llinfos << getName() << ": Can't get Right eyeball joint." << llendl; 329 llinfos << getName() << ": Can't get Right eyeball joint." << llendl;
323 return STATUS_FAILURE; 330 return STATUS_FAILURE;
324 } 331 }
325 332
326 mLeftEyeState.setUsage(LLJointState::ROT); 333 mLeftEyeState->setUsage(LLJointState::ROT);
327 mRightEyeState.setUsage(LLJointState::ROT); 334 mRightEyeState->setUsage(LLJointState::ROT);
328 335
329 addJointState( &mLeftEyeState ); 336 addJointState( mLeftEyeState );
330 addJointState( &mRightEyeState ); 337 addJointState( mRightEyeState );
331 338
332 return STATUS_SUCCESS; 339 return STATUS_SUCCESS;
333} 340}
@@ -443,11 +450,15 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
443 target_eye_rot = LLQuaternion(eye_look_at, left, up); 450 target_eye_rot = LLQuaternion(eye_look_at, left, up);
444 // convert target rotation to head-local coordinates 451 // convert target rotation to head-local coordinates
445 target_eye_rot *= ~mHeadJoint->getWorldRotation(); 452 target_eye_rot *= ~mHeadJoint->getWorldRotation();
453 // eliminate any Euler roll - we're lucky that roll is applied last.
454 F32 roll, pitch, yaw;
455 target_eye_rot.getEulerAngles(&roll, &pitch, &yaw);
456 target_eye_rot.setQuat(0.0f, pitch, yaw);
446 // constrain target orientation to be in front of avatar's face 457 // constrain target orientation to be in front of avatar's face
447 target_eye_rot.constrain(EYE_ROT_LIMIT_ANGLE); 458 target_eye_rot.constrain(EYE_ROT_LIMIT_ANGLE);
448 459
449 // calculate vergence 460 // calculate vergence
450 F32 interocular_dist = (mLeftEyeState.getJoint()->getWorldPosition() - mRightEyeState.getJoint()->getWorldPosition()).magVec(); 461 F32 interocular_dist = (mLeftEyeState->getJoint()->getWorldPosition() - mRightEyeState->getJoint()->getWorldPosition()).magVec();
451 vergence = -atan2((interocular_dist / 2.f), lookAtDistance); 462 vergence = -atan2((interocular_dist / 2.f), lookAtDistance);
452 llclamp(vergence, -F_PI_BY_TWO, 0.f); 463 llclamp(vergence, -F_PI_BY_TWO, 0.f);
453 } 464 }
@@ -495,8 +506,8 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
495 vergence_quat.transQuat(); 506 vergence_quat.transQuat();
496 right_eye_rot = vergence_quat * eye_jitter_rot * right_eye_rot; 507 right_eye_rot = vergence_quat * eye_jitter_rot * right_eye_rot;
497 508
498 mLeftEyeState.setRotation( left_eye_rot ); 509 mLeftEyeState->setRotation( left_eye_rot );
499 mRightEyeState.setRotation( right_eye_rot ); 510 mRightEyeState->setRotation( right_eye_rot );
500 511
501 return TRUE; 512 return TRUE;
502} 513}
@@ -507,13 +518,13 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
507//----------------------------------------------------------------------------- 518//-----------------------------------------------------------------------------
508void LLEyeMotion::onDeactivate() 519void LLEyeMotion::onDeactivate()
509{ 520{
510 LLJoint* joint = mLeftEyeState.getJoint(); 521 LLJoint* joint = mLeftEyeState->getJoint();
511 if (joint) 522 if (joint)
512 { 523 {
513 joint->setRotation(LLQuaternion::DEFAULT); 524 joint->setRotation(LLQuaternion::DEFAULT);
514 } 525 }
515 526
516 joint = mRightEyeState.getJoint(); 527 joint = mRightEyeState->getJoint();
517 if (joint) 528 if (joint)
518 { 529 {
519 joint->setRotation(LLQuaternion::DEFAULT); 530 joint->setRotation(LLQuaternion::DEFAULT);
diff --git a/linden/indra/llcharacter/llheadrotmotion.h b/linden/indra/llcharacter/llheadrotmotion.h
index bc9c8ea..d13cdb4 100644
--- a/linden/indra/llcharacter/llheadrotmotion.h
+++ b/linden/indra/llcharacter/llheadrotmotion.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -117,9 +117,9 @@ public:
117 LLJoint *mRootJoint; 117 LLJoint *mRootJoint;
118 LLJoint *mPelvisJoint; 118 LLJoint *mPelvisJoint;
119 119
120 LLJointState mTorsoState; 120 LLPointer<LLJointState> mTorsoState;
121 LLJointState mNeckState; 121 LLPointer<LLJointState> mNeckState;
122 LLJointState mHeadState; 122 LLPointer<LLJointState> mHeadState;
123 123
124 LLQuaternion mLastHeadRot; 124 LLQuaternion mLastHeadRot;
125}; 125};
@@ -196,8 +196,8 @@ public:
196 LLCharacter *mCharacter; 196 LLCharacter *mCharacter;
197 197
198 LLJoint *mHeadJoint; 198 LLJoint *mHeadJoint;
199 LLJointState mLeftEyeState; 199 LLPointer<LLJointState> mLeftEyeState;
200 LLJointState mRightEyeState; 200 LLPointer<LLJointState> mRightEyeState;
201 201
202 LLFrameTimer mEyeJitterTimer; 202 LLFrameTimer mEyeJitterTimer;
203 F32 mEyeJitterTime; 203 F32 mEyeJitterTime;
diff --git a/linden/indra/llcharacter/lljoint.cpp b/linden/indra/llcharacter/lljoint.cpp
index 052d5e2..b7a51f1 100644
--- a/linden/indra/llcharacter/lljoint.cpp
+++ b/linden/indra/llcharacter/lljoint.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/lljoint.h b/linden/indra/llcharacter/lljoint.h
index c05412d..6492fe2 100644
--- a/linden/indra/llcharacter/lljoint.h
+++ b/linden/indra/llcharacter/lljoint.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -115,7 +115,7 @@ public:
115 void touch(U32 flags = ALL_DIRTY); 115 void touch(U32 flags = ALL_DIRTY);
116 116
117 // get/set name 117 // get/set name
118 const std::string &getName() { return mName; } 118 const std::string& getName() const { return mName; }
119 void setName( const std::string &name ) { mName = name; } 119 void setName( const std::string &name ) { mName = name; }
120 120
121 // getParent 121 // getParent
@@ -175,7 +175,7 @@ public:
175 175
176 virtual BOOL isAnimatable() { return TRUE; } 176 virtual BOOL isAnimatable() { return TRUE; }
177 177
178 S32 getJointNum() { return mJointNum; } 178 S32 getJointNum() const { return mJointNum; }
179 void setJointNum(S32 joint_num) { mJointNum = joint_num; } 179 void setJointNum(S32 joint_num) { mJointNum = joint_num; }
180}; 180};
181#endif // LL_LLJOINT_H 181#endif // LL_LLJOINT_H
diff --git a/linden/indra/llcharacter/lljointsolverrp3.cpp b/linden/indra/llcharacter/lljointsolverrp3.cpp
index c6ae76e..0356912 100644
--- a/linden/indra/llcharacter/lljointsolverrp3.cpp
+++ b/linden/indra/llcharacter/lljointsolverrp3.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/lljointsolverrp3.h b/linden/indra/llcharacter/lljointsolverrp3.h
index 370360f..511351a 100644
--- a/linden/indra/llcharacter/lljointsolverrp3.h
+++ b/linden/indra/llcharacter/lljointsolverrp3.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/lljointstate.h b/linden/indra/llcharacter/lljointstate.h
index ef74150..15dfd6d 100644
--- a/linden/indra/llcharacter/lljointstate.h
+++ b/linden/indra/llcharacter/lljointstate.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -36,11 +36,12 @@
36// Header Files 36// Header Files
37//----------------------------------------------------------------------------- 37//-----------------------------------------------------------------------------
38#include "lljoint.h" 38#include "lljoint.h"
39#include "llmemory.h"
39 40
40//----------------------------------------------------------------------------- 41//-----------------------------------------------------------------------------
41// class LLJointState 42// class LLJointState
42//----------------------------------------------------------------------------- 43//-----------------------------------------------------------------------------
43class LLJointState 44class LLJointState : public LLRefCount
44{ 45{
45public: 46public:
46 enum BlendPhase 47 enum BlendPhase
@@ -85,13 +86,9 @@ public:
85 mPriority = LLJoint::USE_MOTION_PRIORITY; 86 mPriority = LLJoint::USE_MOTION_PRIORITY;
86 } 87 }
87 88
88 // Destructor
89 virtual ~LLJointState()
90 {
91 }
92
93 // joint that this state is applied to 89 // joint that this state is applied to
94 LLJoint *getJoint() { return mJoint; } 90 LLJoint* getJoint() { return mJoint; }
91 const LLJoint* getJoint() const { return mJoint; }
95 BOOL setJoint( LLJoint *joint ) { mJoint = joint; return mJoint != NULL; } 92 BOOL setJoint( LLJoint *joint ) { mJoint = joint; return mJoint != NULL; }
96 93
97 // transform type (bitwise flags can be combined) 94 // transform type (bitwise flags can be combined)
@@ -103,26 +100,33 @@ public:
103 ROT = 2, 100 ROT = 2,
104 SCALE = 4, 101 SCALE = 4,
105 }; 102 };
106 U32 getUsage() { return mUsage; } 103 U32 getUsage() const { return mUsage; }
107 void setUsage( U32 usage ) { mUsage = usage; } 104 void setUsage( U32 usage ) { mUsage = usage; }
108 F32 getWeight() { return mWeight; } 105 F32 getWeight() const { return mWeight; }
109 void setWeight( F32 weight ) { mWeight = weight; } 106 void setWeight( F32 weight ) { mWeight = weight; }
110 107
111 // get/set position 108 // get/set position
112 const LLVector3& getPosition() { return mPosition; } 109 const LLVector3& getPosition() const { return mPosition; }
113 void setPosition( const LLVector3& pos ) { llassert(mUsage & POS); mPosition = pos; } 110 void setPosition( const LLVector3& pos ) { llassert(mUsage & POS); mPosition = pos; }
114 111
115 // get/set rotation 112 // get/set rotation
116 const LLQuaternion& getRotation() { return mRotation; } 113 const LLQuaternion& getRotation() const { return mRotation; }
117 void setRotation( const LLQuaternion& rot ) { llassert(mUsage & ROT); mRotation = rot; } 114 void setRotation( const LLQuaternion& rot ) { llassert(mUsage & ROT); mRotation = rot; }
118 115
119 // get/set scale 116 // get/set scale
120 const LLVector3& getScale() { return mScale; } 117 const LLVector3& getScale() const { return mScale; }
121 void setScale( const LLVector3& scale ) { llassert(mUsage & SCALE); mScale = scale; } 118 void setScale( const LLVector3& scale ) { llassert(mUsage & SCALE); mScale = scale; }
122 119
123 // get/set priority 120 // get/set priority
124 LLJoint::JointPriority getPriority() { return mPriority; } 121 LLJoint::JointPriority getPriority() const { return mPriority; }
125 void setPriority( const LLJoint::JointPriority priority ) { mPriority = priority; } 122 void setPriority( LLJoint::JointPriority priority ) { mPriority = priority; }
123
124protected:
125 // Destructor
126 virtual ~LLJointState()
127 {
128 }
129
126}; 130};
127 131
128#endif // LL_LLJOINTSTATE_H 132#endif // LL_LLJOINTSTATE_H
diff --git a/linden/indra/llcharacter/llkeyframefallmotion.cpp b/linden/indra/llcharacter/llkeyframefallmotion.cpp
index d3113fa..4a1f525 100644
--- a/linden/indra/llcharacter/llkeyframefallmotion.cpp
+++ b/linden/indra/llcharacter/llkeyframefallmotion.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -75,13 +75,13 @@ LLMotion::LLMotionInitStatus LLKeyframeFallMotion::onInitialize(LLCharacter *cha
75 // load keyframe data, setup pose and joint states 75 // load keyframe data, setup pose and joint states
76 LLMotion::LLMotionInitStatus result = LLKeyframeMotion::onInitialize(character); 76 LLMotion::LLMotionInitStatus result = LLKeyframeMotion::onInitialize(character);
77 77
78 for (U32 jm=0; jm<mJointMotionList->mNumJointMotions; jm++) 78 for (U32 jm=0; jm<mJointMotionList->getNumJointMotions(); jm++)
79 { 79 {
80 if (!mJointStates[jm].getJoint()) 80 if (!mJointStates[jm]->getJoint())
81 continue; 81 continue;
82 if (mJointStates[jm].getJoint()->getName() == std::string("mPelvis")) 82 if (mJointStates[jm]->getJoint()->getName() == std::string("mPelvis"))
83 { 83 {
84 mPelvisStatep = &mJointStates[jm]; 84 mPelvisState = mJointStates[jm];
85 } 85 }
86 } 86 }
87 87
@@ -124,8 +124,11 @@ BOOL LLKeyframeFallMotion::onUpdate(F32 activeTime, U8* joint_mask)
124 BOOL result = LLKeyframeMotion::onUpdate(activeTime, joint_mask); 124 BOOL result = LLKeyframeMotion::onUpdate(activeTime, joint_mask);
125 F32 slerp_amt = clamp_rescale(activeTime / getDuration(), 0.5f, 0.75f, 0.f, 1.f); 125 F32 slerp_amt = clamp_rescale(activeTime / getDuration(), 0.5f, 0.75f, 0.f, 1.f);
126 126
127 mPelvisStatep->setRotation(mPelvisStatep->getRotation() * slerp(slerp_amt, mRotationToGroundNormal, LLQuaternion())); 127 if (mPelvisState.notNull())
128 128 {
129 mPelvisState->setRotation(mPelvisState->getRotation() * slerp(slerp_amt, mRotationToGroundNormal, LLQuaternion()));
130 }
131
129 return result; 132 return result;
130} 133}
131 134
diff --git a/linden/indra/llcharacter/llkeyframefallmotion.h b/linden/indra/llcharacter/llkeyframefallmotion.h
index 9f6ed6b..b35925f 100644
--- a/linden/indra/llcharacter/llkeyframefallmotion.h
+++ b/linden/indra/llcharacter/llkeyframefallmotion.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -75,7 +75,7 @@ protected:
75 //------------------------------------------------------------------------- 75 //-------------------------------------------------------------------------
76 LLCharacter* mCharacter; 76 LLCharacter* mCharacter;
77 F32 mVelocityZ; 77 F32 mVelocityZ;
78 LLJointState* mPelvisStatep; 78 LLPointer<LLJointState> mPelvisState;
79 LLQuaternion mRotationToGroundNormal; 79 LLQuaternion mRotationToGroundNormal;
80}; 80};
81 81
diff --git a/linden/indra/llcharacter/llkeyframemotion.cpp b/linden/indra/llcharacter/llkeyframemotion.cpp
index 9979750..4288b8d 100644
--- a/linden/indra/llcharacter/llkeyframemotion.cpp
+++ b/linden/indra/llcharacter/llkeyframemotion.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -71,24 +71,22 @@ static F32 MAX_CONSTRAINTS = 10;
71// JointMotionList 71// JointMotionList
72//----------------------------------------------------------------------------- 72//-----------------------------------------------------------------------------
73LLKeyframeMotion::JointMotionList::JointMotionList() 73LLKeyframeMotion::JointMotionList::JointMotionList()
74 : mNumJointMotions(0),
75 mJointMotionArray(NULL)
76{ 74{
77} 75}
78 76
79LLKeyframeMotion::JointMotionList::~JointMotionList() 77LLKeyframeMotion::JointMotionList::~JointMotionList()
80{ 78{
81 for_each(mConstraints.begin(), mConstraints.end(), DeletePointer()); 79 for_each(mConstraints.begin(), mConstraints.end(), DeletePointer());
82 delete [] mJointMotionArray; 80 for_each(mJointMotionArray.begin(), mJointMotionArray.end(), DeletePointer());
83} 81}
84 82
85U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo() 83U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo()
86{ 84{
87 S32 total_size = sizeof(JointMotionList); 85 S32 total_size = sizeof(JointMotionList);
88 86
89 for (U32 i = 0; i < mNumJointMotions; i++) 87 for (U32 i = 0; i < getNumJointMotions(); i++)
90 { 88 {
91 LLKeyframeMotion::JointMotion* joint_motion_p = &mJointMotionArray[i]; 89 LLKeyframeMotion::JointMotion* joint_motion_p = mJointMotionArray[i];
92 90
93 llinfos << "\tJoint " << joint_motion_p->mJointName << llendl; 91 llinfos << "\tJoint " << joint_motion_p->mJointName << llendl;
94 if (joint_motion_p->mUsage & LLJointState::SCALE) 92 if (joint_motion_p->mUsage & LLJointState::SCALE)
@@ -385,10 +383,10 @@ void LLKeyframeMotion::JointMotion::update(LLJointState* joint_state, F32 time,
385{ 383{
386 // this value being 0 is the cause of https://jira.lindenlab.com/browse/SL-22678 but I haven't 384 // this value being 0 is the cause of https://jira.lindenlab.com/browse/SL-22678 but I haven't
387 // managed to get a stack to see how it got here. Testing for 0 here will stop the crash. 385 // managed to get a stack to see how it got here. Testing for 0 here will stop the crash.
388 if ( joint_state == 0 ) 386 if ( joint_state == NULL )
389 { 387 {
390 return; 388 return;
391 }; 389 }
392 390
393 U32 usage = joint_state->getUsage(); 391 U32 usage = joint_state->getUsage();
394 392
@@ -431,7 +429,6 @@ void LLKeyframeMotion::JointMotion::update(LLJointState* joint_state, F32 time,
431LLKeyframeMotion::LLKeyframeMotion(const LLUUID &id) 429LLKeyframeMotion::LLKeyframeMotion(const LLUUID &id)
432 : LLMotion(id), 430 : LLMotion(id),
433 mJointMotionList(NULL), 431 mJointMotionList(NULL),
434 mJointStates(NULL),
435 mPelvisp(NULL), 432 mPelvisp(NULL),
436 mLastSkeletonSerialNum(0), 433 mLastSkeletonSerialNum(0),
437 mLastUpdateTime(0.f), 434 mLastUpdateTime(0.f),
@@ -448,10 +445,6 @@ LLKeyframeMotion::LLKeyframeMotion(const LLUUID &id)
448//----------------------------------------------------------------------------- 445//-----------------------------------------------------------------------------
449LLKeyframeMotion::~LLKeyframeMotion() 446LLKeyframeMotion::~LLKeyframeMotion()
450{ 447{
451 if (mJointStates)
452 {
453 delete [] mJointStates;
454 }
455 for_each(mConstraints.begin(), mConstraints.end(), DeletePointer()); 448 for_each(mConstraints.begin(), mConstraints.end(), DeletePointer());
456} 449}
457 450
@@ -464,6 +457,26 @@ LLMotion *LLKeyframeMotion::create(const LLUUID &id)
464} 457}
465 458
466//----------------------------------------------------------------------------- 459//-----------------------------------------------------------------------------
460// getJointState()
461//-----------------------------------------------------------------------------
462LLPointer<LLJointState>& LLKeyframeMotion::getJointState(U32 index)
463{
464 llassert_always (index < (S32)mJointStates.size());
465 return mJointStates[index];
466}
467
468//-----------------------------------------------------------------------------
469// getJoin()
470//-----------------------------------------------------------------------------
471LLJoint* LLKeyframeMotion::getJoint(U32 index)
472{
473 llassert_always (index < (S32)mJointStates.size());
474 LLJoint* joint = mJointStates[index]->getJoint();
475 llassert_always (joint);
476 return joint;
477}
478
479//-----------------------------------------------------------------------------
467// LLKeyframeMotion::onInitialize(LLCharacter *character) 480// LLKeyframeMotion::onInitialize(LLCharacter *character)
468//----------------------------------------------------------------------------- 481//-----------------------------------------------------------------------------
469LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *character) 482LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *character)
@@ -506,17 +519,25 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
506 // motion already existed in cache, so grab it 519 // motion already existed in cache, so grab it
507 mJointMotionList = joint_motion_list; 520 mJointMotionList = joint_motion_list;
508 521
522 mJointStates.reserve(mJointMotionList->getNumJointMotions());
523
509 // don't forget to allocate joint states 524 // don't forget to allocate joint states
510 mJointStates = new LLJointState[mJointMotionList->mNumJointMotions];
511
512 // set up joint states to point to character joints 525 // set up joint states to point to character joints
513 for(U32 i = 0; i < mJointMotionList->mNumJointMotions; i++) 526 for(U32 i = 0; i < mJointMotionList->getNumJointMotions(); i++)
514 { 527 {
515 if (LLJoint *jointp = mCharacter->getJoint(mJointMotionList->mJointMotionArray[i].mJointName)) 528 JointMotion* joint_motion = mJointMotionList->getJointMotion(i);
529 if (LLJoint *joint = mCharacter->getJoint(joint_motion->mJointName))
530 {
531 LLPointer<LLJointState> joint_state = new LLJointState;
532 mJointStates.push_back(joint_state);
533 joint_state->setJoint(joint);
534 joint_state->setUsage(joint_motion->mUsage);
535 joint_state->setPriority(joint_motion->mPriority);
536 }
537 else
516 { 538 {
517 mJointStates[i].setJoint(jointp); 539 // add dummy joint state with no associated joint
518 mJointStates[i].setUsage(mJointMotionList->mJointMotionArray[i].mUsage); 540 mJointStates.push_back(new LLJointState);
519 mJointStates[i].setPriority(joint_motion_list->mJointMotionArray[i].mPriority);
520 } 541 }
521 } 542 }
522 mAssetStatus = ASSET_LOADED; 543 mAssetStatus = ASSET_LOADED;
@@ -587,11 +608,12 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
587BOOL LLKeyframeMotion::setupPose() 608BOOL LLKeyframeMotion::setupPose()
588{ 609{
589 // add all valid joint states to the pose 610 // add all valid joint states to the pose
590 for (U32 jm=0; jm<mJointMotionList->mNumJointMotions; jm++) 611 for (U32 jm=0; jm<mJointMotionList->getNumJointMotions(); jm++)
591 { 612 {
592 if ( mJointStates[jm].getJoint() ) 613 LLPointer<LLJointState> joint_state = getJointState(jm);
614 if ( joint_state->getJoint() )
593 { 615 {
594 addJointState( &mJointStates[jm] ); 616 addJointState( joint_state );
595 } 617 }
596 } 618 }
597 619
@@ -692,13 +714,12 @@ BOOL LLKeyframeMotion::onUpdate(F32 time, U8* joint_mask)
692//----------------------------------------------------------------------------- 714//-----------------------------------------------------------------------------
693void LLKeyframeMotion::applyKeyframes(F32 time) 715void LLKeyframeMotion::applyKeyframes(F32 time)
694{ 716{
695 U32 i; 717 llassert_always (mJointMotionList->getNumJointMotions() <= mJointStates.size());
696 for (i=0; i<mJointMotionList->mNumJointMotions; i++) 718 for (U32 i=0; i<mJointMotionList->getNumJointMotions(); i++)
697 { 719 {
698 mJointMotionList->mJointMotionArray[i].update( 720 mJointMotionList->getJointMotion(i)->update(mJointStates[i],
699 &mJointStates[i], 721 time,
700 time, 722 mJointMotionList->mDuration );
701 mJointMotionList->mDuration );
702 } 723 }
703 724
704 LLJoint::JointPriority* pose_priority = (LLJoint::JointPriority* )mCharacter->getAnimationData("Hand Pose Priority"); 725 LLJoint::JointPriority* pose_priority = (LLJoint::JointPriority* )mCharacter->getAnimationData("Hand Pose Priority");
@@ -793,7 +814,7 @@ void LLKeyframeMotion::initializeConstraint(JointConstraint* constraint)
793 814
794 S32 joint_num; 815 S32 joint_num;
795 LLVector3 source_pos = mCharacter->getVolumePos(shared_data->mSourceConstraintVolume, shared_data->mSourceConstraintOffset); 816 LLVector3 source_pos = mCharacter->getVolumePos(shared_data->mSourceConstraintVolume, shared_data->mSourceConstraintOffset);
796 LLJoint* cur_joint = mJointStates[shared_data->mJointStateIndices[0]].getJoint(); 817 LLJoint* cur_joint = getJoint(shared_data->mJointStateIndices[0]);
797 818
798 F32 source_pos_offset = dist_vec(source_pos, cur_joint->getWorldPosition()); 819 F32 source_pos_offset = dist_vec(source_pos, cur_joint->getWorldPosition());
799 820
@@ -802,7 +823,7 @@ void LLKeyframeMotion::initializeConstraint(JointConstraint* constraint)
802 // grab joint lengths 823 // grab joint lengths
803 for (joint_num = 1; joint_num < shared_data->mChainLength; joint_num++) 824 for (joint_num = 1; joint_num < shared_data->mChainLength; joint_num++)
804 { 825 {
805 cur_joint = mJointStates[shared_data->mJointStateIndices[joint_num]].getJoint(); 826 cur_joint = getJointState(shared_data->mJointStateIndices[joint_num])->getJoint();
806 if (!cur_joint) 827 if (!cur_joint)
807 { 828 {
808 return; 829 return;
@@ -844,7 +865,7 @@ void LLKeyframeMotion::activateConstraint(JointConstraint* constraint)
844 865
845 for (joint_num = 1; joint_num < shared_data->mChainLength; joint_num++) 866 for (joint_num = 1; joint_num < shared_data->mChainLength; joint_num++)
846 { 867 {
847 LLJoint* cur_joint = mJointStates[shared_data->mJointStateIndices[joint_num]].getJoint(); 868 LLJoint* cur_joint = getJoint(shared_data->mJointStateIndices[joint_num]);
848 constraint->mPositions[joint_num] = (cur_joint->getWorldPosition() - mPelvisp->getWorldPosition()) * ~mPelvisp->getWorldRotation(); 869 constraint->mPositions[joint_num] = (cur_joint->getWorldPosition() - mPelvisp->getWorldPosition()) * ~mPelvisp->getWorldRotation();
849 } 870 }
850 871
@@ -884,7 +905,6 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
884 LLVector3 velocities[MAX_CHAIN_LENGTH - 1]; 905 LLVector3 velocities[MAX_CHAIN_LENGTH - 1];
885 LLQuaternion old_rots[MAX_CHAIN_LENGTH]; 906 LLQuaternion old_rots[MAX_CHAIN_LENGTH];
886 S32 joint_num; 907 S32 joint_num;
887 LLJoint* cur_joint;
888 908
889 if (time < shared_data->mEaseInStartTime) 909 if (time < shared_data->mEaseInStartTime)
890 { 910 {
@@ -905,7 +925,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
905 activateConstraint(constraint); 925 activateConstraint(constraint);
906 } 926 }
907 927
908 LLJoint* root_joint = mJointStates[shared_data->mJointStateIndices[shared_data->mChainLength]].getJoint(); 928 LLJoint* root_joint = getJoint(shared_data->mJointStateIndices[shared_data->mChainLength]);
909 LLVector3 root_pos = root_joint->getWorldPosition(); 929 LLVector3 root_pos = root_joint->getWorldPosition();
910// LLQuaternion root_rot = 930// LLQuaternion root_rot =
911 root_joint->getParent()->getWorldRotation(); 931 root_joint->getParent()->getWorldRotation();
@@ -916,14 +936,14 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
916 //apply underlying keyframe animation to get nominal "kinematic" joint positions 936 //apply underlying keyframe animation to get nominal "kinematic" joint positions
917 for (joint_num = 0; joint_num <= shared_data->mChainLength; joint_num++) 937 for (joint_num = 0; joint_num <= shared_data->mChainLength; joint_num++)
918 { 938 {
919 cur_joint = mJointStates[shared_data->mJointStateIndices[joint_num]].getJoint(); 939 LLJoint* cur_joint = getJoint(shared_data->mJointStateIndices[joint_num]);
920 if (joint_mask[cur_joint->getJointNum()] >= (0xff >> (7 - getPriority()))) 940 if (joint_mask[cur_joint->getJointNum()] >= (0xff >> (7 - getPriority())))
921 { 941 {
922 // skip constraint 942 // skip constraint
923 return; 943 return;
924 } 944 }
925 old_rots[joint_num] = cur_joint->getRotation(); 945 old_rots[joint_num] = cur_joint->getRotation();
926 cur_joint->setRotation(mJointStates[shared_data->mJointStateIndices[joint_num]].getRotation()); 946 cur_joint->setRotation(getJointState(shared_data->mJointStateIndices[joint_num])->getRotation());
927 } 947 }
928 948
929 949
@@ -1007,7 +1027,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
1007 1027
1008 if (shared_data->mChainLength) 1028 if (shared_data->mChainLength)
1009 { 1029 {
1010 LLQuaternion end_rot = mJointStates[shared_data->mJointStateIndices[0]].getJoint()->getWorldRotation(); 1030 LLQuaternion end_rot = getJoint(shared_data->mJointStateIndices[0])->getWorldRotation();
1011 1031
1012 // slam start and end of chain to the proper positions (rest of chain stays put) 1032 // slam start and end of chain to the proper positions (rest of chain stays put)
1013 positions[0] = lerp(keyframe_source_pos, target_pos, weight); 1033 positions[0] = lerp(keyframe_source_pos, target_pos, weight);
@@ -1016,7 +1036,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
1016 // grab keyframe-specified positions of joints 1036 // grab keyframe-specified positions of joints
1017 for (joint_num = 1; joint_num < shared_data->mChainLength; joint_num++) 1037 for (joint_num = 1; joint_num < shared_data->mChainLength; joint_num++)
1018 { 1038 {
1019 LLVector3 kinematic_position = mJointStates[shared_data->mJointStateIndices[joint_num]].getJoint()->getWorldPosition() + 1039 LLVector3 kinematic_position = getJoint(shared_data->mJointStateIndices[joint_num])->getWorldPosition() +
1020 (source_to_target * constraint->mJointLengthFractions[joint_num]); 1040 (source_to_target * constraint->mJointLengthFractions[joint_num]);
1021 1041
1022 // convert intermediate joint positions to world coordinates 1042 // convert intermediate joint positions to world coordinates
@@ -1061,9 +1081,9 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
1061 1081
1062 for (joint_num = shared_data->mChainLength; joint_num > 0; joint_num--) 1082 for (joint_num = shared_data->mChainLength; joint_num > 0; joint_num--)
1063 { 1083 {
1064 LLQuaternion parent_rot = mJointStates[shared_data->mJointStateIndices[joint_num]].getJoint()->getParent()->getWorldRotation(); 1084 LLJoint* cur_joint = getJoint(shared_data->mJointStateIndices[joint_num]);
1065 cur_joint = mJointStates[shared_data->mJointStateIndices[joint_num]].getJoint(); 1085 LLJoint* child_joint = getJoint(shared_data->mJointStateIndices[joint_num - 1]);
1066 LLJoint* child_joint = mJointStates[shared_data->mJointStateIndices[joint_num - 1]].getJoint(); 1086 LLQuaternion parent_rot = cur_joint->getParent()->getWorldRotation();
1067 1087
1068 LLQuaternion cur_rot = cur_joint->getWorldRotation(); 1088 LLQuaternion cur_rot = cur_joint->getWorldRotation();
1069 LLQuaternion fixup_rot; 1089 LLQuaternion fixup_rot;
@@ -1088,25 +1108,25 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
1088 1108
1089 if (weight != 1.f) 1109 if (weight != 1.f)
1090 { 1110 {
1091 LLQuaternion cur_rot = mJointStates[shared_data->mJointStateIndices[joint_num]].getRotation(); 1111 LLQuaternion cur_rot = getJointState(shared_data->mJointStateIndices[joint_num])->getRotation();
1092 target_rot = nlerp(weight, cur_rot, target_rot); 1112 target_rot = nlerp(weight, cur_rot, target_rot);
1093 } 1113 }
1094 1114
1095 mJointStates[shared_data->mJointStateIndices[joint_num]].setRotation(target_rot); 1115 getJointState(shared_data->mJointStateIndices[joint_num])->setRotation(target_rot);
1096 cur_joint->setRotation(target_rot); 1116 cur_joint->setRotation(target_rot);
1097 } 1117 }
1098 1118
1099 LLJoint* end_joint = mJointStates[shared_data->mJointStateIndices[0]].getJoint(); 1119 LLJoint* end_joint = getJoint(shared_data->mJointStateIndices[0]);
1100 LLQuaternion end_local_rot = end_rot * ~end_joint->getParent()->getWorldRotation(); 1120 LLQuaternion end_local_rot = end_rot * ~end_joint->getParent()->getWorldRotation();
1101 1121
1102 if (weight == 1.f) 1122 if (weight == 1.f)
1103 { 1123 {
1104 mJointStates[shared_data->mJointStateIndices[0]].setRotation(end_local_rot); 1124 getJointState(shared_data->mJointStateIndices[0])->setRotation(end_local_rot);
1105 } 1125 }
1106 else 1126 else
1107 { 1127 {
1108 LLQuaternion cur_rot = mJointStates[shared_data->mJointStateIndices[0]].getRotation(); 1128 LLQuaternion cur_rot = getJointState(shared_data->mJointStateIndices[0])->getRotation();
1109 mJointStates[shared_data->mJointStateIndices[0]].setRotation(nlerp(weight, cur_rot, end_local_rot)); 1129 getJointState(shared_data->mJointStateIndices[0])->setRotation(nlerp(weight, cur_rot, end_local_rot));
1110 } 1130 }
1111 1131
1112 // save simulated positions in pelvis-space and calculate total fixup distance 1132 // save simulated positions in pelvis-space and calculate total fixup distance
@@ -1124,17 +1144,17 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
1124 //reset old joint rots 1144 //reset old joint rots
1125 for (joint_num = 0; joint_num <= shared_data->mChainLength; joint_num++) 1145 for (joint_num = 0; joint_num <= shared_data->mChainLength; joint_num++)
1126 { 1146 {
1127 mJointStates[shared_data->mJointStateIndices[joint_num]].getJoint()->setRotation(old_rots[joint_num]); 1147 getJoint(shared_data->mJointStateIndices[joint_num])->setRotation(old_rots[joint_num]);
1128 } 1148 }
1129 } 1149 }
1130 // simple positional constraint (pelvis only) 1150 // simple positional constraint (pelvis only)
1131 else if (mJointStates[shared_data->mJointStateIndices[0]].getUsage() & LLJointState::POS) 1151 else if (getJointState(shared_data->mJointStateIndices[0])->getUsage() & LLJointState::POS)
1132 { 1152 {
1133 LLVector3 delta = source_to_target * weight; 1153 LLVector3 delta = source_to_target * weight;
1134 LLJointState* current_joint_statep = &mJointStates[shared_data->mJointStateIndices[0]]; 1154 LLPointer<LLJointState> current_joint_state = getJointState(shared_data->mJointStateIndices[0]);
1135 LLQuaternion parent_rot = current_joint_statep->getJoint()->getParent()->getWorldRotation(); 1155 LLQuaternion parent_rot = current_joint_state->getJoint()->getParent()->getWorldRotation();
1136 delta = delta * ~parent_rot; 1156 delta = delta * ~parent_rot;
1137 current_joint_statep->setPosition(current_joint_statep->getJoint()->getPosition() + delta); 1157 current_joint_state->setPosition(current_joint_state->getJoint()->getPosition() + delta);
1138 } 1158 }
1139} 1159}
1140 1160
@@ -1145,7 +1165,6 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
1145{ 1165{
1146 BOOL old_version = FALSE; 1166 BOOL old_version = FALSE;
1147 mJointMotionList = new LLKeyframeMotion::JointMotionList; 1167 mJointMotionList = new LLKeyframeMotion::JointMotionList;
1148 mJointMotionList->mNumJointMotions = 0;
1149 1168
1150 //------------------------------------------------------------------------- 1169 //-------------------------------------------------------------------------
1151 // get base priority 1170 // get base priority
@@ -1261,40 +1280,38 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
1261 //------------------------------------------------------------------------- 1280 //-------------------------------------------------------------------------
1262 // get number of joint motions 1281 // get number of joint motions
1263 //------------------------------------------------------------------------- 1282 //-------------------------------------------------------------------------
1264 if (!dp.unpackU32(mJointMotionList->mNumJointMotions, "num_joints")) 1283 U32 num_motions = 0;
1284 if (!dp.unpackU32(num_motions, "num_joints"))
1265 { 1285 {
1266 llwarns << "can't read number of joints" << llendl; 1286 llwarns << "can't read number of joints" << llendl;
1267 return FALSE; 1287 return FALSE;
1268 } 1288 }
1269 1289
1270 if (mJointMotionList->mNumJointMotions == 0) 1290 if (num_motions == 0)
1271 { 1291 {
1272 llwarns << "no joints in animation" << llendl; 1292 llwarns << "no joints in animation" << llendl;
1273 return FALSE; 1293 return FALSE;
1274 } 1294 }
1275 else if (mJointMotionList->mNumJointMotions > LL_CHARACTER_MAX_JOINTS) 1295 else if (num_motions > LL_CHARACTER_MAX_JOINTS)
1276 { 1296 {
1277 llwarns << "too many joints in animation" << llendl; 1297 llwarns << "too many joints in animation" << llendl;
1278 return FALSE; 1298 return FALSE;
1279 } 1299 }
1280 1300
1281 mJointMotionList->mJointMotionArray = new JointMotion[mJointMotionList->mNumJointMotions]; 1301 mJointMotionList->mJointMotionArray.clear();
1282 mJointStates = new LLJointState[mJointMotionList->mNumJointMotions]; 1302 mJointMotionList->mJointMotionArray.reserve(num_motions);
1283 1303 mJointStates.clear();
1284 if (!mJointMotionList->mJointMotionArray) 1304 mJointStates.reserve(num_motions);
1285 {
1286 mJointMotionList->mDuration = 0.0f;
1287 mJointMotionList->mEaseInDuration = 0.0f;
1288 mJointMotionList->mEaseOutDuration = 0.0f;
1289 return FALSE;
1290 }
1291 1305
1292 //------------------------------------------------------------------------- 1306 //-------------------------------------------------------------------------
1293 // initialize joint motions 1307 // initialize joint motions
1294 //------------------------------------------------------------------------- 1308 //-------------------------------------------------------------------------
1295 S32 k; 1309
1296 for(U32 i=0; i<mJointMotionList->mNumJointMotions; ++i) 1310 for(U32 i=0; i<num_motions; ++i)
1297 { 1311 {
1312 JointMotion* joint_motion = new JointMotion;
1313 mJointMotionList->mJointMotionArray.push_back(joint_motion);
1314
1298 std::string joint_name; 1315 std::string joint_name;
1299 if (!dp.unpackString(joint_name, "joint_name")) 1316 if (!dp.unpackString(joint_name, "joint_name"))
1300 { 1317 {
@@ -1316,9 +1333,12 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
1316 //return FALSE; 1333 //return FALSE;
1317 } 1334 }
1318 1335
1319 mJointMotionList->mJointMotionArray[i].mJointName = joint_name; 1336 joint_motion->mJointName = joint_name;
1320 mJointStates[i].setJoint( joint ); 1337
1321 mJointStates[i].setUsage( 0 ); 1338 LLPointer<LLJointState> joint_state = new LLJointState;
1339 mJointStates.push_back(joint_state);
1340 joint_state->setJoint( joint );
1341 joint_state->setUsage( 0 );
1322 1342
1323 //--------------------------------------------------------------------- 1343 //---------------------------------------------------------------------
1324 // get joint priority 1344 // get joint priority
@@ -1330,36 +1350,36 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
1330 return FALSE; 1350 return FALSE;
1331 } 1351 }
1332 1352
1333 mJointMotionList->mJointMotionArray[i].mPriority = (LLJoint::JointPriority)joint_priority; 1353 joint_motion->mPriority = (LLJoint::JointPriority)joint_priority;
1334 if (joint_priority != LLJoint::USE_MOTION_PRIORITY && 1354 if (joint_priority != LLJoint::USE_MOTION_PRIORITY &&
1335 joint_priority > mJointMotionList->mMaxPriority) 1355 joint_priority > mJointMotionList->mMaxPriority)
1336 { 1356 {
1337 mJointMotionList->mMaxPriority = (LLJoint::JointPriority)joint_priority; 1357 mJointMotionList->mMaxPriority = (LLJoint::JointPriority)joint_priority;
1338 } 1358 }
1339 1359
1340 mJointStates[i].setPriority((LLJoint::JointPriority)joint_priority); 1360 joint_state->setPriority((LLJoint::JointPriority)joint_priority);
1341 1361
1342 //--------------------------------------------------------------------- 1362 //---------------------------------------------------------------------
1343 // scan rotation curve header 1363 // scan rotation curve header
1344 //--------------------------------------------------------------------- 1364 //---------------------------------------------------------------------
1345 if (!dp.unpackS32(mJointMotionList->mJointMotionArray[i].mRotationCurve.mNumKeys, "num_rot_keys")) 1365 if (!dp.unpackS32(joint_motion->mRotationCurve.mNumKeys, "num_rot_keys"))
1346 { 1366 {
1347 llwarns << "can't read number of rotation keys" << llendl; 1367 llwarns << "can't read number of rotation keys" << llendl;
1348 return FALSE; 1368 return FALSE;
1349 } 1369 }
1350 1370
1351 mJointMotionList->mJointMotionArray[i].mRotationCurve.mInterpolationType = IT_LINEAR; 1371 joint_motion->mRotationCurve.mInterpolationType = IT_LINEAR;
1352 if (mJointMotionList->mJointMotionArray[i].mRotationCurve.mNumKeys != 0) 1372 if (joint_motion->mRotationCurve.mNumKeys != 0)
1353 { 1373 {
1354 mJointStates[i].setUsage(mJointStates[i].getUsage() | LLJointState::ROT ); 1374 joint_state->setUsage(joint_state->getUsage() | LLJointState::ROT );
1355 } 1375 }
1356 1376
1357 //--------------------------------------------------------------------- 1377 //---------------------------------------------------------------------
1358 // scan rotation curve keys 1378 // scan rotation curve keys
1359 //--------------------------------------------------------------------- 1379 //---------------------------------------------------------------------
1360 RotationCurve *rCurve = &mJointMotionList->mJointMotionArray[i].mRotationCurve; 1380 RotationCurve *rCurve = &joint_motion->mRotationCurve;
1361 1381
1362 for (k = 0; k < mJointMotionList->mJointMotionArray[i].mRotationCurve.mNumKeys; k++) 1382 for (S32 k = 0; k < joint_motion->mRotationCurve.mNumKeys; k++)
1363 { 1383 {
1364 F32 time; 1384 F32 time;
1365 U16 time_short; 1385 U16 time_short;
@@ -1424,24 +1444,24 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
1424 //--------------------------------------------------------------------- 1444 //---------------------------------------------------------------------
1425 // scan position curve header 1445 // scan position curve header
1426 //--------------------------------------------------------------------- 1446 //---------------------------------------------------------------------
1427 if (!dp.unpackS32(mJointMotionList->mJointMotionArray[i].mPositionCurve.mNumKeys, "num_pos_keys")) 1447 if (!dp.unpackS32(joint_motion->mPositionCurve.mNumKeys, "num_pos_keys"))
1428 { 1448 {
1429 llwarns << "can't read number of position keys" << llendl; 1449 llwarns << "can't read number of position keys" << llendl;
1430 return FALSE; 1450 return FALSE;
1431 } 1451 }
1432 1452
1433 mJointMotionList->mJointMotionArray[i].mPositionCurve.mInterpolationType = IT_LINEAR; 1453 joint_motion->mPositionCurve.mInterpolationType = IT_LINEAR;
1434 if (mJointMotionList->mJointMotionArray[i].mPositionCurve.mNumKeys != 0) 1454 if (joint_motion->mPositionCurve.mNumKeys != 0)
1435 { 1455 {
1436 mJointStates[i].setUsage(mJointStates[i].getUsage() | LLJointState::POS ); 1456 joint_state->setUsage(joint_state->getUsage() | LLJointState::POS );
1437 } 1457 }
1438 1458
1439 //--------------------------------------------------------------------- 1459 //---------------------------------------------------------------------
1440 // scan position curve keys 1460 // scan position curve keys
1441 //--------------------------------------------------------------------- 1461 //---------------------------------------------------------------------
1442 PositionCurve *pCurve = &mJointMotionList->mJointMotionArray[i].mPositionCurve; 1462 PositionCurve *pCurve = &joint_motion->mPositionCurve;
1443 BOOL is_pelvis = mJointMotionList->mJointMotionArray[i].mJointName == "mPelvis"; 1463 BOOL is_pelvis = joint_motion->mJointName == "mPelvis";
1444 for (k = 0; k < mJointMotionList->mJointMotionArray[i].mPositionCurve.mNumKeys; k++) 1464 for (S32 k = 0; k < joint_motion->mPositionCurve.mNumKeys; k++)
1445 { 1465 {
1446 U16 time_short; 1466 U16 time_short;
1447 PositionKey* pos_key = new PositionKey; 1467 PositionKey* pos_key = new PositionKey;
@@ -1501,7 +1521,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
1501 } 1521 }
1502 } 1522 }
1503 1523
1504 mJointMotionList->mJointMotionArray[i].mUsage = mJointStates[i].getUsage(); 1524 joint_motion->mUsage = joint_state->getUsage();
1505 } 1525 }
1506 1526
1507 //------------------------------------------------------------------------- 1527 //-------------------------------------------------------------------------
@@ -1655,9 +1675,9 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
1655 } 1675 }
1656 joint = parent; 1676 joint = parent;
1657 constraintp->mJointStateIndices[i] = -1; 1677 constraintp->mJointStateIndices[i] = -1;
1658 for (U32 j = 0; j < mJointMotionList->mNumJointMotions; j++) 1678 for (U32 j = 0; j < mJointMotionList->getNumJointMotions(); j++)
1659 { 1679 {
1660 if(mJointStates[j].getJoint() == joint) 1680 if(getJoint(j) == joint)
1661 { 1681 {
1662 constraintp->mJointStateIndices[i] = (S32)j; 1682 constraintp->mJointStateIndices[i] = (S32)j;
1663 break; 1683 break;
@@ -1695,11 +1715,11 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const
1695 success &= dp.packF32(mJointMotionList->mEaseInDuration, "ease_in_duration"); 1715 success &= dp.packF32(mJointMotionList->mEaseInDuration, "ease_in_duration");
1696 success &= dp.packF32(mJointMotionList->mEaseOutDuration, "ease_out_duration"); 1716 success &= dp.packF32(mJointMotionList->mEaseOutDuration, "ease_out_duration");
1697 success &= dp.packU32(mJointMotionList->mHandPose, "hand_pose"); 1717 success &= dp.packU32(mJointMotionList->mHandPose, "hand_pose");
1698 success &= dp.packU32(mJointMotionList->mNumJointMotions, "num_joints"); 1718 success &= dp.packU32(mJointMotionList->getNumJointMotions(), "num_joints");
1699 1719
1700 for (U32 i = 0; i < mJointMotionList->mNumJointMotions; i++) 1720 for (U32 i = 0; i < mJointMotionList->getNumJointMotions(); i++)
1701 { 1721 {
1702 JointMotion* joint_motionp = &mJointMotionList->mJointMotionArray[i]; 1722 JointMotion* joint_motionp = mJointMotionList->getJointMotion(i);
1703 success &= dp.packString(joint_motionp->mJointName.c_str(), "joint_name"); 1723 success &= dp.packString(joint_motionp->mJointName.c_str(), "joint_name");
1704 success &= dp.packS32(joint_motionp->mPriority, "joint_priority"); 1724 success &= dp.packS32(joint_motionp->mPriority, "joint_priority");
1705 success &= dp.packS32(joint_motionp->mRotationCurve.mNumKeys, "num_rot_keys"); 1725 success &= dp.packS32(joint_motionp->mRotationCurve.mNumKeys, "num_rot_keys");
@@ -1806,13 +1826,14 @@ void LLKeyframeMotion::setPriority(S32 priority)
1806 mJointMotionList->mBasePriority = (LLJoint::JointPriority)priority; 1826 mJointMotionList->mBasePriority = (LLJoint::JointPriority)priority;
1807 mJointMotionList->mMaxPriority = mJointMotionList->mBasePriority; 1827 mJointMotionList->mMaxPriority = mJointMotionList->mBasePriority;
1808 1828
1809 for (U32 i = 0; i < mJointMotionList->mNumJointMotions; i++) 1829 for (U32 i = 0; i < mJointMotionList->getNumJointMotions(); i++)
1810 { 1830 {
1811 mJointMotionList->mJointMotionArray[i].mPriority = (LLJoint::JointPriority)llclamp( 1831 JointMotion* joint_motion = mJointMotionList->getJointMotion(i);
1812 (S32)mJointMotionList->mJointMotionArray[i].mPriority + priority_delta, 1832 joint_motion->mPriority = (LLJoint::JointPriority)llclamp(
1833 (S32)joint_motion->mPriority + priority_delta,
1813 (S32)LLJoint::LOW_PRIORITY, 1834 (S32)LLJoint::LOW_PRIORITY,
1814 (S32)LLJoint::HIGHEST_PRIORITY); 1835 (S32)LLJoint::HIGHEST_PRIORITY);
1815 mJointStates[i].setPriority(mJointMotionList->mJointMotionArray[i].mPriority); 1836 getJointState(i)->setPriority(joint_motion->mPriority);
1816 } 1837 }
1817 } 1838 }
1818} 1839}
@@ -1888,11 +1909,13 @@ void LLKeyframeMotion::setLoopIn(F32 in_point)
1888 mJointMotionList->mLoopInPoint = in_point; 1909 mJointMotionList->mLoopInPoint = in_point;
1889 1910
1890 // set up loop keys 1911 // set up loop keys
1891 for (U32 i = 0; i < mJointMotionList->mNumJointMotions; i++) 1912 for (U32 i = 0; i < mJointMotionList->getNumJointMotions(); i++)
1892 { 1913 {
1893 PositionCurve* pos_curve = &mJointMotionList->mJointMotionArray[i].mPositionCurve; 1914 JointMotion* joint_motion = mJointMotionList->getJointMotion(i);
1894 RotationCurve* rot_curve = &mJointMotionList->mJointMotionArray[i].mRotationCurve; 1915
1895 ScaleCurve* scale_curve = &mJointMotionList->mJointMotionArray[i].mScaleCurve; 1916 PositionCurve* pos_curve = &joint_motion->mPositionCurve;
1917 RotationCurve* rot_curve = &joint_motion->mRotationCurve;
1918 ScaleCurve* scale_curve = &joint_motion->mScaleCurve;
1896 1919
1897 pos_curve->mLoopInKey.mTime = mJointMotionList->mLoopInPoint; 1920 pos_curve->mLoopInKey.mTime = mJointMotionList->mLoopInPoint;
1898 rot_curve->mLoopInKey.mTime = mJointMotionList->mLoopInPoint; 1921 rot_curve->mLoopInKey.mTime = mJointMotionList->mLoopInPoint;
@@ -1915,11 +1938,13 @@ void LLKeyframeMotion::setLoopOut(F32 out_point)
1915 mJointMotionList->mLoopOutPoint = out_point; 1938 mJointMotionList->mLoopOutPoint = out_point;
1916 1939
1917 // set up loop keys 1940 // set up loop keys
1918 for (U32 i = 0; i < mJointMotionList->mNumJointMotions; i++) 1941 for (U32 i = 0; i < mJointMotionList->getNumJointMotions(); i++)
1919 { 1942 {
1920 PositionCurve* pos_curve = &mJointMotionList->mJointMotionArray[i].mPositionCurve; 1943 JointMotion* joint_motion = mJointMotionList->getJointMotion(i);
1921 RotationCurve* rot_curve = &mJointMotionList->mJointMotionArray[i].mRotationCurve; 1944
1922 ScaleCurve* scale_curve = &mJointMotionList->mJointMotionArray[i].mScaleCurve; 1945 PositionCurve* pos_curve = &joint_motion->mPositionCurve;
1946 RotationCurve* rot_curve = &joint_motion->mRotationCurve;
1947 ScaleCurve* scale_curve = &joint_motion->mScaleCurve;
1923 1948
1924 pos_curve->mLoopOutKey.mTime = mJointMotionList->mLoopOutPoint; 1949 pos_curve->mLoopOutKey.mTime = mJointMotionList->mLoopOutPoint;
1925 rot_curve->mLoopOutKey.mTime = mJointMotionList->mLoopOutPoint; 1950 rot_curve->mLoopOutKey.mTime = mJointMotionList->mLoopOutPoint;
@@ -2020,10 +2045,10 @@ void LLKeyframeMotion::writeCAL3D(apr_file_t* fp)
2020// </TRACK> 2045// </TRACK>
2021// </ANIMATION> 2046// </ANIMATION>
2022 2047
2023 apr_file_printf(fp, "<ANIMATION VERSION=\"1000\" DURATION=\"%.5f\" NUMTRACKS=\"%d\">\n", getDuration(), mJointMotionList->mNumJointMotions); 2048 apr_file_printf(fp, "<ANIMATION VERSION=\"1000\" DURATION=\"%.5f\" NUMTRACKS=\"%d\">\n", getDuration(), mJointMotionList->getNumJointMotions());
2024 for (U32 joint_index = 0; joint_index < mJointMotionList->mNumJointMotions; joint_index++) 2049 for (U32 joint_index = 0; joint_index < mJointMotionList->getNumJointMotions(); joint_index++)
2025 { 2050 {
2026 JointMotion* joint_motionp = &mJointMotionList->mJointMotionArray[joint_index]; 2051 JointMotion* joint_motionp = mJointMotionList->getJointMotion(joint_index);
2027 LLJoint* animated_joint = mCharacter->getJoint(joint_motionp->mJointName); 2052 LLJoint* animated_joint = mCharacter->getJoint(joint_motionp->mJointName);
2028 S32 joint_num = animated_joint->mJointNum + 1; 2053 S32 joint_num = animated_joint->mJointNum + 1;
2029 2054
diff --git a/linden/indra/llcharacter/llkeyframemotion.h b/linden/indra/llcharacter/llkeyframemotion.h
index ef3f6dd..0ad0181 100644
--- a/linden/indra/llcharacter/llkeyframemotion.h
+++ b/linden/indra/llcharacter/llkeyframemotion.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -73,6 +73,11 @@ public:
73 // Destructor 73 // Destructor
74 virtual ~LLKeyframeMotion(); 74 virtual ~LLKeyframeMotion();
75 75
76private:
77 // private helper functions to wrap some asserts
78 LLPointer<LLJointState>& getJointState(U32 index);
79 LLJoint* getJoint(U32 index);
80
76public: 81public:
77 //------------------------------------------------------------------------- 82 //-------------------------------------------------------------------------
78 // functions to support MotionController and MotionRegistry 83 // functions to support MotionController and MotionRegistry
@@ -388,7 +393,7 @@ public:
388 U32 mUsage; 393 U32 mUsage;
389 LLJoint::JointPriority mPriority; 394 LLJoint::JointPriority mPriority;
390 395
391 void update(LLJointState *joint_state, F32 time, F32 duration); 396 void update(LLJointState* joint_state, F32 time, F32 duration);
392 }; 397 };
393 398
394 //------------------------------------------------------------------------- 399 //-------------------------------------------------------------------------
@@ -397,8 +402,7 @@ public:
397 class JointMotionList 402 class JointMotionList
398 { 403 {
399 public: 404 public:
400 U32 mNumJointMotions; 405 std::vector<JointMotion*> mJointMotionArray;
401 JointMotion* mJointMotionArray;
402 F32 mDuration; 406 F32 mDuration;
403 BOOL mLoop; 407 BOOL mLoop;
404 F32 mLoopInPoint; 408 F32 mLoopInPoint;
@@ -415,6 +419,8 @@ public:
415 JointMotionList(); 419 JointMotionList();
416 ~JointMotionList(); 420 ~JointMotionList();
417 U32 dumpDiagInfo(); 421 U32 dumpDiagInfo();
422 JointMotion* getJointMotion(U32 index) const { llassert(index < mJointMotionArray.size()); return mJointMotionArray[index]; }
423 U32 getNumJointMotions() const { return mJointMotionArray.size(); }
418 }; 424 };
419 425
420 426
@@ -425,7 +431,7 @@ protected:
425 // Member Data 431 // Member Data
426 //------------------------------------------------------------------------- 432 //-------------------------------------------------------------------------
427 JointMotionList* mJointMotionList; 433 JointMotionList* mJointMotionList;
428 LLJointState* mJointStates; 434 std::vector<LLPointer<LLJointState> > mJointStates;
429 LLJoint* mPelvisp; 435 LLJoint* mPelvisp;
430 LLCharacter* mCharacter; 436 LLCharacter* mCharacter;
431 std::string mEmoteName; 437 std::string mEmoteName;
diff --git a/linden/indra/llcharacter/llkeyframemotionparam.cpp b/linden/indra/llcharacter/llkeyframemotionparam.cpp
index 12b7296..2dd935c 100644
--- a/linden/indra/llcharacter/llkeyframemotionparam.cpp
+++ b/linden/indra/llcharacter/llkeyframemotionparam.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -61,7 +61,6 @@ BOOL LLKeyframeMotionParam::sortFunc(ParameterizedMotion *new_motion, Parameteri
61//----------------------------------------------------------------------------- 61//-----------------------------------------------------------------------------
62LLKeyframeMotionParam::LLKeyframeMotionParam( const LLUUID &id) : LLMotion(id) 62LLKeyframeMotionParam::LLKeyframeMotionParam( const LLUUID &id) : LLMotion(id)
63{ 63{
64 mJointStates = NULL;
65 mDefaultKeyframeMotion = NULL; 64 mDefaultKeyframeMotion = NULL;
66 mCharacter = NULL; 65 mCharacter = NULL;
67 66
diff --git a/linden/indra/llcharacter/llkeyframemotionparam.h b/linden/indra/llcharacter/llkeyframemotionparam.h
index 75977ee..a5bc2cb 100644
--- a/linden/indra/llcharacter/llkeyframemotionparam.h
+++ b/linden/indra/llcharacter/llkeyframemotionparam.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -145,7 +145,6 @@ protected:
145 145
146 typedef LLLinkedList < ParameterizedMotion > motion_list_t; 146 typedef LLLinkedList < ParameterizedMotion > motion_list_t;
147 LLAssocList <std::string, motion_list_t* > mParameterizedMotions; 147 LLAssocList <std::string, motion_list_t* > mParameterizedMotions;
148 LLJointState* mJointStates;
149 LLMotion* mDefaultKeyframeMotion; 148 LLMotion* mDefaultKeyframeMotion;
150 LLCharacter* mCharacter; 149 LLCharacter* mCharacter;
151 LLPoseBlender mPoseBlender; 150 LLPoseBlender mPoseBlender;
diff --git a/linden/indra/llcharacter/llkeyframestandmotion.cpp b/linden/indra/llcharacter/llkeyframestandmotion.cpp
index 9e850a4..6517681 100644
--- a/linden/indra/llcharacter/llkeyframestandmotion.cpp
+++ b/linden/indra/llcharacter/llkeyframestandmotion.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llkeyframestandmotion.h b/linden/indra/llcharacter/llkeyframestandmotion.h
index 0fcda27..6772b6e 100644
--- a/linden/indra/llcharacter/llkeyframestandmotion.h
+++ b/linden/indra/llcharacter/llkeyframestandmotion.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -78,15 +78,15 @@ public:
78 78
79 BOOL mFlipFeet; 79 BOOL mFlipFeet;
80 80
81 LLJointState *mPelvisState; 81 LLPointer<LLJointState> mPelvisState;
82 82
83 LLJointState *mHipLeftState; 83 LLPointer<LLJointState> mHipLeftState;
84 LLJointState *mKneeLeftState; 84 LLPointer<LLJointState> mKneeLeftState;
85 LLJointState *mAnkleLeftState; 85 LLPointer<LLJointState> mAnkleLeftState;
86 86
87 LLJointState *mHipRightState; 87 LLPointer<LLJointState> mHipRightState;
88 LLJointState *mKneeRightState; 88 LLPointer<LLJointState> mKneeRightState;
89 LLJointState *mAnkleRightState; 89 LLPointer<LLJointState> mAnkleRightState;
90 90
91 LLJoint mPelvisJoint; 91 LLJoint mPelvisJoint;
92 92
diff --git a/linden/indra/llcharacter/llkeyframewalkmotion.cpp b/linden/indra/llcharacter/llkeyframewalkmotion.cpp
index 83c1c49..d5f6b81 100644
--- a/linden/indra/llcharacter/llkeyframewalkmotion.cpp
+++ b/linden/indra/llcharacter/llkeyframewalkmotion.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -143,6 +143,8 @@ LLWalkAdjustMotion::LLWalkAdjustMotion(const LLUUID &id) : LLMotion(id)
143{ 143{
144 mLastTime = 0.f; 144 mLastTime = 0.f;
145 mName = "walk_adjust"; 145 mName = "walk_adjust";
146
147 mPelvisState = new LLJointState;
146} 148}
147 149
148//----------------------------------------------------------------------------- 150//-----------------------------------------------------------------------------
@@ -155,15 +157,15 @@ LLMotion::LLMotionInitStatus LLWalkAdjustMotion::onInitialize(LLCharacter *chara
155 mRightAnkleJoint = mCharacter->getJoint("mAnkleRight"); 157 mRightAnkleJoint = mCharacter->getJoint("mAnkleRight");
156 158
157 mPelvisJoint = mCharacter->getJoint("mPelvis"); 159 mPelvisJoint = mCharacter->getJoint("mPelvis");
158 mPelvisState.setJoint( mPelvisJoint ); 160 mPelvisState->setJoint( mPelvisJoint );
159 if ( !mPelvisJoint ) 161 if ( !mPelvisJoint )
160 { 162 {
161 llwarns << getName() << ": Can't get pelvis joint." << llendl; 163 llwarns << getName() << ": Can't get pelvis joint." << llendl;
162 return STATUS_FAILURE; 164 return STATUS_FAILURE;
163 } 165 }
164 166
165 mPelvisState.setUsage(LLJointState::POS); 167 mPelvisState->setUsage(LLJointState::POS);
166 addJointState( &mPelvisState ); 168 addJointState( mPelvisState );
167 169
168 return STATUS_SUCCESS; 170 return STATUS_SUCCESS;
169} 171}
@@ -178,7 +180,7 @@ BOOL LLWalkAdjustMotion::onActivate()
178 mAnimSpeed = 0.f; 180 mAnimSpeed = 0.f;
179 mAvgSpeed = 0.f; 181 mAvgSpeed = 0.f;
180 mRelativeDir = 1.f; 182 mRelativeDir = 1.f;
181 mPelvisState.setPosition(LLVector3::zero); 183 mPelvisState->setPosition(LLVector3::zero);
182 // store ankle positions for next frame 184 // store ankle positions for next frame
183 mLastLeftAnklePos = mCharacter->getPosGlobalFromAgent(mLeftAnkleJoint->getWorldPosition()); 185 mLastLeftAnklePos = mCharacter->getPosGlobalFromAgent(mLeftAnkleJoint->getWorldPosition());
184 mLastRightAnklePos = mCharacter->getPosGlobalFromAgent(mRightAnkleJoint->getWorldPosition()); 186 mLastRightAnklePos = mCharacter->getPosGlobalFromAgent(mRightAnkleJoint->getWorldPosition());
@@ -271,7 +273,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
271 273
272 // calculate ideal pelvis offset so that foot is glued to ground and damp towards it 274 // calculate ideal pelvis offset so that foot is glued to ground and damp towards it
273 // the amount of foot slippage this frame + the offset applied last frame 275 // the amount of foot slippage this frame + the offset applied last frame
274 mPelvisOffset = mPelvisState.getPosition() + lerp(LLVector3::zero, footCorrection, LLCriticalDamp::getInterpolant(0.2f)); 276 mPelvisOffset = mPelvisState->getPosition() + lerp(LLVector3::zero, footCorrection, LLCriticalDamp::getInterpolant(0.2f));
275 277
276 // pelvis drift (along walk direction) 278 // pelvis drift (along walk direction)
277 mAvgCorrection = lerp(mAvgCorrection, footCorrection.mV[VX] * mRelativeDir, LLCriticalDamp::getInterpolant(0.1f)); 279 mAvgCorrection = lerp(mAvgCorrection, footCorrection.mV[VX] * mRelativeDir, LLCriticalDamp::getInterpolant(0.1f));
@@ -319,7 +321,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
319 F32 drift_comp_max = llclamp(speed, 0.f, DRIFT_COMP_MAX_SPEED) / DRIFT_COMP_MAX_SPEED; 321 F32 drift_comp_max = llclamp(speed, 0.f, DRIFT_COMP_MAX_SPEED) / DRIFT_COMP_MAX_SPEED;
320 drift_comp_max *= DRIFT_COMP_MAX_TOTAL; 322 drift_comp_max *= DRIFT_COMP_MAX_TOTAL;
321 323
322 LLVector3 currentPelvisPos = mPelvisState.getJoint()->getPosition(); 324 LLVector3 currentPelvisPos = mPelvisState->getJoint()->getPosition();
323 325
324 // NB: this is an ADDITIVE amount that is accumulated every frame, so clamping it alone won't do the trick 326 // NB: this is an ADDITIVE amount that is accumulated every frame, so clamping it alone won't do the trick
325 // must clamp with absolute position of pelvis in mind 327 // must clamp with absolute position of pelvis in mind
@@ -328,7 +330,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
328 mPelvisOffset.mV[VZ] = 0.f; 330 mPelvisOffset.mV[VZ] = 0.f;
329 331
330 // set position 332 // set position
331 mPelvisState.setPosition(mPelvisOffset); 333 mPelvisState->setPosition(mPelvisOffset);
332 334
333 mCharacter->setAnimationData("Pelvis Offset", &mPelvisOffset); 335 mCharacter->setAnimationData("Pelvis Offset", &mPelvisOffset);
334 336
@@ -344,6 +346,17 @@ void LLWalkAdjustMotion::onDeactivate()
344} 346}
345 347
346//----------------------------------------------------------------------------- 348//-----------------------------------------------------------------------------
349// LLFlyAdjustMotion::LLFlyAdjustMotion()
350//-----------------------------------------------------------------------------
351LLFlyAdjustMotion::LLFlyAdjustMotion(const LLUUID &id)
352 : LLMotion(id)
353{
354 mName = "fly_adjust";
355
356 mPelvisState = new LLJointState;
357}
358
359//-----------------------------------------------------------------------------
347// LLFlyAdjustMotion::onInitialize() 360// LLFlyAdjustMotion::onInitialize()
348//----------------------------------------------------------------------------- 361//-----------------------------------------------------------------------------
349LLMotion::LLMotionInitStatus LLFlyAdjustMotion::onInitialize(LLCharacter *character) 362LLMotion::LLMotionInitStatus LLFlyAdjustMotion::onInitialize(LLCharacter *character)
@@ -351,15 +364,15 @@ LLMotion::LLMotionInitStatus LLFlyAdjustMotion::onInitialize(LLCharacter *charac
351 mCharacter = character; 364 mCharacter = character;
352 365
353 LLJoint* pelvisJoint = mCharacter->getJoint("mPelvis"); 366 LLJoint* pelvisJoint = mCharacter->getJoint("mPelvis");
354 mPelvisState.setJoint( pelvisJoint ); 367 mPelvisState->setJoint( pelvisJoint );
355 if ( !pelvisJoint ) 368 if ( !pelvisJoint )
356 { 369 {
357 llwarns << getName() << ": Can't get pelvis joint." << llendl; 370 llwarns << getName() << ": Can't get pelvis joint." << llendl;
358 return STATUS_FAILURE; 371 return STATUS_FAILURE;
359 } 372 }
360 373
361 mPelvisState.setUsage(LLJointState::POS | LLJointState::ROT); 374 mPelvisState->setUsage(LLJointState::POS | LLJointState::ROT);
362 addJointState( &mPelvisState ); 375 addJointState( mPelvisState );
363 376
364 return STATUS_SUCCESS; 377 return STATUS_SUCCESS;
365} 378}
@@ -369,8 +382,8 @@ LLMotion::LLMotionInitStatus LLFlyAdjustMotion::onInitialize(LLCharacter *charac
369//----------------------------------------------------------------------------- 382//-----------------------------------------------------------------------------
370BOOL LLFlyAdjustMotion::onActivate() 383BOOL LLFlyAdjustMotion::onActivate()
371{ 384{
372 mPelvisState.setPosition(LLVector3::zero); 385 mPelvisState->setPosition(LLVector3::zero);
373 mPelvisState.setRotation(LLQuaternion::DEFAULT); 386 mPelvisState->setRotation(LLQuaternion::DEFAULT);
374 mRoll = 0.f; 387 mRoll = 0.f;
375 return TRUE; 388 return TRUE;
376} 389}
@@ -392,11 +405,11 @@ BOOL LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask)
392// llinfos << mRoll << llendl; 405// llinfos << mRoll << llendl;
393 406
394 LLQuaternion roll(mRoll, LLVector3(0.f, 0.f, 1.f)); 407 LLQuaternion roll(mRoll, LLVector3(0.f, 0.f, 1.f));
395 mPelvisState.setRotation(roll); 408 mPelvisState->setRotation(roll);
396 409
397// F32 lerp_amt = LLCriticalDamp::getInterpolant(0.2f); 410// F32 lerp_amt = LLCriticalDamp::getInterpolant(0.2f);
398// 411//
399// LLVector3 pelvis_correction = mPelvisState.getPosition() - lerp(LLVector3::zero, mPelvisState.getJoint()->getPosition() + mPelvisState.getPosition(), lerp_amt); 412// LLVector3 pelvis_correction = mPelvisState->getPosition() - lerp(LLVector3::zero, mPelvisState->getJoint()->getPosition() + mPelvisState->getPosition(), lerp_amt);
400// mPelvisState.setPosition(pelvis_correction); 413// mPelvisState->setPosition(pelvis_correction);
401 return TRUE; 414 return TRUE;
402} 415}
diff --git a/linden/indra/llcharacter/llkeyframewalkmotion.h b/linden/indra/llcharacter/llkeyframewalkmotion.h
index 3c5a0cb..1a4e39f 100644
--- a/linden/indra/llcharacter/llkeyframewalkmotion.h
+++ b/linden/indra/llcharacter/llkeyframewalkmotion.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -123,7 +123,7 @@ public:
123 LLCharacter *mCharacter; 123 LLCharacter *mCharacter;
124 LLJoint* mLeftAnkleJoint; 124 LLJoint* mLeftAnkleJoint;
125 LLJoint* mRightAnkleJoint; 125 LLJoint* mRightAnkleJoint;
126 LLJointState mPelvisState; 126 LLPointer<LLJointState> mPelvisState;
127 LLJoint* mPelvisJoint; 127 LLJoint* mPelvisJoint;
128 LLVector3d mLastLeftAnklePos; 128 LLVector3d mLastLeftAnklePos;
129 LLVector3d mLastRightAnklePos; 129 LLVector3d mLastRightAnklePos;
@@ -141,7 +141,7 @@ class LLFlyAdjustMotion : public LLMotion
141{ 141{
142public: 142public:
143 // Constructor 143 // Constructor
144 LLFlyAdjustMotion(const LLUUID &id) : LLMotion(id) {mName = "fly_adjust";} 144 LLFlyAdjustMotion(const LLUUID &id);
145 145
146public: 146public:
147 //------------------------------------------------------------------------- 147 //-------------------------------------------------------------------------
@@ -173,7 +173,7 @@ protected:
173 // Member Data 173 // Member Data
174 //------------------------------------------------------------------------- 174 //-------------------------------------------------------------------------
175 LLCharacter *mCharacter; 175 LLCharacter *mCharacter;
176 LLJointState mPelvisState; 176 LLPointer<LLJointState> mPelvisState;
177 F32 mRoll; 177 F32 mRoll;
178}; 178};
179 179
diff --git a/linden/indra/llcharacter/llmotion.cpp b/linden/indra/llcharacter/llmotion.cpp
index aa5e542..899796c 100644
--- a/linden/indra/llcharacter/llmotion.cpp
+++ b/linden/indra/llcharacter/llmotion.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -106,7 +106,7 @@ void LLMotion::fadeIn()
106//----------------------------------------------------------------------------- 106//-----------------------------------------------------------------------------
107// addJointState() 107// addJointState()
108//----------------------------------------------------------------------------- 108//-----------------------------------------------------------------------------
109void LLMotion::addJointState(LLJointState* jointState) 109void LLMotion::addJointState(const LLPointer<LLJointState>& jointState)
110{ 110{
111 mPose.addJointState(jointState); 111 mPose.addJointState(jointState);
112 S32 priority = jointState->getPriority(); 112 S32 priority = jointState->getPriority();
diff --git a/linden/indra/llcharacter/llmotion.h b/linden/indra/llcharacter/llmotion.h
index 1d21edc..188937d 100644
--- a/linden/indra/llcharacter/llmotion.h
+++ b/linden/indra/llcharacter/llmotion.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -163,7 +163,7 @@ protected:
163 // it will be deactivated 163 // it will be deactivated
164 virtual BOOL onActivate() = 0; 164 virtual BOOL onActivate() = 0;
165 165
166 void addJointState(LLJointState* jointState); 166 void addJointState(const LLPointer<LLJointState>& jointState);
167 167
168protected: 168protected:
169 LLPose mPose; 169 LLPose mPose;
diff --git a/linden/indra/llcharacter/llmotioncontroller.cpp b/linden/indra/llcharacter/llmotioncontroller.cpp
index 8dc90b8..d1a2a53 100644
--- a/linden/indra/llcharacter/llmotioncontroller.cpp
+++ b/linden/indra/llcharacter/llmotioncontroller.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llmotioncontroller.h b/linden/indra/llcharacter/llmotioncontroller.h
index 76f5c68..e66edcb 100644
--- a/linden/indra/llcharacter/llmotioncontroller.h
+++ b/linden/indra/llcharacter/llmotioncontroller.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llmultigesture.cpp b/linden/indra/llcharacter/llmultigesture.cpp
index 080627a..02016a0 100644
--- a/linden/indra/llcharacter/llmultigesture.cpp
+++ b/linden/indra/llcharacter/llmultigesture.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llmultigesture.h b/linden/indra/llcharacter/llmultigesture.h
index 23c9c0f..08748b7 100644
--- a/linden/indra/llcharacter/llmultigesture.h
+++ b/linden/indra/llcharacter/llmultigesture.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llpose.cpp b/linden/indra/llcharacter/llpose.cpp
index e74517f..3a6a221 100644
--- a/linden/indra/llcharacter/llpose.cpp
+++ b/linden/indra/llcharacter/llpose.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -54,7 +54,7 @@ LLPose::~LLPose()
54//----------------------------------------------------------------------------- 54//-----------------------------------------------------------------------------
55// getFirstJointState() 55// getFirstJointState()
56//----------------------------------------------------------------------------- 56//-----------------------------------------------------------------------------
57LLJointState *LLPose::getFirstJointState() 57LLJointState* LLPose::getFirstJointState()
58{ 58{
59 mListIter = mJointMap.begin(); 59 mListIter = mJointMap.begin();
60 if (mListIter == mJointMap.end()) 60 if (mListIter == mJointMap.end())
@@ -86,7 +86,7 @@ LLJointState *LLPose::getNextJointState()
86//----------------------------------------------------------------------------- 86//-----------------------------------------------------------------------------
87// addJointState() 87// addJointState()
88//----------------------------------------------------------------------------- 88//-----------------------------------------------------------------------------
89BOOL LLPose::addJointState(LLJointState *jointState) 89BOOL LLPose::addJointState(const LLPointer<LLJointState>& jointState)
90{ 90{
91 if (mJointMap.find(jointState->getJoint()->getName()) == mJointMap.end()) 91 if (mJointMap.find(jointState->getJoint()->getName()) == mJointMap.end())
92 { 92 {
@@ -98,7 +98,7 @@ BOOL LLPose::addJointState(LLJointState *jointState)
98//----------------------------------------------------------------------------- 98//-----------------------------------------------------------------------------
99// removeJointState() 99// removeJointState()
100//----------------------------------------------------------------------------- 100//-----------------------------------------------------------------------------
101BOOL LLPose::removeJointState(LLJointState *jointState) 101BOOL LLPose::removeJointState(const LLPointer<LLJointState>& jointState)
102{ 102{
103 mJointMap.erase(jointState->getJoint()->getName()); 103 mJointMap.erase(jointState->getJoint()->getName());
104 return TRUE; 104 return TRUE;
@@ -199,7 +199,7 @@ LLJointStateBlender::~LLJointStateBlender()
199//----------------------------------------------------------------------------- 199//-----------------------------------------------------------------------------
200// addJointState() 200// addJointState()
201//----------------------------------------------------------------------------- 201//-----------------------------------------------------------------------------
202BOOL LLJointStateBlender::addJointState(LLJointState *joint_state, S32 priority, BOOL additive_blend) 202BOOL LLJointStateBlender::addJointState(const LLPointer<LLJointState>& joint_state, S32 priority, BOOL additive_blend)
203{ 203{
204 llassert(joint_state); 204 llassert(joint_state);
205 205
@@ -209,7 +209,7 @@ BOOL LLJointStateBlender::addJointState(LLJointState *joint_state, S32 priority,
209 209
210 for(S32 i = 0; i < JSB_NUM_JOINT_STATES; i++) 210 for(S32 i = 0; i < JSB_NUM_JOINT_STATES; i++)
211 { 211 {
212 if (NULL == mJointStates[i]) 212 if (mJointStates[i].isNull())
213 { 213 {
214 mJointStates[i] = joint_state; 214 mJointStates[i] = joint_state;
215 mPriorities[i] = priority; 215 mPriorities[i] = priority;
@@ -246,7 +246,7 @@ void LLJointStateBlender::blendJointStates(BOOL apply_now)
246 // we need at least one joint to blend 246 // we need at least one joint to blend
247 // if there is one, it will be in slot zero according to insertion logic 247 // if there is one, it will be in slot zero according to insertion logic
248 // instead of resetting joint state to default, just leave it unchanged from last frame 248 // instead of resetting joint state to default, just leave it unchanged from last frame
249 if (NULL == mJointStates[0]) 249 if (mJointStates[0].isNull())
250 { 250 {
251 return; 251 return;
252 } 252 }
@@ -275,7 +275,7 @@ void LLJointStateBlender::blendJointStates(BOOL apply_now)
275 sum_weights[SCALE_WEIGHT] = 0.f; 275 sum_weights[SCALE_WEIGHT] = 0.f;
276 276
277 for(S32 joint_state_index = 0; 277 for(S32 joint_state_index = 0;
278 joint_state_index < JSB_NUM_JOINT_STATES && mJointStates[joint_state_index] != NULL; 278 joint_state_index < JSB_NUM_JOINT_STATES && mJointStates[joint_state_index].notNull();
279 joint_state_index++) 279 joint_state_index++)
280 { 280 {
281 LLJointState* jsp = mJointStates[joint_state_index]; 281 LLJointState* jsp = mJointStates[joint_state_index];
@@ -468,7 +468,7 @@ BOOL LLPoseBlender::addMotion(LLMotion* motion)
468{ 468{
469 LLPose* pose = motion->getPose(); 469 LLPose* pose = motion->getPose();
470 470
471 for(LLJointState *jsp = pose->getFirstJointState(); jsp; jsp = pose->getNextJointState()) 471 for(LLJointState* jsp = pose->getFirstJointState(); jsp; jsp = pose->getNextJointState())
472 { 472 {
473 LLJoint *jointp = jsp->getJoint(); 473 LLJoint *jointp = jsp->getJoint();
474 LLJointStateBlender* joint_blender; 474 LLJointStateBlender* joint_blender;
diff --git a/linden/indra/llcharacter/llpose.h b/linden/indra/llcharacter/llpose.h
index 5ea586f..f67a26b 100644
--- a/linden/indra/llcharacter/llpose.h
+++ b/linden/indra/llcharacter/llpose.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -52,7 +52,7 @@ class LLPose
52{ 52{
53 friend class LLPoseBlender; 53 friend class LLPoseBlender;
54protected: 54protected:
55 typedef std::map<std::string, LLJointState*> joint_map; 55 typedef std::map<std::string, LLPointer<LLJointState> > joint_map;
56 typedef joint_map::iterator joint_map_iterator; 56 typedef joint_map::iterator joint_map_iterator;
57 typedef joint_map::value_type joint_map_value_type; 57 typedef joint_map::value_type joint_map_value_type;
58 58
@@ -61,19 +61,19 @@ protected:
61 joint_map_iterator mListIter; 61 joint_map_iterator mListIter;
62public: 62public:
63 // Iterate through jointStates 63 // Iterate through jointStates
64 LLJointState *getFirstJointState(); 64 LLJointState* getFirstJointState();
65 LLJointState *getNextJointState(); 65 LLJointState* getNextJointState();
66 LLJointState *findJointState(LLJoint *joint); 66 LLJointState* findJointState(LLJoint *joint);
67 LLJointState *findJointState(const std::string &name); 67 LLJointState* findJointState(const std::string &name);
68public: 68public:
69 // Constructor 69 // Constructor
70 LLPose() : mWeight(0.f) {} 70 LLPose() : mWeight(0.f) {}
71 // Destructor 71 // Destructor
72 ~LLPose(); 72 ~LLPose();
73 // add a joint state in this pose 73 // add a joint state in this pose
74 BOOL addJointState(LLJointState *jointState); 74 BOOL addJointState(const LLPointer<LLJointState>& jointState);
75 // remove a joint state from this pose 75 // remove a joint state from this pose
76 BOOL removeJointState(LLJointState *jointState); 76 BOOL removeJointState(const LLPointer<LLJointState>& jointState);
77 // removes all joint states from this pose 77 // removes all joint states from this pose
78 BOOL removeAllJointStates(); 78 BOOL removeAllJointStates();
79 // set weight for all joint states in this pose 79 // set weight for all joint states in this pose
@@ -89,14 +89,14 @@ const S32 JSB_NUM_JOINT_STATES = 6;
89class LLJointStateBlender 89class LLJointStateBlender
90{ 90{
91protected: 91protected:
92 LLJointState* mJointStates[JSB_NUM_JOINT_STATES]; 92 LLPointer<LLJointState> mJointStates[JSB_NUM_JOINT_STATES];
93 S32 mPriorities[JSB_NUM_JOINT_STATES]; 93 S32 mPriorities[JSB_NUM_JOINT_STATES];
94 BOOL mAdditiveBlends[JSB_NUM_JOINT_STATES]; 94 BOOL mAdditiveBlends[JSB_NUM_JOINT_STATES];
95public: 95public:
96 LLJointStateBlender(); 96 LLJointStateBlender();
97 ~LLJointStateBlender(); 97 ~LLJointStateBlender();
98 void blendJointStates(BOOL apply_now = TRUE); 98 void blendJointStates(BOOL apply_now = TRUE);
99 BOOL addJointState(LLJointState *joint_state, S32 priority, BOOL additive_blend); 99 BOOL addJointState(const LLPointer<LLJointState>& joint_state, S32 priority, BOOL additive_blend);
100 void interpolate(F32 u); 100 void interpolate(F32 u);
101 void clear(); 101 void clear();
102 void resetCachedJoint(); 102 void resetCachedJoint();
diff --git a/linden/indra/llcharacter/llstatemachine.cpp b/linden/indra/llcharacter/llstatemachine.cpp
index 47cdfff..eab6e7f 100644
--- a/linden/indra/llcharacter/llstatemachine.cpp
+++ b/linden/indra/llcharacter/llstatemachine.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llstatemachine.h b/linden/indra/llcharacter/llstatemachine.h
index a4d3145..f46e4bf 100644
--- a/linden/indra/llcharacter/llstatemachine.h
+++ b/linden/indra/llcharacter/llstatemachine.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/lltargetingmotion.cpp b/linden/indra/llcharacter/lltargetingmotion.cpp
index 1676a08..0f160a4 100644
--- a/linden/indra/llcharacter/lltargetingmotion.cpp
+++ b/linden/indra/llcharacter/lltargetingmotion.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -55,6 +55,8 @@ LLTargetingMotion::LLTargetingMotion(const LLUUID &id) : LLMotion(id)
55{ 55{
56 mCharacter = NULL; 56 mCharacter = NULL;
57 mName = "targeting"; 57 mName = "targeting";
58
59 mTorsoState = new LLJointState;
58} 60}
59 61
60 62
@@ -87,11 +89,11 @@ LLMotion::LLMotionInitStatus LLTargetingMotion::onInitialize(LLCharacter *charac
87 return STATUS_FAILURE; 89 return STATUS_FAILURE;
88 } 90 }
89 91
90 mTorsoState.setJoint( mTorsoJoint ); 92 mTorsoState->setJoint( mTorsoJoint );
91 93
92 // add joint states to the pose 94 // add joint states to the pose
93 mTorsoState.setUsage(LLJointState::ROT); 95 mTorsoState->setUsage(LLJointState::ROT);
94 addJointState( &mTorsoState ); 96 addJointState( mTorsoState );
95 97
96 return STATUS_SUCCESS; 98 return STATUS_SUCCESS;
97} 99}
@@ -127,7 +129,7 @@ BOOL LLTargetingMotion::onUpdate(F32 time, U8* joint_mask)
127 } 129 }
128 130
129 //LLVector3 target_plane_normal = LLVector3(1.f, 0.f, 0.f) * mPelvisJoint->getWorldRotation(); 131 //LLVector3 target_plane_normal = LLVector3(1.f, 0.f, 0.f) * mPelvisJoint->getWorldRotation();
130 //LLVector3 torso_dir = LLVector3(1.f, 0.f, 0.f) * (mTorsoJoint->getWorldRotation() * mTorsoState.getRotation()); 132 //LLVector3 torso_dir = LLVector3(1.f, 0.f, 0.f) * (mTorsoJoint->getWorldRotation() * mTorsoState->getRotation());
131 133
132 LLVector3 skyward(0.f, 0.f, 1.f); 134 LLVector3 skyward(0.f, 0.f, 1.f);
133 LLVector3 left(skyward % target); 135 LLVector3 left(skyward % target);
@@ -151,14 +153,14 @@ BOOL LLTargetingMotion::onUpdate(F32 time, U8* joint_mask)
151 new_torso_rot = new_torso_rot * ~cur_torso_rot; 153 new_torso_rot = new_torso_rot * ~cur_torso_rot;
152 154
153 // slerp from current additive rotation to ideal additive rotation 155 // slerp from current additive rotation to ideal additive rotation
154 new_torso_rot = nlerp(slerp_amt, mTorsoState.getRotation(), new_torso_rot); 156 new_torso_rot = nlerp(slerp_amt, mTorsoState->getRotation(), new_torso_rot);
155 157
156 // constraint overall torso rotation 158 // constraint overall torso rotation
157 LLQuaternion total_rot = new_torso_rot * mTorsoJoint->getRotation(); 159 LLQuaternion total_rot = new_torso_rot * mTorsoJoint->getRotation();
158 total_rot.constrain(F_PI_BY_TWO * 0.8f); 160 total_rot.constrain(F_PI_BY_TWO * 0.8f);
159 new_torso_rot = total_rot * ~mTorsoJoint->getRotation(); 161 new_torso_rot = total_rot * ~mTorsoJoint->getRotation();
160 162
161 mTorsoState.setRotation(new_torso_rot); 163 mTorsoState->setRotation(new_torso_rot);
162 164
163 return result; 165 return result;
164} 166}
diff --git a/linden/indra/llcharacter/lltargetingmotion.h b/linden/indra/llcharacter/lltargetingmotion.h
index 1436c21..e83fb00 100644
--- a/linden/indra/llcharacter/lltargetingmotion.h
+++ b/linden/indra/llcharacter/lltargetingmotion.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -111,7 +111,7 @@ public:
111public: 111public:
112 112
113 LLCharacter *mCharacter; 113 LLCharacter *mCharacter;
114 LLJointState mTorsoState; 114 LLPointer<LLJointState> mTorsoState;
115 LLJoint* mPelvisJoint; 115 LLJoint* mPelvisJoint;
116 LLJoint* mTorsoJoint; 116 LLJoint* mTorsoJoint;
117 LLJoint* mRightHandJoint; 117 LLJoint* mRightHandJoint;
diff --git a/linden/indra/llcharacter/llvisualparam.cpp b/linden/indra/llcharacter/llvisualparam.cpp
index d14664e..00b1072 100644
--- a/linden/indra/llcharacter/llvisualparam.cpp
+++ b/linden/indra/llcharacter/llvisualparam.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
diff --git a/linden/indra/llcharacter/llvisualparam.h b/linden/indra/llcharacter/llvisualparam.h
index 177d08c..41b8a05 100644
--- a/linden/indra/llcharacter/llvisualparam.h
+++ b/linden/indra/llcharacter/llvisualparam.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,