aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmath/xform.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llmath/xform.h57
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
38const F32 MAX_OBJECT_Z = 768.f; 38const F32 MAX_OBJECT_Z = 768.f;
39const F32 MIN_OBJECT_Z = -256.f; 39const F32 MIN_OBJECT_Z = -256.f;
40const F32 MIN_OBJECT_SCALE = 0.01f; 40const 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
184void LLXform::setPosition(const LLVector3& pos) 183void 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
193void LLXform::setPosition(const F32 x, const F32 y, const F32 z) 195void 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
202void LLXform::setPositionX(const F32 x) 207void 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
211void LLXform::setPositionY(const F32 y) 219void 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
220void LLXform::setPositionZ(const F32 z) 231void 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
229void LLXform::addPosition(const LLVector3& pos) 243void 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
238void LLXform::setScale(const LLVector3& scale) 252void 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}
246void LLXform::setScale(const F32 x, const F32 y, const F32 z) 263void 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}
254void LLXform::setRotation(const LLQuaternion& rot) 274void 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}
262void LLXform::setRotation(const F32 x, const F32 y, const F32 z) 285void 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}
274void LLXform::setRotation(const F32 x, const F32 y, const F32 z, const F32 s) 298void 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