diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmath/xform.h | 57 |
1 files changed, 40 insertions, 17 deletions
diff --git a/linden/indra/llmath/xform.h b/linden/indra/llmath/xform.h index 605b1b5..9a5c991 100644 --- a/linden/indra/llmath/xform.h +++ b/linden/indra/llmath/xform.h | |||
@@ -1,6 +1,8 @@ | |||
1 | /** | 1 | /** |
2 | * @file xform.h | 2 | * @file xform.h |
3 | * | 3 | * |
4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | ||
5 | * | ||
4 | * Copyright (c) 2001-2007, Linden Research, Inc. | 6 | * Copyright (c) 2001-2007, Linden Research, Inc. |
5 | * | 7 | * |
6 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
@@ -23,6 +25,7 @@ | |||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | 25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO |
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
25 | * COMPLETENESS OR PERFORMANCE. | 27 | * COMPLETENESS OR PERFORMANCE. |
28 | * $/LicenseInfo$ | ||
26 | */ | 29 | */ |
27 | 30 | ||
28 | #ifndef LL_XFORM_H | 31 | #ifndef LL_XFORM_H |
@@ -32,9 +35,6 @@ | |||
32 | #include "m4math.h" | 35 | #include "m4math.h" |
33 | #include "llquaternion.h" | 36 | #include "llquaternion.h" |
34 | 37 | ||
35 | #define CHECK_FOR_FINITE | ||
36 | |||
37 | |||
38 | const F32 MAX_OBJECT_Z = 768.f; | 38 | const F32 MAX_OBJECT_Z = 768.f; |
39 | const F32 MIN_OBJECT_Z = -256.f; | 39 | const F32 MIN_OBJECT_Z = -256.f; |
40 | const F32 MIN_OBJECT_SCALE = 0.01f; | 40 | const F32 MIN_OBJECT_SCALE = 0.01f; |
@@ -180,14 +180,16 @@ BOOL LLXform::setParent(LLXform* parent) | |||
180 | return TRUE; | 180 | return TRUE; |
181 | } | 181 | } |
182 | 182 | ||
183 | #ifdef CHECK_FOR_FINITE | ||
184 | void LLXform::setPosition(const LLVector3& pos) | 183 | void LLXform::setPosition(const LLVector3& pos) |
185 | { | 184 | { |
186 | setChanged(TRANSLATED); | 185 | setChanged(TRANSLATED); |
187 | if (pos.isFinite()) | 186 | if (pos.isFinite()) |
188 | mPosition = pos; | 187 | mPosition = pos; |
189 | else | 188 | else |
190 | llerror("Non Finite in LLXform::setPosition(LLVector3)", 0); | 189 | { |
190 | mPosition.clearVec(); | ||
191 | llwarns << "Non Finite in LLXform::setPosition(LLVector3)" << llendl; | ||
192 | } | ||
191 | } | 193 | } |
192 | 194 | ||
193 | void LLXform::setPosition(const F32 x, const F32 y, const F32 z) | 195 | void LLXform::setPosition(const F32 x, const F32 y, const F32 z) |
@@ -196,7 +198,10 @@ void LLXform::setPosition(const F32 x, const F32 y, const F32 z) | |||
196 | if (llfinite(x) && llfinite(y) && llfinite(z)) | 198 | if (llfinite(x) && llfinite(y) && llfinite(z)) |
197 | mPosition.setVec(x,y,z); | 199 | mPosition.setVec(x,y,z); |
198 | else | 200 | else |
199 | llerror("Non Finite in LLXform::setPosition(F32,F32,F32)", 0); | 201 | { |
202 | mPosition.clearVec(); | ||
203 | llwarns << "Non Finite in LLXform::setPosition(F32,F32,F32)" << llendl; | ||
204 | } | ||
200 | } | 205 | } |
201 | 206 | ||
202 | void LLXform::setPositionX(const F32 x) | 207 | void LLXform::setPositionX(const F32 x) |
@@ -205,7 +210,10 @@ void LLXform::setPositionX(const F32 x) | |||
205 | if (llfinite(x)) | 210 | if (llfinite(x)) |
206 | mPosition.mV[VX] = x; | 211 | mPosition.mV[VX] = x; |
207 | else | 212 | else |
208 | llerror("Non Finite in LLXform::setPositionX", 0); | 213 | { |
214 | mPosition.mV[VX] = 0.f; | ||
215 | llwarns << "Non Finite in LLXform::setPositionX" << llendl; | ||
216 | } | ||
209 | } | 217 | } |
210 | 218 | ||
211 | void LLXform::setPositionY(const F32 y) | 219 | void LLXform::setPositionY(const F32 y) |
@@ -214,7 +222,10 @@ void LLXform::setPositionY(const F32 y) | |||
214 | if (llfinite(y)) | 222 | if (llfinite(y)) |
215 | mPosition.mV[VY] = y; | 223 | mPosition.mV[VY] = y; |
216 | else | 224 | else |
217 | llerror("Non Finite in LLXform::setPositionY", 0); | 225 | { |
226 | mPosition.mV[VY] = 0.f; | ||
227 | llwarns << "Non Finite in LLXform::setPositionY" << llendl; | ||
228 | } | ||
218 | } | 229 | } |
219 | 230 | ||
220 | void LLXform::setPositionZ(const F32 z) | 231 | void LLXform::setPositionZ(const F32 z) |
@@ -223,7 +234,10 @@ void LLXform::setPositionZ(const F32 z) | |||
223 | if (llfinite(z)) | 234 | if (llfinite(z)) |
224 | mPosition.mV[VZ] = z; | 235 | mPosition.mV[VZ] = z; |
225 | else | 236 | else |
226 | llerror("Non Finite in LLXform::setPositionZ", 0); | 237 | { |
238 | mPosition.mV[VZ] = 0.f; | ||
239 | llwarns << "Non Finite in LLXform::setPositionZ" << llendl; | ||
240 | } | ||
227 | } | 241 | } |
228 | 242 | ||
229 | void LLXform::addPosition(const LLVector3& pos) | 243 | void LLXform::addPosition(const LLVector3& pos) |
@@ -232,7 +246,7 @@ void LLXform::addPosition(const LLVector3& pos) | |||
232 | if (pos.isFinite()) | 246 | if (pos.isFinite()) |
233 | mPosition += pos; | 247 | mPosition += pos; |
234 | else | 248 | else |
235 | llerror("Non Finite in LLXform::addPosition", 0); | 249 | llwarns << "Non Finite in LLXform::addPosition" << llendl; |
236 | } | 250 | } |
237 | 251 | ||
238 | void LLXform::setScale(const LLVector3& scale) | 252 | void LLXform::setScale(const LLVector3& scale) |
@@ -241,7 +255,10 @@ void LLXform::setScale(const LLVector3& scale) | |||
241 | if (scale.isFinite()) | 255 | if (scale.isFinite()) |
242 | mScale = scale; | 256 | mScale = scale; |
243 | else | 257 | else |
244 | llerror("Non Finite in LLXform::setScale", 0); | 258 | { |
259 | mScale.setVec(1.f, 1.f, 1.f); | ||
260 | llwarns << "Non Finite in LLXform::setScale" << llendl; | ||
261 | } | ||
245 | } | 262 | } |
246 | void LLXform::setScale(const F32 x, const F32 y, const F32 z) | 263 | void LLXform::setScale(const F32 x, const F32 y, const F32 z) |
247 | { | 264 | { |
@@ -249,7 +266,10 @@ void LLXform::setScale(const F32 x, const F32 y, const F32 z) | |||
249 | if (llfinite(x) && llfinite(y) && llfinite(z)) | 266 | if (llfinite(x) && llfinite(y) && llfinite(z)) |
250 | mScale.setVec(x,y,z); | 267 | mScale.setVec(x,y,z); |
251 | else | 268 | else |
252 | llerror("Non Finite in LLXform::setScale", 0); | 269 | { |
270 | mScale.setVec(1.f, 1.f, 1.f); | ||
271 | llwarns << "Non Finite in LLXform::setScale" << llendl; | ||
272 | } | ||
253 | } | 273 | } |
254 | void LLXform::setRotation(const LLQuaternion& rot) | 274 | void LLXform::setRotation(const LLQuaternion& rot) |
255 | { | 275 | { |
@@ -257,7 +277,10 @@ void LLXform::setRotation(const LLQuaternion& rot) | |||
257 | if (rot.isFinite()) | 277 | if (rot.isFinite()) |
258 | mRotation = rot; | 278 | mRotation = rot; |
259 | else | 279 | else |
260 | llerror("Non Finite in LLXform::setRotation", 0); | 280 | { |
281 | mRotation.loadIdentity(); | ||
282 | llwarns << "Non Finite in LLXform::setRotation" << llendl; | ||
283 | } | ||
261 | } | 284 | } |
262 | void LLXform::setRotation(const F32 x, const F32 y, const F32 z) | 285 | void LLXform::setRotation(const F32 x, const F32 y, const F32 z) |
263 | { | 286 | { |
@@ -268,7 +291,8 @@ void LLXform::setRotation(const F32 x, const F32 y, const F32 z) | |||
268 | } | 291 | } |
269 | else | 292 | else |
270 | { | 293 | { |
271 | llerror("Non Finite in LLXform::setRotation", 0); | 294 | mRotation.loadIdentity(); |
295 | llwarns << "Non Finite in LLXform::setRotation" << llendl; | ||
272 | } | 296 | } |
273 | } | 297 | } |
274 | void LLXform::setRotation(const F32 x, const F32 y, const F32 z, const F32 s) | 298 | void LLXform::setRotation(const F32 x, const F32 y, const F32 z, const F32 s) |
@@ -280,10 +304,9 @@ void LLXform::setRotation(const F32 x, const F32 y, const F32 z, const F32 s) | |||
280 | } | 304 | } |
281 | else | 305 | else |
282 | { | 306 | { |
283 | llerror("Non Finite in LLXform::setRotation", 0); | 307 | mRotation.loadIdentity(); |
308 | llwarns << "Non Finite in LLXform::setRotation" << llendl; | ||
284 | } | 309 | } |
285 | } | 310 | } |
286 | 311 | ||
287 | #endif | 312 | #endif |
288 | |||
289 | #endif | ||