diff options
Diffstat (limited to 'linden/indra/llmath/llcoordframe.cpp')
-rw-r--r-- | linden/indra/llmath/llcoordframe.cpp | 84 |
1 files changed, 57 insertions, 27 deletions
diff --git a/linden/indra/llmath/llcoordframe.cpp b/linden/indra/llmath/llcoordframe.cpp index 1650dd2..70d4646 100644 --- a/linden/indra/llmath/llcoordframe.cpp +++ b/linden/indra/llmath/llcoordframe.cpp | |||
@@ -2,6 +2,8 @@ | |||
2 | * @file llcoordframe.cpp | 2 | * @file llcoordframe.cpp |
3 | * @brief LLCoordFrame class implementation. | 3 | * @brief LLCoordFrame class implementation. |
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | ||
6 | * | ||
5 | * Copyright (c) 2000-2007, Linden Research, Inc. | 7 | * Copyright (c) 2000-2007, Linden Research, Inc. |
6 | * | 8 | * |
7 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
@@ -24,6 +26,7 @@ | |||
24 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | 26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO |
25 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
26 | * COMPLETENESS OR PERFORMANCE. | 28 | * COMPLETENESS OR PERFORMANCE. |
29 | * $/LicenseInfo$ | ||
27 | */ | 30 | */ |
28 | 31 | ||
29 | #include "linden_common.h" | 32 | #include "linden_common.h" |
@@ -60,7 +63,8 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin) : | |||
60 | { | 63 | { |
61 | if( !mOrigin.isFinite() ) | 64 | if( !mOrigin.isFinite() ) |
62 | { | 65 | { |
63 | llerrs << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | 66 | reset(); |
67 | llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | ||
64 | } | 68 | } |
65 | } | 69 | } |
66 | 70 | ||
@@ -71,7 +75,8 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin, const LLVector3 &direction) | |||
71 | 75 | ||
72 | if( !isFinite() ) | 76 | if( !isFinite() ) |
73 | { | 77 | { |
74 | llerrs << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | 78 | reset(); |
79 | llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | ||
75 | } | 80 | } |
76 | } | 81 | } |
77 | 82 | ||
@@ -85,7 +90,8 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &x_axis, | |||
85 | { | 90 | { |
86 | if( !isFinite() ) | 91 | if( !isFinite() ) |
87 | { | 92 | { |
88 | llerrs << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | 93 | reset(); |
94 | llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | ||
89 | } | 95 | } |
90 | } | 96 | } |
91 | 97 | ||
@@ -100,7 +106,8 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin, | |||
100 | { | 106 | { |
101 | if( !isFinite() ) | 107 | if( !isFinite() ) |
102 | { | 108 | { |
103 | llerrs << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | 109 | reset(); |
110 | llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | ||
104 | } | 111 | } |
105 | } | 112 | } |
106 | 113 | ||
@@ -114,7 +121,8 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin, | |||
114 | { | 121 | { |
115 | if( !isFinite() ) | 122 | if( !isFinite() ) |
116 | { | 123 | { |
117 | llerrs << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | 124 | reset(); |
125 | llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | ||
118 | } | 126 | } |
119 | } | 127 | } |
120 | 128 | ||
@@ -128,7 +136,8 @@ LLCoordFrame::LLCoordFrame(const LLQuaternion &q) : | |||
128 | 136 | ||
129 | if( !isFinite() ) | 137 | if( !isFinite() ) |
130 | { | 138 | { |
131 | llerrs << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | 139 | reset(); |
140 | llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | ||
132 | } | 141 | } |
133 | } | 142 | } |
134 | 143 | ||
@@ -142,7 +151,8 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin, const LLQuaternion &q) : | |||
142 | 151 | ||
143 | if( !isFinite() ) | 152 | if( !isFinite() ) |
144 | { | 153 | { |
145 | llerrs << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | 154 | reset(); |
155 | llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | ||
146 | } | 156 | } |
147 | } | 157 | } |
148 | 158 | ||
@@ -154,7 +164,8 @@ LLCoordFrame::LLCoordFrame(const LLMatrix4 &mat) : | |||
154 | { | 164 | { |
155 | if( !isFinite() ) | 165 | if( !isFinite() ) |
156 | { | 166 | { |
157 | llerrs << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | 167 | reset(); |
168 | llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | ||
158 | } | 169 | } |
159 | } | 170 | } |
160 | 171 | ||
@@ -169,7 +180,8 @@ LLCoordFrame::LLCoordFrame(const F32 *origin, const F32 *rotation) : | |||
169 | { | 180 | { |
170 | if( !isFinite() ) | 181 | if( !isFinite() ) |
171 | { | 182 | { |
172 | llerrs << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | 183 | reset(); |
184 | llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | ||
173 | } | 185 | } |
174 | } | 186 | } |
175 | */ | 187 | */ |
@@ -183,7 +195,8 @@ LLCoordFrame::LLCoordFrame(const F32 *origin_and_rotation) : | |||
183 | { | 195 | { |
184 | if( !isFinite() ) | 196 | if( !isFinite() ) |
185 | { | 197 | { |
186 | llerrs << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | 198 | reset(); |
199 | llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl; | ||
187 | } | 200 | } |
188 | } | 201 | } |
189 | */ | 202 | */ |
@@ -211,7 +224,8 @@ void LLCoordFrame::setOrigin(F32 x, F32 y, F32 z) | |||
211 | 224 | ||
212 | if( !mOrigin.isFinite() ) | 225 | if( !mOrigin.isFinite() ) |
213 | { | 226 | { |
214 | llerrs << "Non Finite in LLCoordFrame::setOrigin()" << llendl; | 227 | reset(); |
228 | llwarns << "Non Finite in LLCoordFrame::setOrigin()" << llendl; | ||
215 | } | 229 | } |
216 | } | 230 | } |
217 | 231 | ||
@@ -220,7 +234,8 @@ void LLCoordFrame::setOrigin(const LLVector3 &new_origin) | |||
220 | mOrigin = new_origin; | 234 | mOrigin = new_origin; |
221 | if( !mOrigin.isFinite() ) | 235 | if( !mOrigin.isFinite() ) |
222 | { | 236 | { |
223 | llerrs << "Non Finite in LLCoordFrame::setOrigin()" << llendl; | 237 | reset(); |
238 | llwarns << "Non Finite in LLCoordFrame::setOrigin()" << llendl; | ||
224 | } | 239 | } |
225 | } | 240 | } |
226 | 241 | ||
@@ -232,7 +247,8 @@ void LLCoordFrame::setOrigin(const F32 *origin) | |||
232 | 247 | ||
233 | if( !mOrigin.isFinite() ) | 248 | if( !mOrigin.isFinite() ) |
234 | { | 249 | { |
235 | llerrs << "Non Finite in LLCoordFrame::setOrigin()" << llendl; | 250 | reset(); |
251 | llwarns << "Non Finite in LLCoordFrame::setOrigin()" << llendl; | ||
236 | } | 252 | } |
237 | } | 253 | } |
238 | 254 | ||
@@ -242,7 +258,8 @@ void LLCoordFrame::setOrigin(const LLCoordFrame &frame) | |||
242 | 258 | ||
243 | if( !mOrigin.isFinite() ) | 259 | if( !mOrigin.isFinite() ) |
244 | { | 260 | { |
245 | llerrs << "Non Finite in LLCoordFrame::setOrigin()" << llendl; | 261 | reset(); |
262 | llwarns << "Non Finite in LLCoordFrame::setOrigin()" << llendl; | ||
246 | } | 263 | } |
247 | } | 264 | } |
248 | 265 | ||
@@ -258,7 +275,8 @@ void LLCoordFrame::setAxes(const LLVector3 &x_axis, | |||
258 | mZAxis = z_axis; | 275 | mZAxis = z_axis; |
259 | if( !isFinite() ) | 276 | if( !isFinite() ) |
260 | { | 277 | { |
261 | llerrs << "Non Finite in LLCoordFrame::setAxes()" << llendl; | 278 | reset(); |
279 | llwarns << "Non Finite in LLCoordFrame::setAxes()" << llendl; | ||
262 | } | 280 | } |
263 | } | 281 | } |
264 | 282 | ||
@@ -270,7 +288,8 @@ void LLCoordFrame::setAxes(const LLMatrix3 &rotation_matrix) | |||
270 | mZAxis.setVec(rotation_matrix.mMatrix[VZ]); | 288 | mZAxis.setVec(rotation_matrix.mMatrix[VZ]); |
271 | if( !isFinite() ) | 289 | if( !isFinite() ) |
272 | { | 290 | { |
273 | llerrs << "Non Finite in LLCoordFrame::setAxes()" << llendl; | 291 | reset(); |
292 | llwarns << "Non Finite in LLCoordFrame::setAxes()" << llendl; | ||
274 | } | 293 | } |
275 | } | 294 | } |
276 | 295 | ||
@@ -281,7 +300,8 @@ void LLCoordFrame::setAxes(const LLQuaternion &q ) | |||
281 | setAxes(rotation_matrix); | 300 | setAxes(rotation_matrix); |
282 | if( !isFinite() ) | 301 | if( !isFinite() ) |
283 | { | 302 | { |
284 | llerrs << "Non Finite in LLCoordFrame::setAxes()" << llendl; | 303 | reset(); |
304 | llwarns << "Non Finite in LLCoordFrame::setAxes()" << llendl; | ||
285 | } | 305 | } |
286 | } | 306 | } |
287 | 307 | ||
@@ -300,7 +320,8 @@ void LLCoordFrame::setAxes( const F32 *rotation_matrix ) | |||
300 | 320 | ||
301 | if( !isFinite() ) | 321 | if( !isFinite() ) |
302 | { | 322 | { |
303 | llerrs << "Non Finite in LLCoordFrame::setAxes()" << llendl; | 323 | reset(); |
324 | llwarns << "Non Finite in LLCoordFrame::setAxes()" << llendl; | ||
304 | } | 325 | } |
305 | } | 326 | } |
306 | 327 | ||
@@ -313,7 +334,8 @@ void LLCoordFrame::setAxes(const LLCoordFrame &frame) | |||
313 | 334 | ||
314 | if( !isFinite() ) | 335 | if( !isFinite() ) |
315 | { | 336 | { |
316 | llerrs << "Non Finite in LLCoordFrame::setAxes()" << llendl; | 337 | reset(); |
338 | llwarns << "Non Finite in LLCoordFrame::setAxes()" << llendl; | ||
317 | } | 339 | } |
318 | } | 340 | } |
319 | 341 | ||
@@ -328,7 +350,8 @@ void LLCoordFrame::translate(F32 x, F32 y, F32 z) | |||
328 | 350 | ||
329 | if( !mOrigin.isFinite() ) | 351 | if( !mOrigin.isFinite() ) |
330 | { | 352 | { |
331 | llerrs << "Non Finite in LLCoordFrame::translate()" << llendl; | 353 | reset(); |
354 | llwarns << "Non Finite in LLCoordFrame::translate()" << llendl; | ||
332 | } | 355 | } |
333 | } | 356 | } |
334 | 357 | ||
@@ -339,7 +362,8 @@ void LLCoordFrame::translate(const LLVector3 &v) | |||
339 | 362 | ||
340 | if( !mOrigin.isFinite() ) | 363 | if( !mOrigin.isFinite() ) |
341 | { | 364 | { |
342 | llerrs << "Non Finite in LLCoordFrame::translate()" << llendl; | 365 | reset(); |
366 | llwarns << "Non Finite in LLCoordFrame::translate()" << llendl; | ||
343 | } | 367 | } |
344 | } | 368 | } |
345 | 369 | ||
@@ -352,7 +376,8 @@ void LLCoordFrame::translate(const F32 *origin) | |||
352 | 376 | ||
353 | if( !mOrigin.isFinite() ) | 377 | if( !mOrigin.isFinite() ) |
354 | { | 378 | { |
355 | llerrs << "Non Finite in LLCoordFrame::translate()" << llendl; | 379 | reset(); |
380 | llwarns << "Non Finite in LLCoordFrame::translate()" << llendl; | ||
356 | } | 381 | } |
357 | } | 382 | } |
358 | 383 | ||
@@ -388,7 +413,8 @@ void LLCoordFrame::rotate(const LLMatrix3 &rotation_matrix) | |||
388 | 413 | ||
389 | if( !isFinite() ) | 414 | if( !isFinite() ) |
390 | { | 415 | { |
391 | llerrs << "Non Finite in LLCoordFrame::rotate()" << llendl; | 416 | reset(); |
417 | llwarns << "Non Finite in LLCoordFrame::rotate()" << llendl; | ||
392 | } | 418 | } |
393 | } | 419 | } |
394 | 420 | ||
@@ -401,7 +427,8 @@ void LLCoordFrame::roll(F32 angle) | |||
401 | 427 | ||
402 | if( !mYAxis.isFinite() || !mZAxis.isFinite() ) | 428 | if( !mYAxis.isFinite() || !mZAxis.isFinite() ) |
403 | { | 429 | { |
404 | llerrs << "Non Finite in LLCoordFrame::roll()" << llendl; | 430 | reset(); |
431 | llwarns << "Non Finite in LLCoordFrame::roll()" << llendl; | ||
405 | } | 432 | } |
406 | } | 433 | } |
407 | 434 | ||
@@ -413,7 +440,8 @@ void LLCoordFrame::pitch(F32 angle) | |||
413 | 440 | ||
414 | if( !mXAxis.isFinite() || !mZAxis.isFinite() ) | 441 | if( !mXAxis.isFinite() || !mZAxis.isFinite() ) |
415 | { | 442 | { |
416 | llerrs << "Non Finite in LLCoordFrame::pitch()" << llendl; | 443 | reset(); |
444 | llwarns << "Non Finite in LLCoordFrame::pitch()" << llendl; | ||
417 | } | 445 | } |
418 | } | 446 | } |
419 | 447 | ||
@@ -425,7 +453,8 @@ void LLCoordFrame::yaw(F32 angle) | |||
425 | 453 | ||
426 | if( !mXAxis.isFinite() || !mYAxis.isFinite() ) | 454 | if( !mXAxis.isFinite() || !mYAxis.isFinite() ) |
427 | { | 455 | { |
428 | llerrs << "Non Finite in LLCoordFrame::yaw()" << llendl; | 456 | reset(); |
457 | llwarns << "Non Finite in LLCoordFrame::yaw()" << llendl; | ||
429 | } | 458 | } |
430 | } | 459 | } |
431 | 460 | ||
@@ -484,7 +513,8 @@ size_t LLCoordFrame::readOrientation(const char *buffer) | |||
484 | 513 | ||
485 | if( !isFinite() ) | 514 | if( !isFinite() ) |
486 | { | 515 | { |
487 | llerrs << "Non Finite in LLCoordFrame::readOrientation()" << llendl; | 516 | reset(); |
517 | llwarns << "Non Finite in LLCoordFrame::readOrientation()" << llendl; | ||
488 | } | 518 | } |
489 | 519 | ||
490 | return 12*sizeof(F32); | 520 | return 12*sizeof(F32); |