From 215f423cbe18fe9ca14a26caef918d303bad28ff Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:11 -0500 Subject: Second Life viewer sources 1.18.4.0-RC --- linden/indra/llmath/xform.h | 57 +++++++++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 17 deletions(-) (limited to 'linden/indra/llmath/xform.h') 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 @@ /** * @file xform.h * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * * Copyright (c) 2001-2007, Linden Research, Inc. * * Second Life Viewer Source Code @@ -23,6 +25,7 @@ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ */ #ifndef LL_XFORM_H @@ -32,9 +35,6 @@ #include "m4math.h" #include "llquaternion.h" -#define CHECK_FOR_FINITE - - const F32 MAX_OBJECT_Z = 768.f; const F32 MIN_OBJECT_Z = -256.f; const F32 MIN_OBJECT_SCALE = 0.01f; @@ -180,14 +180,16 @@ BOOL LLXform::setParent(LLXform* parent) return TRUE; } -#ifdef CHECK_FOR_FINITE void LLXform::setPosition(const LLVector3& pos) { setChanged(TRANSLATED); if (pos.isFinite()) mPosition = pos; else - llerror("Non Finite in LLXform::setPosition(LLVector3)", 0); + { + mPosition.clearVec(); + llwarns << "Non Finite in LLXform::setPosition(LLVector3)" << llendl; + } } 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) if (llfinite(x) && llfinite(y) && llfinite(z)) mPosition.setVec(x,y,z); else - llerror("Non Finite in LLXform::setPosition(F32,F32,F32)", 0); + { + mPosition.clearVec(); + llwarns << "Non Finite in LLXform::setPosition(F32,F32,F32)" << llendl; + } } void LLXform::setPositionX(const F32 x) @@ -205,7 +210,10 @@ void LLXform::setPositionX(const F32 x) if (llfinite(x)) mPosition.mV[VX] = x; else - llerror("Non Finite in LLXform::setPositionX", 0); + { + mPosition.mV[VX] = 0.f; + llwarns << "Non Finite in LLXform::setPositionX" << llendl; + } } void LLXform::setPositionY(const F32 y) @@ -214,7 +222,10 @@ void LLXform::setPositionY(const F32 y) if (llfinite(y)) mPosition.mV[VY] = y; else - llerror("Non Finite in LLXform::setPositionY", 0); + { + mPosition.mV[VY] = 0.f; + llwarns << "Non Finite in LLXform::setPositionY" << llendl; + } } void LLXform::setPositionZ(const F32 z) @@ -223,7 +234,10 @@ void LLXform::setPositionZ(const F32 z) if (llfinite(z)) mPosition.mV[VZ] = z; else - llerror("Non Finite in LLXform::setPositionZ", 0); + { + mPosition.mV[VZ] = 0.f; + llwarns << "Non Finite in LLXform::setPositionZ" << llendl; + } } void LLXform::addPosition(const LLVector3& pos) @@ -232,7 +246,7 @@ void LLXform::addPosition(const LLVector3& pos) if (pos.isFinite()) mPosition += pos; else - llerror("Non Finite in LLXform::addPosition", 0); + llwarns << "Non Finite in LLXform::addPosition" << llendl; } void LLXform::setScale(const LLVector3& scale) @@ -241,7 +255,10 @@ void LLXform::setScale(const LLVector3& scale) if (scale.isFinite()) mScale = scale; else - llerror("Non Finite in LLXform::setScale", 0); + { + mScale.setVec(1.f, 1.f, 1.f); + llwarns << "Non Finite in LLXform::setScale" << llendl; + } } void LLXform::setScale(const F32 x, const F32 y, const F32 z) { @@ -249,7 +266,10 @@ void LLXform::setScale(const F32 x, const F32 y, const F32 z) if (llfinite(x) && llfinite(y) && llfinite(z)) mScale.setVec(x,y,z); else - llerror("Non Finite in LLXform::setScale", 0); + { + mScale.setVec(1.f, 1.f, 1.f); + llwarns << "Non Finite in LLXform::setScale" << llendl; + } } void LLXform::setRotation(const LLQuaternion& rot) { @@ -257,7 +277,10 @@ void LLXform::setRotation(const LLQuaternion& rot) if (rot.isFinite()) mRotation = rot; else - llerror("Non Finite in LLXform::setRotation", 0); + { + mRotation.loadIdentity(); + llwarns << "Non Finite in LLXform::setRotation" << llendl; + } } void LLXform::setRotation(const F32 x, const F32 y, const F32 z) { @@ -268,7 +291,8 @@ void LLXform::setRotation(const F32 x, const F32 y, const F32 z) } else { - llerror("Non Finite in LLXform::setRotation", 0); + mRotation.loadIdentity(); + llwarns << "Non Finite in LLXform::setRotation" << llendl; } } 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) } else { - llerror("Non Finite in LLXform::setRotation", 0); + mRotation.loadIdentity(); + llwarns << "Non Finite in LLXform::setRotation" << llendl; } } #endif - -#endif -- cgit v1.1