From 13c391f1984bb8cb9d67a7729af2ee5714409215 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Fri, 14 Sep 2007 21:13:20 +0000 Subject: EFFECTIVE MERGE: svn merge -r 68118:68999 svn+ssh://svn/svn/linden/branches/maintenance ACTUAL MERGE: svn merge -r 69685:69687 svn+ssh://svn/svn/linden/branches/release-r69649-maintenance-sync EQUIVALENT TO: svn merge -r 68118:69663 svn+ssh://svn/svn/linden/branches/maintenance-r68999 --- indra/llmath/xform.h | 67 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 56 insertions(+), 11 deletions(-) (limited to 'indra/llmath') diff --git a/indra/llmath/xform.h b/indra/llmath/xform.h index bd4bc74c79..72439531fd 100644 --- a/indra/llmath/xform.h +++ b/indra/llmath/xform.h @@ -160,84 +160,129 @@ BOOL LLXform::setParent(LLXform* parent) return TRUE; } + +// Don't blow up on release versions +#if LL_RELEASE_FOR_DOWNLOAD + #define llxformtrouble(msg, num) llwarning(msg, num) +#else + #define llxformtrouble(msg, num) llerror(msg, num) +#endif + + #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); + { + llxformtrouble("Non Finite in LLXform::setPosition(LLVector3)", 0); + } } void LLXform::setPosition(const F32 x, const F32 y, const F32 z) { setChanged(TRANSLATED); if (llfinite(x) && llfinite(y) && llfinite(z)) + { mPosition.setVec(x,y,z); + } else - llerror("Non Finite in LLXform::setPosition(F32,F32,F32)", 0); + { + llxformtrouble("Non Finite in LLXform::setPosition(F32,F32,F32)", 0); + } } void LLXform::setPositionX(const F32 x) { setChanged(TRANSLATED); if (llfinite(x)) + { mPosition.mV[VX] = x; + } else - llerror("Non Finite in LLXform::setPositionX", 0); + { + llxformtrouble("Non Finite in LLXform::setPositionX", 0); + } } void LLXform::setPositionY(const F32 y) { setChanged(TRANSLATED); if (llfinite(y)) + { mPosition.mV[VY] = y; + } else - llerror("Non Finite in LLXform::setPositionY", 0); + { + llxformtrouble("Non Finite in LLXform::setPositionY", 0); + } } void LLXform::setPositionZ(const F32 z) { setChanged(TRANSLATED); if (llfinite(z)) + { mPosition.mV[VZ] = z; + } else - llerror("Non Finite in LLXform::setPositionZ", 0); + { + llxformtrouble("Non Finite in LLXform::setPositionZ", 0); + } } void LLXform::addPosition(const LLVector3& pos) { setChanged(TRANSLATED); if (pos.isFinite()) + { mPosition += pos; + } else - llerror("Non Finite in LLXform::addPosition", 0); + { + llxformtrouble("Non Finite in LLXform::addPosition", 0); + } } void LLXform::setScale(const LLVector3& scale) { setChanged(SCALED); if (scale.isFinite()) + { mScale = scale; + } else - llerror("Non Finite in LLXform::setScale", 0); + { + llxformtrouble("Non Finite in LLXform::setScale(LLVector)", 0); + } } void LLXform::setScale(const F32 x, const F32 y, const F32 z) { setChanged(SCALED); if (llfinite(x) && llfinite(y) && llfinite(z)) + { mScale.setVec(x,y,z); + } else - llerror("Non Finite in LLXform::setScale", 0); + { + llxformtrouble("Non Finite in LLXform::setScale(F32,F32,F32)", 0); + } } void LLXform::setRotation(const LLQuaternion& rot) { setChanged(ROTATED); if (rot.isFinite()) + { mRotation = rot; + } else - llerror("Non Finite in LLXform::setRotation", 0); + { + llxformtrouble("Non Finite in LLXform::setRotation(LLQuaternion)", 0); + } } void LLXform::setRotation(const F32 x, const F32 y, const F32 z) { @@ -248,7 +293,7 @@ void LLXform::setRotation(const F32 x, const F32 y, const F32 z) } else { - llerror("Non Finite in LLXform::setRotation", 0); + llxformtrouble("Non Finite in LLXform::setRotation(F32,F32,F32)", 0); } } void LLXform::setRotation(const F32 x, const F32 y, const F32 z, const F32 s) @@ -260,7 +305,7 @@ void LLXform::setRotation(const F32 x, const F32 y, const F32 z, const F32 s) } else { - llerror("Non Finite in LLXform::setRotation", 0); + llxformtrouble("Non Finite in LLXform::setRotation(F32,F32,F32,F32)", 0); } } -- cgit v1.2.3