aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmath
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmath')
-rw-r--r--linden/indra/llmath/camera.h3
-rw-r--r--linden/indra/llmath/coordframe.h3
-rw-r--r--linden/indra/llmath/llbboxlocal.cpp3
-rw-r--r--linden/indra/llmath/llbboxlocal.h3
-rw-r--r--linden/indra/llmath/llcamera.cpp3
-rw-r--r--linden/indra/llmath/llcamera.h3
-rw-r--r--linden/indra/llmath/llcoord.h3
-rw-r--r--linden/indra/llmath/llcoordframe.cpp84
-rw-r--r--linden/indra/llmath/llcoordframe.h3
-rw-r--r--linden/indra/llmath/llcrc.cpp5
-rw-r--r--linden/indra/llmath/llcrc.h3
-rw-r--r--linden/indra/llmath/llinterp.h3
-rw-r--r--linden/indra/llmath/llmath.h9
-rw-r--r--linden/indra/llmath/llmd5.cpp8
-rw-r--r--linden/indra/llmath/llmd5.h6
-rw-r--r--linden/indra/llmath/lloctree.h3
-rw-r--r--linden/indra/llmath/llperlin.cpp3
-rw-r--r--linden/indra/llmath/llperlin.h3
-rw-r--r--linden/indra/llmath/llplane.h3
-rw-r--r--linden/indra/llmath/llquantize.h28
-rw-r--r--linden/indra/llmath/llquaternion.cpp23
-rw-r--r--linden/indra/llmath/llquaternion.h3
-rw-r--r--linden/indra/llmath/llrand.cpp5
-rw-r--r--linden/indra/llmath/llrand.h3
-rw-r--r--linden/indra/llmath/llrect.cpp3
-rw-r--r--linden/indra/llmath/llrect.h3
-rw-r--r--linden/indra/llmath/lltreenode.h3
-rw-r--r--linden/indra/llmath/lluuid.cpp9
-rw-r--r--linden/indra/llmath/lluuid.h3
-rw-r--r--linden/indra/llmath/llv4math.h5
-rw-r--r--linden/indra/llmath/llv4matrix3.h5
-rw-r--r--linden/indra/llmath/llv4matrix4.h5
-rw-r--r--linden/indra/llmath/llv4vector3.h5
-rw-r--r--linden/indra/llmath/llvolume.cpp74
-rw-r--r--linden/indra/llmath/llvolume.h3
-rw-r--r--linden/indra/llmath/llvolumemgr.cpp3
-rw-r--r--linden/indra/llmath/llvolumemgr.h3
-rw-r--r--linden/indra/llmath/m3math.cpp3
-rw-r--r--linden/indra/llmath/m3math.h3
-rw-r--r--linden/indra/llmath/m4math.cpp3
-rw-r--r--linden/indra/llmath/m4math.h3
-rw-r--r--linden/indra/llmath/raytrace.cpp3
-rw-r--r--linden/indra/llmath/raytrace.h3
-rw-r--r--linden/indra/llmath/v2math.cpp3
-rw-r--r--linden/indra/llmath/v2math.h5
-rw-r--r--linden/indra/llmath/v3color.cpp3
-rw-r--r--linden/indra/llmath/v3color.h3
-rw-r--r--linden/indra/llmath/v3dmath.cpp3
-rw-r--r--linden/indra/llmath/v3dmath.h3
-rw-r--r--linden/indra/llmath/v3math.cpp3
-rw-r--r--linden/indra/llmath/v3math.h3
-rw-r--r--linden/indra/llmath/v4color.cpp3
-rw-r--r--linden/indra/llmath/v4color.h3
-rw-r--r--linden/indra/llmath/v4coloru.cpp3
-rw-r--r--linden/indra/llmath/v4coloru.h3
-rw-r--r--linden/indra/llmath/v4math.cpp3
-rw-r--r--linden/indra/llmath/v4math.h3
-rw-r--r--linden/indra/llmath/xform.cpp3
-rw-r--r--linden/indra/llmath/xform.h57
59 files changed, 352 insertions, 110 deletions
diff --git a/linden/indra/llmath/camera.h b/linden/indra/llmath/camera.h
index be8c711..d41af4b 100644
--- a/linden/indra/llmath/camera.h
+++ b/linden/indra/llmath/camera.h
@@ -2,6 +2,8 @@
2 * @file camera.h 2 * @file camera.h
3 * @brief Legacy wrapper header. 3 * @brief Legacy wrapper header.
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 "llcamera.h" 32#include "llcamera.h"
diff --git a/linden/indra/llmath/coordframe.h b/linden/indra/llmath/coordframe.h
index 01d3031..384167a 100644
--- a/linden/indra/llmath/coordframe.h
+++ b/linden/indra/llmath/coordframe.h
@@ -2,6 +2,8 @@
2 * @file coordframe.h 2 * @file coordframe.h
3 * @brief Legacy wrapper header. 3 * @brief Legacy wrapper header.
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 "llcoordframe.h" 32#include "llcoordframe.h"
diff --git a/linden/indra/llmath/llbboxlocal.cpp b/linden/indra/llmath/llbboxlocal.cpp
index 505c7e6..313013e 100644
--- a/linden/indra/llmath/llbboxlocal.cpp
+++ b/linden/indra/llmath/llbboxlocal.cpp
@@ -2,6 +2,8 @@
2 * @file llbboxlocal.cpp 2 * @file llbboxlocal.cpp
3 * @brief General purpose bounding box class (Not axis aligned). 3 * @brief General purpose bounding box class (Not axis aligned).
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 7 * Copyright (c) 2001-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"
diff --git a/linden/indra/llmath/llbboxlocal.h b/linden/indra/llmath/llbboxlocal.h
index 4fdc01f..043f2df 100644
--- a/linden/indra/llmath/llbboxlocal.h
+++ b/linden/indra/llmath/llbboxlocal.h
@@ -2,6 +2,8 @@
2 * @file llbboxlocal.h 2 * @file llbboxlocal.h
3 * @brief General purpose bounding box class. 3 * @brief General purpose bounding box class.
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 7 * Copyright (c) 2001-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#ifndef LL_BBOXLOCAL_H 32#ifndef LL_BBOXLOCAL_H
diff --git a/linden/indra/llmath/llcamera.cpp b/linden/indra/llmath/llcamera.cpp
index c32bb67..2ec9ba8 100644
--- a/linden/indra/llmath/llcamera.cpp
+++ b/linden/indra/llmath/llcamera.cpp
@@ -2,6 +2,8 @@
2 * @file llcamera.cpp 2 * @file llcamera.cpp
3 * @brief Implementation of the LLCamera class. 3 * @brief Implementation of the LLCamera class.
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"
diff --git a/linden/indra/llmath/llcamera.h b/linden/indra/llmath/llcamera.h
index b5f78f4..67ffb2e 100644
--- a/linden/indra/llmath/llcamera.h
+++ b/linden/indra/llmath/llcamera.h
@@ -2,6 +2,8 @@
2 * @file llcamera.h 2 * @file llcamera.h
3 * @brief Header file for the LLCamera class. 3 * @brief Header file for the LLCamera class.
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#ifndef LL_CAMERA_H 32#ifndef LL_CAMERA_H
diff --git a/linden/indra/llmath/llcoord.h b/linden/indra/llmath/llcoord.h
index a1ed130..91fd507 100644
--- a/linden/indra/llmath/llcoord.h
+++ b/linden/indra/llmath/llcoord.h
@@ -1,6 +1,8 @@
1/** 1/**
2 * @file llcoord.h 2 * @file llcoord.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_LLCOORD_H 31#ifndef LL_LLCOORD_H
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);
diff --git a/linden/indra/llmath/llcoordframe.h b/linden/indra/llmath/llcoordframe.h
index 2777cbe..95deba6 100644
--- a/linden/indra/llmath/llcoordframe.h
+++ b/linden/indra/llmath/llcoordframe.h
@@ -2,6 +2,8 @@
2 * @file llcoordframe.h 2 * @file llcoordframe.h
3 * @brief LLCoordFrame class header file. 3 * @brief LLCoordFrame class header file.
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#ifndef LL_COORDFRAME_H 32#ifndef LL_COORDFRAME_H
diff --git a/linden/indra/llmath/llcrc.cpp b/linden/indra/llmath/llcrc.cpp
index 5b3ab4b..0836ccb 100644
--- a/linden/indra/llmath/llcrc.cpp
+++ b/linden/indra/llmath/llcrc.cpp
@@ -2,6 +2,8 @@
2 * @file llcrc.cpp 2 * @file llcrc.cpp
3 * @brief implementation of the crc class. 3 * @brief implementation of the crc class.
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 *
5 * Copyright (c) 2002-2007, Linden Research, Inc. 7 * Copyright (c) 2002-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"
@@ -31,8 +34,6 @@
31#include "llcrc.h" 34#include "llcrc.h"
32#include "llerror.h" 35#include "llerror.h"
33 36
34#include <stdio.h>
35
36/* Copyright (C) 1986 Gary S. Brown. You may use this program, or 37/* Copyright (C) 1986 Gary S. Brown. You may use this program, or
37 code or tables extracted from it, as desired without restriction.*/ 38 code or tables extracted from it, as desired without restriction.*/
38 39
diff --git a/linden/indra/llmath/llcrc.h b/linden/indra/llmath/llcrc.h
index 9f71fcc..287c1fb 100644
--- a/linden/indra/llmath/llcrc.h
+++ b/linden/indra/llmath/llcrc.h
@@ -2,6 +2,8 @@
2 * @file llcrc.h 2 * @file llcrc.h
3 * @brief LLCRC class header file. 3 * @brief LLCRC class header file.
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 *
5 * Copyright (c) 2002-2007, Linden Research, Inc. 7 * Copyright (c) 2002-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#ifndef LL_LLCRC_H 32#ifndef LL_LLCRC_H
diff --git a/linden/indra/llmath/llinterp.h b/linden/indra/llmath/llinterp.h
index 724fb31..0ad9113 100644
--- a/linden/indra/llmath/llinterp.h
+++ b/linden/indra/llmath/llinterp.h
@@ -1,6 +1,8 @@
1/** 1/**
2 * @file llinterp.h 2 * @file llinterp.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_LLINTERP_H 31#ifndef LL_LLINTERP_H
diff --git a/linden/indra/llmath/llmath.h b/linden/indra/llmath/llmath.h
index 9be2524..f1b223f 100644
--- a/linden/indra/llmath/llmath.h
+++ b/linden/indra/llmath/llmath.h
@@ -2,6 +2,8 @@
2 * @file llmath.h 2 * @file llmath.h
3 * @brief Useful math constants and macros. 3 * @brief Useful math constants and macros.
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,17 +26,12 @@
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#ifndef LLMATH_H 32#ifndef LLMATH_H
30#define LLMATH_H 33#define LLMATH_H
31 34
32#include <cmath>
33#include <math.h>
34#include <stdlib.h>
35
36#include "lldefs.h"
37
38// work around for Windows & older gcc non-standard function names. 35// work around for Windows & older gcc non-standard function names.
39#if LL_WINDOWS 36#if LL_WINDOWS
40#define llisnan(val) _isnan(val) 37#define llisnan(val) _isnan(val)
diff --git a/linden/indra/llmath/llmd5.cpp b/linden/indra/llmath/llmd5.cpp
index 1a8630c..033eb2f 100644
--- a/linden/indra/llmath/llmd5.cpp
+++ b/linden/indra/llmath/llmd5.cpp
@@ -1,6 +1,8 @@
1/** 1/**
2 * @file llmd5.cpp 2 * @file llmd5.cpp
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// llMD5.CC - source code for the C++/object oriented translation and 31// llMD5.CC - source code for the C++/object oriented translation and
@@ -78,10 +81,7 @@ documentation and/or software.
78 81
79#include "llmd5.h" 82#include "llmd5.h"
80 83
81#include <assert.h> 84#include <cassert>
82#include <string.h>
83#include <fstream>
84#include <iostream>
85 85
86// how many bytes to grab at a time when checking files 86// how many bytes to grab at a time when checking files
87const int LLMD5::BLOCK_LEN = 4096; 87const int LLMD5::BLOCK_LEN = 4096;
diff --git a/linden/indra/llmath/llmd5.h b/linden/indra/llmath/llmd5.h
index 5df98bf..7dabbfe 100644
--- a/linden/indra/llmath/llmd5.h
+++ b/linden/indra/llmath/llmd5.h
@@ -1,6 +1,8 @@
1/** 1/**
2 * @file llmd5.h 2 * @file llmd5.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_LLMD5_H 31#ifndef LL_LLMD5_H
@@ -69,9 +72,6 @@ documentation and/or software.
69 72
70*/ 73*/
71 74
72#include <stdio.h>
73#include <iosfwd>
74
75// use for the raw digest output 75// use for the raw digest output
76const int MD5RAW_BYTES = 16; 76const int MD5RAW_BYTES = 16;
77 77
diff --git a/linden/indra/llmath/lloctree.h b/linden/indra/llmath/lloctree.h
index 2395f0f..def6cb4 100644
--- a/linden/indra/llmath/lloctree.h
+++ b/linden/indra/llmath/lloctree.h
@@ -2,6 +2,8 @@
2 * @file lloctree.h 2 * @file lloctree.h
3 * @brief Octree declaration. 3 * @brief Octree declaration.
4 * 4 *
5 * $LicenseInfo:firstyear=2005&license=viewergpl$
6 *
5 * Copyright (c) 2005-2007, Linden Research, Inc. 7 * Copyright (c) 2005-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#ifndef LL_LLOCTREE_H 32#ifndef LL_LLOCTREE_H
diff --git a/linden/indra/llmath/llperlin.cpp b/linden/indra/llmath/llperlin.cpp
index 38b4d0d..4dcc7ab 100644
--- a/linden/indra/llmath/llperlin.cpp
+++ b/linden/indra/llmath/llperlin.cpp
@@ -1,6 +1,8 @@
1/** 1/**
2 * @file llperlin.cpp 2 * @file llperlin.cpp
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#include "linden_common.h" 31#include "linden_common.h"
diff --git a/linden/indra/llmath/llperlin.h b/linden/indra/llmath/llperlin.h
index e5fc4b0..63daaa6 100644
--- a/linden/indra/llmath/llperlin.h
+++ b/linden/indra/llmath/llperlin.h
@@ -1,6 +1,8 @@
1/** 1/**
2 * @file llperlin.h 2 * @file llperlin.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_PERLIN_H 31#ifndef LL_PERLIN_H
diff --git a/linden/indra/llmath/llplane.h b/linden/indra/llmath/llplane.h
index 0e0e17d..c1fb7d8 100644
--- a/linden/indra/llmath/llplane.h
+++ b/linden/indra/llmath/llplane.h
@@ -1,6 +1,8 @@
1/** 1/**
2 * @file llplane.h 2 * @file llplane.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_LLPLANE_H 31#ifndef LL_LLPLANE_H
diff --git a/linden/indra/llmath/llquantize.h b/linden/indra/llmath/llquantize.h
index a4fd67a..817c4c3 100644
--- a/linden/indra/llmath/llquantize.h
+++ b/linden/indra/llmath/llquantize.h
@@ -3,6 +3,8 @@
3 * @brief useful routines for quantizing floats to various length ints 3 * @brief useful routines for quantizing floats to various length ints
4 * and back out again 4 * and back out again
5 * 5 *
6 * $LicenseInfo:firstyear=2001&license=viewergpl$
7 *
6 * Copyright (c) 2001-2007, Linden Research, Inc. 8 * Copyright (c) 2001-2007, Linden Research, Inc.
7 * 9 *
8 * Second Life Viewer Source Code 10 * Second Life Viewer Source Code
@@ -25,6 +27,7 @@
25 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
26 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27 * COMPLETENESS OR PERFORMANCE. 29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
28 */ 31 */
29 32
30#ifndef LL_LLQUANTIZE_H 33#ifndef LL_LLQUANTIZE_H
@@ -40,6 +43,18 @@ const U8 FIRSTVALIDCHAR = 54;
40const U8 MAXSTRINGVAL = U8MAX - FIRSTVALIDCHAR; //we don't allow newline or null 43const U8 MAXSTRINGVAL = U8MAX - FIRSTVALIDCHAR; //we don't allow newline or null
41 44
42 45
46inline U16 F32_to_U16_ROUND(F32 val, F32 lower, F32 upper)
47{
48 val = llclamp(val, lower, upper);
49 // make sure that the value is positive and normalized to <0, 1>
50 val -= lower;
51 val /= (upper - lower);
52
53 // round the value. Sreturn the U16
54 return (U16)(llround(val*U16MAX));
55}
56
57
43inline U16 F32_to_U16(F32 val, F32 lower, F32 upper) 58inline U16 F32_to_U16(F32 val, F32 lower, F32 upper)
44{ 59{
45 val = llclamp(val, lower, upper); 60 val = llclamp(val, lower, upper);
@@ -67,6 +82,19 @@ inline F32 U16_to_F32(U16 ival, F32 lower, F32 upper)
67 return val; 82 return val;
68} 83}
69 84
85
86inline U8 F32_to_U8_ROUND(F32 val, F32 lower, F32 upper)
87{
88 val = llclamp(val, lower, upper);
89 // make sure that the value is positive and normalized to <0, 1>
90 val -= lower;
91 val /= (upper - lower);
92
93 // return the rounded U8
94 return (U8)(llround(val*U8MAX));
95}
96
97
70inline U8 F32_to_U8(F32 val, F32 lower, F32 upper) 98inline U8 F32_to_U8(F32 val, F32 lower, F32 upper)
71{ 99{
72 val = llclamp(val, lower, upper); 100 val = llclamp(val, lower, upper);
diff --git a/linden/indra/llmath/llquaternion.cpp b/linden/indra/llmath/llquaternion.cpp
index 06e34af..34c1fd1 100644
--- a/linden/indra/llmath/llquaternion.cpp
+++ b/linden/indra/llmath/llquaternion.cpp
@@ -2,6 +2,8 @@
2 * @file llquaternion.cpp 2 * @file llquaternion.cpp
3 * @brief LLQuaternion class implementation. 3 * @brief LLQuaternion 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"
@@ -107,23 +110,27 @@ void LLQuaternion::quantize16(F32 lower, F32 upper)
107 F32 z = mQ[VZ]; 110 F32 z = mQ[VZ];
108 F32 s = mQ[VS]; 111 F32 s = mQ[VS];
109 112
110 x = U16_to_F32(F32_to_U16(x, lower, upper), lower, upper); 113 x = U16_to_F32(F32_to_U16_ROUND(x, lower, upper), lower, upper);
111 y = U16_to_F32(F32_to_U16(y, lower, upper), lower, upper); 114 y = U16_to_F32(F32_to_U16_ROUND(y, lower, upper), lower, upper);
112 z = U16_to_F32(F32_to_U16(z, lower, upper), lower, upper); 115 z = U16_to_F32(F32_to_U16_ROUND(z, lower, upper), lower, upper);
113 s = U16_to_F32(F32_to_U16(s, lower, upper), lower, upper); 116 s = U16_to_F32(F32_to_U16_ROUND(s, lower, upper), lower, upper);
114 117
115 mQ[VX] = x; 118 mQ[VX] = x;
116 mQ[VY] = y; 119 mQ[VY] = y;
117 mQ[VZ] = z; 120 mQ[VZ] = z;
118 mQ[VS] = s; 121 mQ[VS] = s;
122
123 normQuat();
119} 124}
120 125
121void LLQuaternion::quantize8(F32 lower, F32 upper) 126void LLQuaternion::quantize8(F32 lower, F32 upper)
122{ 127{
123 mQ[VX] = U8_to_F32(F32_to_U8(mQ[VX], lower, upper), lower, upper); 128 mQ[VX] = U8_to_F32(F32_to_U8_ROUND(mQ[VX], lower, upper), lower, upper);
124 mQ[VY] = U8_to_F32(F32_to_U8(mQ[VY], lower, upper), lower, upper); 129 mQ[VY] = U8_to_F32(F32_to_U8_ROUND(mQ[VY], lower, upper), lower, upper);
125 mQ[VZ] = U8_to_F32(F32_to_U8(mQ[VZ], lower, upper), lower, upper); 130 mQ[VZ] = U8_to_F32(F32_to_U8_ROUND(mQ[VZ], lower, upper), lower, upper);
126 mQ[VS] = U8_to_F32(F32_to_U8(mQ[VS], lower, upper), lower, upper); 131 mQ[VS] = U8_to_F32(F32_to_U8_ROUND(mQ[VS], lower, upper), lower, upper);
132
133 normQuat();
127} 134}
128 135
129// LLVector3 Magnitude and Normalization Functions 136// LLVector3 Magnitude and Normalization Functions
diff --git a/linden/indra/llmath/llquaternion.h b/linden/indra/llmath/llquaternion.h
index 66a8b40..01ddae9 100644
--- a/linden/indra/llmath/llquaternion.h
+++ b/linden/indra/llmath/llquaternion.h
@@ -2,6 +2,8 @@
2 * @file llquaternion.h 2 * @file llquaternion.h
3 * @brief LLQuaternion class header file. 3 * @brief LLQuaternion class header file.
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#ifndef LLQUATERNION_H 32#ifndef LLQUATERNION_H
diff --git a/linden/indra/llmath/llrand.cpp b/linden/indra/llmath/llrand.cpp
index e6c4cc5..11ecd8e 100644
--- a/linden/indra/llmath/llrand.cpp
+++ b/linden/indra/llmath/llrand.cpp
@@ -2,6 +2,8 @@
2 * @file llrand.cpp 2 * @file llrand.cpp
3 * @brief Global random generator. 3 * @brief Global random generator.
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"
@@ -64,7 +67,7 @@
64#define LL_USE_SYSTEM_RAND 0 67#define LL_USE_SYSTEM_RAND 0
65 68
66#if LL_USE_SYSTEM_RAND 69#if LL_USE_SYSTEM_RAND
67#include <stdlib.h> 70#include <cstdlib>
68#endif 71#endif
69 72
70#if LL_USE_SYSTEM_RAND 73#if LL_USE_SYSTEM_RAND
diff --git a/linden/indra/llmath/llrand.h b/linden/indra/llmath/llrand.h
index c5ab7e3..5bd874b 100644
--- a/linden/indra/llmath/llrand.h
+++ b/linden/indra/llmath/llrand.h
@@ -2,6 +2,8 @@
2 * @file llrand.h 2 * @file llrand.h
3 * @brief Information, functions, and typedefs for randomness. 3 * @brief Information, functions, and typedefs for randomness.
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#ifndef LL_LLRAND_H 32#ifndef LL_LLRAND_H
diff --git a/linden/indra/llmath/llrect.cpp b/linden/indra/llmath/llrect.cpp
index d9efe45..f7825fa 100644
--- a/linden/indra/llmath/llrect.cpp
+++ b/linden/indra/llmath/llrect.cpp
@@ -1,6 +1,8 @@
1/** 1/**
2 * @file llrect.cpp 2 * @file llrect.cpp
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#include "linden_common.h" 31#include "linden_common.h"
diff --git a/linden/indra/llmath/llrect.h b/linden/indra/llmath/llrect.h
index 38a4983..00a1b03 100644
--- a/linden/indra/llmath/llrect.h
+++ b/linden/indra/llmath/llrect.h
@@ -2,6 +2,8 @@
2 * @file llrect.h 2 * @file llrect.h
3 * @brief A rectangle in GL coordinates, with bottom,left = 0,0 3 * @brief A rectangle in GL coordinates, with bottom,left = 0,0
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 7 * Copyright (c) 2001-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 32
diff --git a/linden/indra/llmath/lltreenode.h b/linden/indra/llmath/lltreenode.h
index 8a8710f..6cafee0 100644
--- a/linden/indra/llmath/lltreenode.h
+++ b/linden/indra/llmath/lltreenode.h
@@ -1,6 +1,8 @@
1/** 1/**
2 * @file lltreenode.h 2 * @file lltreenode.h
3 * 3 *
4 * $LicenseInfo:firstyear=2005&license=viewergpl$
5 *
4 * Copyright (c) 2005-2007, Linden Research, Inc. 6 * Copyright (c) 2005-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_LLTREENODE_H 31#ifndef LL_LLTREENODE_H
diff --git a/linden/indra/llmath/lluuid.cpp b/linden/indra/llmath/lluuid.cpp
index 97d8c1c..1a7f90f 100644
--- a/linden/indra/llmath/lluuid.cpp
+++ b/linden/indra/llmath/lluuid.cpp
@@ -1,6 +1,8 @@
1/** 1/**
2 * @file lluuid.cpp 2 * @file lluuid.cpp
3 * 3 *
4 * $LicenseInfo:firstyear=2000&license=viewergpl$
5 *
4 * Copyright (c) 2000-2007, Linden Research, Inc. 6 * Copyright (c) 2000-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#include "linden_common.h" 31#include "linden_common.h"
@@ -34,7 +37,6 @@
34# include <windows.h> 37# include <windows.h>
35#endif 38#endif
36 39
37#include "stdtypes.h"
38#include "lldefs.h" 40#include "lldefs.h"
39#include "llerror.h" 41#include "llerror.h"
40 42
@@ -516,8 +518,6 @@ S32 LLUUID::getNodeID(unsigned char * node_id)
516/* 518/*
517 * Get an ethernet hardware address, if we can find it... 519 * Get an ethernet hardware address, if we can find it...
518 */ 520 */
519#include <stdio.h>
520#include <stdlib.h>
521#include <unistd.h> 521#include <unistd.h>
522#include <sys/types.h> 522#include <sys/types.h>
523#include <sys/time.h> 523#include <sys/time.h>
@@ -598,11 +598,8 @@ S32 LLUUID::getNodeID(unsigned char *node_id)
598 * Get the ethernet hardware address, if we can find it... 598 * Get the ethernet hardware address, if we can find it...
599 */ 599 */
600#include <unistd.h> 600#include <unistd.h>
601#include <stdlib.h>
602#include <string.h>
603#include <fcntl.h> 601#include <fcntl.h>
604#include <errno.h> 602#include <errno.h>
605#include <time.h>
606#include <sys/types.h> 603#include <sys/types.h>
607#include <sys/time.h> 604#include <sys/time.h>
608#include <sys/stat.h> 605#include <sys/stat.h>
diff --git a/linden/indra/llmath/lluuid.h b/linden/indra/llmath/lluuid.h
index 6334ea4..ebe6e2f 100644
--- a/linden/indra/llmath/lluuid.h
+++ b/linden/indra/llmath/lluuid.h
@@ -1,6 +1,8 @@
1/** 1/**
2 * @file lluuid.h 2 * @file lluuid.h
3 * 3 *
4 * $LicenseInfo:firstyear=2000&license=viewergpl$
5 *
4 * Copyright (c) 2000-2007, Linden Research, Inc. 6 * Copyright (c) 2000-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_LLUUID_H 31#ifndef LL_LLUUID_H
diff --git a/linden/indra/llmath/llv4math.h b/linden/indra/llmath/llv4math.h
index 2853ab6..9ad689b 100644
--- a/linden/indra/llmath/llv4math.h
+++ b/linden/indra/llmath/llv4math.h
@@ -2,7 +2,9 @@
2 * @file llv4math.h 2 * @file llv4math.h
3 * @brief LLV4* class header file - vector processor enabled math 3 * @brief LLV4* class header file - vector processor enabled math
4 * 4 *
5 * Copyright (c) 2007-2007, Linden Research, Inc. 5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007, Linden Research, Inc.
6 * 8 *
7 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
8 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -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#ifndef LL_LLV4MATH_H 32#ifndef LL_LLV4MATH_H
diff --git a/linden/indra/llmath/llv4matrix3.h b/linden/indra/llmath/llv4matrix3.h
index 0811338..bed09d0 100644
--- a/linden/indra/llmath/llv4matrix3.h
+++ b/linden/indra/llmath/llv4matrix3.h
@@ -2,7 +2,9 @@
2 * @file llviewerjointmesh.cpp 2 * @file llviewerjointmesh.cpp
3 * @brief LLV4* class header file - vector processor enabled math 3 * @brief LLV4* class header file - vector processor enabled math
4 * 4 *
5 * Copyright (c) 2007-2007, Linden Research, Inc. 5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007, Linden Research, Inc.
6 * 8 *
7 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
8 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -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#ifndef LL_LLV4MATRIX3_H 32#ifndef LL_LLV4MATRIX3_H
diff --git a/linden/indra/llmath/llv4matrix4.h b/linden/indra/llmath/llv4matrix4.h
index 38280a2..8ffb9d3 100644
--- a/linden/indra/llmath/llv4matrix4.h
+++ b/linden/indra/llmath/llv4matrix4.h
@@ -2,7 +2,9 @@
2 * @file llviewerjointmesh.cpp 2 * @file llviewerjointmesh.cpp
3 * @brief LLV4* class header file - vector processor enabled math 3 * @brief LLV4* class header file - vector processor enabled math
4 * 4 *
5 * Copyright (c) 2007-2007, Linden Research, Inc. 5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007, Linden Research, Inc.
6 * 8 *
7 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
8 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -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#ifndef LL_LLV4MATRIX4_H 32#ifndef LL_LLV4MATRIX4_H
diff --git a/linden/indra/llmath/llv4vector3.h b/linden/indra/llmath/llv4vector3.h
index 994e7f5..e176908 100644
--- a/linden/indra/llmath/llv4vector3.h
+++ b/linden/indra/llmath/llv4vector3.h
@@ -2,7 +2,9 @@
2 * @file llviewerjointmesh.cpp 2 * @file llviewerjointmesh.cpp
3 * @brief LLV4* class header file - vector processor enabled math 3 * @brief LLV4* class header file - vector processor enabled math
4 * 4 *
5 * Copyright (c) 2007-2007, Linden Research, Inc. 5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007, Linden Research, Inc.
6 * 8 *
7 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
8 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -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#ifndef LL_LLV4VECTOR3_H 32#ifndef LL_LLV4VECTOR3_H
diff --git a/linden/indra/llmath/llvolume.cpp b/linden/indra/llmath/llvolume.cpp
index 7f2a663..9cad612 100644
--- a/linden/indra/llmath/llvolume.cpp
+++ b/linden/indra/llmath/llvolume.cpp
@@ -1,6 +1,8 @@
1/** 1/**
2 * @file llvolume.cpp 2 * @file llvolume.cpp
3 * 3 *
4 * $LicenseInfo:firstyear=2002&license=viewergpl$
5 *
4 * Copyright (c) 2002-2007, Linden Research, Inc. 6 * Copyright (c) 2002-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#include "linden_common.h" 31#include "linden_common.h"
@@ -83,6 +86,8 @@ const S32 SCULPT_REZ_2 = 8;
83const S32 SCULPT_REZ_3 = 16; 86const S32 SCULPT_REZ_3 = 16;
84const S32 SCULPT_REZ_4 = 32; 87const S32 SCULPT_REZ_4 = 32;
85 88
89const F32 SCULPT_MIN_AREA = 0.005f;
90
86BOOL check_same_clock_dir( const LLVector3& pt1, const LLVector3& pt2, const LLVector3& pt3, const LLVector3& norm) 91BOOL check_same_clock_dir( const LLVector3& pt1, const LLVector3& pt2, const LLVector3& pt3, const LLVector3& norm)
87{ 92{
88 LLVector3 test = (pt2-pt1)%(pt3-pt2); 93 LLVector3 test = (pt2-pt1)%(pt3-pt2);
@@ -1825,6 +1830,18 @@ void LLVolume::createVolumeFaces()
1825} 1830}
1826 1831
1827 1832
1833inline LLVector3 sculpt_rgb_to_vector(U8 r, U8 g, U8 b)
1834{
1835 // maps RGB values to vector values [0..255] -> [-0.5..0.5]
1836 LLVector3 value;
1837 value.mV[VX] = r / 256.f - 0.5f;
1838 value.mV[VY] = g / 256.f - 0.5f;
1839 value.mV[VZ] = b / 256.f - 0.5f;
1840
1841 return value;
1842}
1843
1844
1828// sculpt replaces generate() for sculpted surfaces 1845// sculpt replaces generate() for sculpted surfaces
1829void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level) 1846void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level)
1830{ 1847{
@@ -1849,40 +1866,39 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components,
1849 mMesh.resize(sizeS * sizeT); 1866 mMesh.resize(sizeS * sizeT);
1850 sNumMeshPoints += mMesh.size(); 1867 sNumMeshPoints += mMesh.size();
1851 1868
1852 S32 vertex_change = 0; 1869 F32 area = 0;
1853 // first test to see if image has enough variation to create non-degenerate geometry 1870 // first test to see if image has enough variation to create non-degenerate geometry
1854 if (!data_is_empty) 1871 if (!data_is_empty)
1855 { 1872 {
1856 S32 last_index = 0; 1873 for (S32 s = 0; s < sizeS - 1; s++)
1857 for (S32 s = 0; s < sizeS; s++) 1874 for (S32 t = 0; t < sizeT - 1; t++)
1858 for (S32 t = 0; t < sizeT; t++)
1859 { 1875 {
1860 U32 x = (U32) ((F32)s/(sizeS-1) * (F32) sculpt_width); 1876 // first coordinate
1861 U32 y = (U32) ((F32)t/(sizeT-1) * (F32) sculpt_height); 1877 U32 x = (U32) ((F32)s/(sizeS) * (F32) sculpt_width);
1878 U32 y = (U32) ((F32)t/(sizeT) * (F32) sculpt_height);
1862 1879
1863 if (y == sculpt_height) // stitch bottom 1880 // coordinate offset by 1
1864 { 1881 U32 x2 = (U32) ((F32)(s+1)/(sizeS) * (F32) sculpt_width);
1865 y = sculpt_height - 1; 1882 U32 y2 = (U32) ((F32)(t+1)/(sizeT) * (F32) sculpt_height);
1866 x = sculpt_width / 2; 1883
1867 } 1884 // three points on a triagle - find the image indices first
1868 1885 U32 p1_index = (x + y * sculpt_width) * sculpt_components;
1869 if (x == sculpt_width) // stitch sides 1886 U32 p2_index = (x2 + y * sculpt_width) * sculpt_components;
1870 x = 0; 1887 U32 p3_index = (x + y2 * sculpt_width) * sculpt_components;
1871 1888
1872 if (y == 0) // stitch top 1889 // convert image data to vectors
1873 x = sculpt_width / 2; 1890 LLVector3 p1 = sculpt_rgb_to_vector(sculpt_data[p1_index], sculpt_data[p1_index+1], sculpt_data[p1_index+2]);
1874 1891 LLVector3 p2 = sculpt_rgb_to_vector(sculpt_data[p2_index], sculpt_data[p2_index+1], sculpt_data[p2_index+2]);
1875 U32 index = (x + y * sculpt_width) * sculpt_components; 1892 LLVector3 p3 = sculpt_rgb_to_vector(sculpt_data[p3_index], sculpt_data[p3_index+1], sculpt_data[p3_index+2]);
1876 1893
1877 if (fabs((F32)(sculpt_data[index] - sculpt_data[last_index])) + 1894 // compute the area of the parallelogram by taking the length of the cross product:
1878 fabs((F32)(sculpt_data[index+1] - sculpt_data[last_index+1])) + 1895 // (parallegram is an approximation of two triangles)
1879 fabs((F32)(sculpt_data[index+2] - sculpt_data[last_index+2])) > 0) 1896 LLVector3 cross = (p1 - p2) % (p1 - p3);
1880 vertex_change++; 1897 // take length squared for efficiency (no sqrt)
1881 1898 area += cross.magVecSquared();
1882 last_index = index;
1883 } 1899 }
1884 1900
1885 if ((F32)vertex_change / sizeS / sizeT < 0.02) // less than 2% 1901 if (area < SCULPT_MIN_AREA * SCULPT_MIN_AREA)
1886 data_is_empty = TRUE; 1902 data_is_empty = TRUE;
1887 } 1903 }
1888 1904
@@ -1974,9 +1990,7 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components,
1974 1990
1975 1991
1976 U32 index = (x + y * sculpt_width) * sculpt_components; 1992 U32 index = (x + y * sculpt_width) * sculpt_components;
1977 pt.mPos.mV[0] = sculpt_data[index ] / 256.f - 0.5f; 1993 pt.mPos = sculpt_rgb_to_vector(sculpt_data[index], sculpt_data[index+1], sculpt_data[index+2]);
1978 pt.mPos.mV[1] = sculpt_data[index+1] / 256.f - 0.5f;
1979 pt.mPos.mV[2] = sculpt_data[index+2] / 256.f - 0.5f;
1980 } 1994 }
1981 line += sizeT; 1995 line += sizeT;
1982 } 1996 }
diff --git a/linden/indra/llmath/llvolume.h b/linden/indra/llmath/llvolume.h
index ee28057..3dadc56 100644
--- a/linden/indra/llmath/llvolume.h
+++ b/linden/indra/llmath/llvolume.h
@@ -2,6 +2,8 @@
2 * @file llvolume.h 2 * @file llvolume.h
3 * @brief LLVolume base class. 3 * @brief LLVolume base class.
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 *
5 * Copyright (c) 2002-2007, Linden Research, Inc. 7 * Copyright (c) 2002-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#ifndef LL_LLVOLUME_H 32#ifndef LL_LLVOLUME_H
diff --git a/linden/indra/llmath/llvolumemgr.cpp b/linden/indra/llmath/llvolumemgr.cpp
index eac407f..eae6ab7 100644
--- a/linden/indra/llmath/llvolumemgr.cpp
+++ b/linden/indra/llmath/llvolumemgr.cpp
@@ -1,6 +1,8 @@
1/** 1/**
2 * @file llvolumemgr.cpp 2 * @file llvolumemgr.cpp
3 * 3 *
4 * $LicenseInfo:firstyear=2002&license=viewergpl$
5 *
4 * Copyright (c) 2002-2007, Linden Research, Inc. 6 * Copyright (c) 2002-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#include "linden_common.h" 31#include "linden_common.h"
diff --git a/linden/indra/llmath/llvolumemgr.h b/linden/indra/llmath/llvolumemgr.h
index aa00c4e..7aa0a3f 100644
--- a/linden/indra/llmath/llvolumemgr.h
+++ b/linden/indra/llmath/llvolumemgr.h
@@ -2,6 +2,8 @@
2 * @file llvolumemgr.h 2 * @file llvolumemgr.h
3 * @brief LLVolumeMgr class. 3 * @brief LLVolumeMgr class.
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 *
5 * Copyright (c) 2002-2007, Linden Research, Inc. 7 * Copyright (c) 2002-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#ifndef LL_LLVOLUMEMGR_H 32#ifndef LL_LLVOLUMEMGR_H
diff --git a/linden/indra/llmath/m3math.cpp b/linden/indra/llmath/m3math.cpp
index 09a18d2..d4f99cb 100644
--- a/linden/indra/llmath/m3math.cpp
+++ b/linden/indra/llmath/m3math.cpp
@@ -2,6 +2,8 @@
2 * @file m3math.cpp 2 * @file m3math.cpp
3 * @brief LLMatrix3 class implementation. 3 * @brief LLMatrix3 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"
diff --git a/linden/indra/llmath/m3math.h b/linden/indra/llmath/m3math.h
index 94c9b65..d2848aa 100644
--- a/linden/indra/llmath/m3math.h
+++ b/linden/indra/llmath/m3math.h
@@ -2,6 +2,8 @@
2 * @file m3math.h 2 * @file m3math.h
3 * @brief LLMatrix3 class header file. 3 * @brief LLMatrix3 class header file.
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#ifndef LL_M3MATH_H 32#ifndef LL_M3MATH_H
diff --git a/linden/indra/llmath/m4math.cpp b/linden/indra/llmath/m4math.cpp
index b6d91a1..4e7cf84 100644
--- a/linden/indra/llmath/m4math.cpp
+++ b/linden/indra/llmath/m4math.cpp
@@ -2,6 +2,8 @@
2 * @file m4math.cpp 2 * @file m4math.cpp
3 * @brief LLMatrix4 class implementation. 3 * @brief LLMatrix4 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"
diff --git a/linden/indra/llmath/m4math.h b/linden/indra/llmath/m4math.h
index 24f9f86..4958777 100644
--- a/linden/indra/llmath/m4math.h
+++ b/linden/indra/llmath/m4math.h
@@ -2,6 +2,8 @@
2 * @file m4math.h 2 * @file m4math.h
3 * @brief LLMatrix3 class header file. 3 * @brief LLMatrix3 class header file.
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#ifndef LL_M4MATH_H 32#ifndef LL_M4MATH_H
diff --git a/linden/indra/llmath/raytrace.cpp b/linden/indra/llmath/raytrace.cpp
index 634542d..fbdc6cf 100644
--- a/linden/indra/llmath/raytrace.cpp
+++ b/linden/indra/llmath/raytrace.cpp
@@ -2,6 +2,8 @@
2 * @file raytrace.cpp 2 * @file raytrace.cpp
3 * @brief Functions called by box object scripts. 3 * @brief Functions called by box object scripts.
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 7 * Copyright (c) 2001-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"
diff --git a/linden/indra/llmath/raytrace.h b/linden/indra/llmath/raytrace.h
index f68002f..0735b87 100644
--- a/linden/indra/llmath/raytrace.h
+++ b/linden/indra/llmath/raytrace.h
@@ -2,6 +2,8 @@
2 * @file raytrace.h 2 * @file raytrace.h
3 * @brief Ray intersection tests for primitives. 3 * @brief Ray intersection tests for primitives.
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 7 * Copyright (c) 2001-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#ifndef LL_RAYTRACE_H 32#ifndef LL_RAYTRACE_H
diff --git a/linden/indra/llmath/v2math.cpp b/linden/indra/llmath/v2math.cpp
index e41227b..7033048 100644
--- a/linden/indra/llmath/v2math.cpp
+++ b/linden/indra/llmath/v2math.cpp
@@ -2,6 +2,8 @@
2 * @file v2math.cpp 2 * @file v2math.cpp
3 * @brief LLVector2 class implementation. 3 * @brief LLVector2 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"
diff --git a/linden/indra/llmath/v2math.h b/linden/indra/llmath/v2math.h
index bcfe016..f2450b1 100644
--- a/linden/indra/llmath/v2math.h
+++ b/linden/indra/llmath/v2math.h
@@ -2,6 +2,8 @@
2 * @file v2math.h 2 * @file v2math.h
3 * @brief LLVector2 class header file. 3 * @brief LLVector2 class header file.
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,13 +26,12 @@
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#ifndef LL_V2MATH_H 32#ifndef LL_V2MATH_H
30#define LL_V2MATH_H 33#define LL_V2MATH_H
31 34
32#include <math.h>
33
34#include "llmath.h" 35#include "llmath.h"
35 36
36class LLVector4; 37class LLVector4;
diff --git a/linden/indra/llmath/v3color.cpp b/linden/indra/llmath/v3color.cpp
index 5378bc5..462075c 100644
--- a/linden/indra/llmath/v3color.cpp
+++ b/linden/indra/llmath/v3color.cpp
@@ -2,6 +2,8 @@
2 * @file v3color.cpp 2 * @file v3color.cpp
3 * @brief LLColor3 class implementation. 3 * @brief LLColor3 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"
diff --git a/linden/indra/llmath/v3color.h b/linden/indra/llmath/v3color.h
index 8f9224d..b80fa06 100644
--- a/linden/indra/llmath/v3color.h
+++ b/linden/indra/llmath/v3color.h
@@ -2,6 +2,8 @@
2 * @file v3color.h 2 * @file v3color.h
3 * @brief LLColor3 class header file. 3 * @brief LLColor3 class header file.
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 7 * Copyright (c) 2001-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#ifndef LL_V3COLOR_H 32#ifndef LL_V3COLOR_H
diff --git a/linden/indra/llmath/v3dmath.cpp b/linden/indra/llmath/v3dmath.cpp
index 059f9c6..efe1274 100644
--- a/linden/indra/llmath/v3dmath.cpp
+++ b/linden/indra/llmath/v3dmath.cpp
@@ -2,6 +2,8 @@
2 * @file v3dmath.cpp 2 * @file v3dmath.cpp
3 * @brief LLVector3d class implementation. 3 * @brief LLVector3d 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"
diff --git a/linden/indra/llmath/v3dmath.h b/linden/indra/llmath/v3dmath.h
index c101cc8..ac3f06c 100644
--- a/linden/indra/llmath/v3dmath.h
+++ b/linden/indra/llmath/v3dmath.h
@@ -2,6 +2,8 @@
2 * @file v3dmath.h 2 * @file v3dmath.h
3 * @brief High precision 3 dimensional vector. 3 * @brief High precision 3 dimensional vector.
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#ifndef LL_V3DMATH_H 32#ifndef LL_V3DMATH_H
diff --git a/linden/indra/llmath/v3math.cpp b/linden/indra/llmath/v3math.cpp
index f42fe1c..5ffd1dd 100644
--- a/linden/indra/llmath/v3math.cpp
+++ b/linden/indra/llmath/v3math.cpp
@@ -2,6 +2,8 @@
2 * @file v3math.cpp 2 * @file v3math.cpp
3 * @brief LLVector3 class implementation. 3 * @brief LLVector3 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"
diff --git a/linden/indra/llmath/v3math.h b/linden/indra/llmath/v3math.h
index bf211e2..e18b20d 100644
--- a/linden/indra/llmath/v3math.h
+++ b/linden/indra/llmath/v3math.h
@@ -2,6 +2,8 @@
2 * @file v3math.h 2 * @file v3math.h
3 * @brief LLVector3 class header file. 3 * @brief LLVector3 class header file.
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#ifndef LL_V3MATH_H 32#ifndef LL_V3MATH_H
diff --git a/linden/indra/llmath/v4color.cpp b/linden/indra/llmath/v4color.cpp
index 281e5f1..4ce8e10 100644
--- a/linden/indra/llmath/v4color.cpp
+++ b/linden/indra/llmath/v4color.cpp
@@ -2,6 +2,8 @@
2 * @file v4color.cpp 2 * @file v4color.cpp
3 * @brief LLColor4 class implementation. 3 * @brief LLColor4 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"
diff --git a/linden/indra/llmath/v4color.h b/linden/indra/llmath/v4color.h
index 2e9d13f..1e6232f 100644
--- a/linden/indra/llmath/v4color.h
+++ b/linden/indra/llmath/v4color.h
@@ -2,6 +2,8 @@
2 * @file v4color.h 2 * @file v4color.h
3 * @brief LLColor4 class header file. 3 * @brief LLColor4 class header file.
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 7 * Copyright (c) 2001-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#ifndef LL_V4COLOR_H 32#ifndef LL_V4COLOR_H
diff --git a/linden/indra/llmath/v4coloru.cpp b/linden/indra/llmath/v4coloru.cpp
index 90399b5..6f6900b 100644
--- a/linden/indra/llmath/v4coloru.cpp
+++ b/linden/indra/llmath/v4coloru.cpp
@@ -2,6 +2,8 @@
2 * @file v4coloru.cpp 2 * @file v4coloru.cpp
3 * @brief LLColor4U class implementation. 3 * @brief LLColor4U class implementation.
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 7 * Copyright (c) 2001-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"
diff --git a/linden/indra/llmath/v4coloru.h b/linden/indra/llmath/v4coloru.h
index 08e723a..fc7845a 100644
--- a/linden/indra/llmath/v4coloru.h
+++ b/linden/indra/llmath/v4coloru.h
@@ -2,6 +2,8 @@
2 * @file v4coloru.h 2 * @file v4coloru.h
3 * @brief The LLColor4U class. 3 * @brief The LLColor4U class.
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 7 * Copyright (c) 2001-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#ifndef LL_V4COLORU_H 32#ifndef LL_V4COLORU_H
diff --git a/linden/indra/llmath/v4math.cpp b/linden/indra/llmath/v4math.cpp
index fa52d95..b753778 100644
--- a/linden/indra/llmath/v4math.cpp
+++ b/linden/indra/llmath/v4math.cpp
@@ -2,6 +2,8 @@
2 * @file v4math.cpp 2 * @file v4math.cpp
3 * @brief LLVector4 class implementation. 3 * @brief LLVector4 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"
diff --git a/linden/indra/llmath/v4math.h b/linden/indra/llmath/v4math.h
index f3c2ccc..57dcad3 100644
--- a/linden/indra/llmath/v4math.h
+++ b/linden/indra/llmath/v4math.h
@@ -2,6 +2,8 @@
2 * @file v4math.h 2 * @file v4math.h
3 * @brief LLVector4 class header file. 3 * @brief LLVector4 class header file.
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#ifndef LL_V4MATH_H 32#ifndef LL_V4MATH_H
diff --git a/linden/indra/llmath/xform.cpp b/linden/indra/llmath/xform.cpp
index 71c2755..8399dfb 100644
--- a/linden/indra/llmath/xform.cpp
+++ b/linden/indra/llmath/xform.cpp
@@ -1,6 +1,8 @@
1/** 1/**
2 * @file xform.cpp 2 * @file xform.cpp
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#include "linden_common.h" 31#include "linden_common.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 @@
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