diff options
Diffstat (limited to 'linden/indra/llmath')
56 files changed, 440 insertions, 173 deletions
diff --git a/linden/indra/llmath/camera.h b/linden/indra/llmath/camera.h index 8ac8fdc..19df760 100644 --- a/linden/indra/llmath/camera.h +++ b/linden/indra/llmath/camera.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/coordframe.h b/linden/indra/llmath/coordframe.h index c1b16f8..47cbad5 100644 --- a/linden/indra/llmath/coordframe.h +++ b/linden/indra/llmath/coordframe.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/llbboxlocal.cpp b/linden/indra/llmath/llbboxlocal.cpp index 212e276..b348edd 100644 --- a/linden/indra/llmath/llbboxlocal.cpp +++ b/linden/indra/llmath/llbboxlocal.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | 7 | * Copyright (c) 2001-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/llbboxlocal.h b/linden/indra/llmath/llbboxlocal.h index e7a61ce..6406ee3 100644 --- a/linden/indra/llmath/llbboxlocal.h +++ b/linden/indra/llmath/llbboxlocal.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | 7 | * Copyright (c) 2001-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/llcamera.cpp b/linden/indra/llmath/llcamera.cpp index 7a9d576..cb9fae6 100644 --- a/linden/indra/llmath/llcamera.cpp +++ b/linden/indra/llmath/llcamera.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/llcamera.h b/linden/indra/llmath/llcamera.h index 2884338..bb9ae55 100644 --- a/linden/indra/llmath/llcamera.h +++ b/linden/indra/llmath/llcamera.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/llcoord.h b/linden/indra/llmath/llcoord.h index 1fa1151..dbe6678 100644 --- a/linden/indra/llmath/llcoord.h +++ b/linden/indra/llmath/llcoord.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
5 | * | 5 | * |
6 | * Copyright (c) 2001-2008, Linden Research, Inc. | 6 | * Copyright (c) 2001-2009, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
diff --git a/linden/indra/llmath/llcoordframe.cpp b/linden/indra/llmath/llcoordframe.cpp index 0196424..f1707c9 100644 --- a/linden/indra/llmath/llcoordframe.cpp +++ b/linden/indra/llmath/llcoordframe.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/llcoordframe.h b/linden/indra/llmath/llcoordframe.h index ce14fd7..0ce56bf 100644 --- a/linden/indra/llmath/llcoordframe.h +++ b/linden/indra/llmath/llcoordframe.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/llinterp.h b/linden/indra/llmath/llinterp.h index ec5458f..7438317 100644 --- a/linden/indra/llmath/llinterp.h +++ b/linden/indra/llmath/llinterp.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
5 | * | 5 | * |
6 | * Copyright (c) 2001-2008, Linden Research, Inc. | 6 | * Copyright (c) 2001-2009, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
diff --git a/linden/indra/llmath/llline.cpp b/linden/indra/llmath/llline.cpp index cfd3f56..147918c 100644 --- a/linden/indra/llmath/llline.cpp +++ b/linden/indra/llmath/llline.cpp | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * $LicenseInfo:firstyear=2001&license=internal$ | 6 | * $LicenseInfo:firstyear=2001&license=internal$ |
7 | * | 7 | * |
8 | * Copyright (c) 2001-2008, Linden Research, Inc. | 8 | * Copyright (c) 2001-2009, Linden Research, Inc. |
9 | * | 9 | * |
10 | * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of | 10 | * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of |
11 | * this source code is governed by the Linden Lab Source Code Disclosure | 11 | * this source code is governed by the Linden Lab Source Code Disclosure |
diff --git a/linden/indra/llmath/llline.h b/linden/indra/llmath/llline.h index ca454c5..e7827d5 100644 --- a/linden/indra/llmath/llline.h +++ b/linden/indra/llmath/llline.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * | 6 | * |
7 | * $LicenseInfo:firstyear=2006&license=internal$ | 7 | * $LicenseInfo:firstyear=2006&license=internal$ |
8 | * | 8 | * |
9 | * Copyright (c) 2006-2008, Linden Research, Inc. | 9 | * Copyright (c) 2006-2009, Linden Research, Inc. |
10 | * | 10 | * |
11 | * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of | 11 | * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of |
12 | * this source code is governed by the Linden Lab Source Code Disclosure | 12 | * this source code is governed by the Linden Lab Source Code Disclosure |
diff --git a/linden/indra/llmath/llmath.h b/linden/indra/llmath/llmath.h index 82ab197..b2d4d26 100644 --- a/linden/indra/llmath/llmath.h +++ b/linden/indra/llmath/llmath.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/lloctree.h b/linden/indra/llmath/lloctree.h index 57b359f..3c94aa3 100644 --- a/linden/indra/llmath/lloctree.h +++ b/linden/indra/llmath/lloctree.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2005&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2005&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2005-2008, Linden Research, Inc. | 7 | * Copyright (c) 2005-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
@@ -38,9 +38,9 @@ | |||
38 | #include <set> | 38 | #include <set> |
39 | 39 | ||
40 | #if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG | 40 | #if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG |
41 | #define OCT_ERRS LL_WARNS("OctreeErrors") | ||
42 | #else | ||
43 | #define OCT_ERRS LL_ERRS("OctreeErrors") | 41 | #define OCT_ERRS LL_ERRS("OctreeErrors") |
42 | #else | ||
43 | #define OCT_ERRS LL_WARNS("OctreeErrors") | ||
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | #define LL_OCTREE_PARANOIA_CHECK 0 | 46 | #define LL_OCTREE_PARANOIA_CHECK 0 |
diff --git a/linden/indra/llmath/llperlin.cpp b/linden/indra/llmath/llperlin.cpp index 2b53914..2c3ed90 100644 --- a/linden/indra/llmath/llperlin.cpp +++ b/linden/indra/llmath/llperlin.cpp | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
5 | * | 5 | * |
6 | * Copyright (c) 2001-2008, Linden Research, Inc. | 6 | * Copyright (c) 2001-2009, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
diff --git a/linden/indra/llmath/llperlin.h b/linden/indra/llmath/llperlin.h index 27585f7..d6cf823 100644 --- a/linden/indra/llmath/llperlin.h +++ b/linden/indra/llmath/llperlin.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
5 | * | 5 | * |
6 | * Copyright (c) 2001-2008, Linden Research, Inc. | 6 | * Copyright (c) 2001-2009, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
diff --git a/linden/indra/llmath/llplane.h b/linden/indra/llmath/llplane.h index 51a972e..558cc37 100644 --- a/linden/indra/llmath/llplane.h +++ b/linden/indra/llmath/llplane.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
5 | * | 5 | * |
6 | * Copyright (c) 2001-2008, Linden Research, Inc. | 6 | * Copyright (c) 2001-2009, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
diff --git a/linden/indra/llmath/llquantize.h b/linden/indra/llmath/llquantize.h index e09b80e..25be9c0 100644 --- a/linden/indra/llmath/llquantize.h +++ b/linden/indra/llmath/llquantize.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
7 | * | 7 | * |
8 | * Copyright (c) 2001-2008, Linden Research, Inc. | 8 | * Copyright (c) 2001-2009, Linden Research, Inc. |
9 | * | 9 | * |
10 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
11 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
diff --git a/linden/indra/llmath/llquaternion.cpp b/linden/indra/llmath/llquaternion.cpp index 9eab8ed..485d0cd 100644 --- a/linden/indra/llmath/llquaternion.cpp +++ b/linden/indra/llmath/llquaternion.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/llquaternion.h b/linden/indra/llmath/llquaternion.h index 1eb982e..2289bc8 100644 --- a/linden/indra/llmath/llquaternion.h +++ b/linden/indra/llmath/llquaternion.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/llrect.cpp b/linden/indra/llmath/llrect.cpp index 41f9e67..025d476 100644 --- a/linden/indra/llmath/llrect.cpp +++ b/linden/indra/llmath/llrect.cpp | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
5 | * | 5 | * |
6 | * Copyright (c) 2001-2008, Linden Research, Inc. | 6 | * Copyright (c) 2001-2009, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
diff --git a/linden/indra/llmath/llrect.h b/linden/indra/llmath/llrect.h index ebe5d83..a9faa19 100644 --- a/linden/indra/llmath/llrect.h +++ b/linden/indra/llmath/llrect.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | 7 | * Copyright (c) 2001-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/llsdutil_math.cpp b/linden/indra/llmath/llsdutil_math.cpp index 5b72875..c17c682 100644 --- a/linden/indra/llmath/llsdutil_math.cpp +++ b/linden/indra/llmath/llsdutil_math.cpp | |||
@@ -6,7 +6,7 @@ | |||
6 | * | 6 | * |
7 | * $LicenseInfo:firstyear=2006&license=viewergpl$ | 7 | * $LicenseInfo:firstyear=2006&license=viewergpl$ |
8 | * | 8 | * |
9 | * Copyright (c) 2006-2008, Linden Research, Inc. | 9 | * Copyright (c) 2006-2009, Linden Research, Inc. |
10 | * | 10 | * |
11 | * Second Life Viewer Source Code | 11 | * Second Life Viewer Source Code |
12 | * The source code in this file ("Source Code") is provided by Linden Lab | 12 | * The source code in this file ("Source Code") is provided by Linden Lab |
diff --git a/linden/indra/llmath/llsphere.cpp b/linden/indra/llmath/llsphere.cpp index f253b6c..2923ffe 100644 --- a/linden/indra/llmath/llsphere.cpp +++ b/linden/indra/llmath/llsphere.cpp | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * $LicenseInfo:firstyear=2006&license=internal$ | 6 | * $LicenseInfo:firstyear=2006&license=internal$ |
7 | * | 7 | * |
8 | * Copyright (c) 2006-2008, Linden Research, Inc. | 8 | * Copyright (c) 2006-2009, Linden Research, Inc. |
9 | * | 9 | * |
10 | * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of | 10 | * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of |
11 | * this source code is governed by the Linden Lab Source Code Disclosure | 11 | * this source code is governed by the Linden Lab Source Code Disclosure |
diff --git a/linden/indra/llmath/llsphere.h b/linden/indra/llmath/llsphere.h index 4d7cd7a..2f905e6 100644 --- a/linden/indra/llmath/llsphere.h +++ b/linden/indra/llmath/llsphere.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * | 6 | * |
7 | * $LicenseInfo:firstyear=2001&license=internal$ | 7 | * $LicenseInfo:firstyear=2001&license=internal$ |
8 | * | 8 | * |
9 | * Copyright (c) 2001-2008, Linden Research, Inc. | 9 | * Copyright (c) 2001-2009, Linden Research, Inc. |
10 | * | 10 | * |
11 | * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of | 11 | * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of |
12 | * this source code is governed by the Linden Lab Source Code Disclosure | 12 | * this source code is governed by the Linden Lab Source Code Disclosure |
diff --git a/linden/indra/llmath/lltreenode.h b/linden/indra/llmath/lltreenode.h index 64beed8..6f5e701 100644 --- a/linden/indra/llmath/lltreenode.h +++ b/linden/indra/llmath/lltreenode.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * $LicenseInfo:firstyear=2005&license=viewergpl$ | 4 | * $LicenseInfo:firstyear=2005&license=viewergpl$ |
5 | * | 5 | * |
6 | * Copyright (c) 2005-2008, Linden Research, Inc. | 6 | * Copyright (c) 2005-2009, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
diff --git a/linden/indra/llmath/llv4math.h b/linden/indra/llmath/llv4math.h index 4cf74cd..9c1737e 100644 --- a/linden/indra/llmath/llv4math.h +++ b/linden/indra/llmath/llv4math.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2007-2008, Linden Research, Inc. | 7 | * Copyright (c) 2007-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/llv4matrix3.h b/linden/indra/llmath/llv4matrix3.h index f9bdf8f..619c966 100644 --- a/linden/indra/llmath/llv4matrix3.h +++ b/linden/indra/llmath/llv4matrix3.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2007-2008, Linden Research, Inc. | 7 | * Copyright (c) 2007-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/llv4matrix4.h b/linden/indra/llmath/llv4matrix4.h index b76a822..662d379 100644 --- a/linden/indra/llmath/llv4matrix4.h +++ b/linden/indra/llmath/llv4matrix4.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2007-2008, Linden Research, Inc. | 7 | * Copyright (c) 2007-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/llv4vector3.h b/linden/indra/llmath/llv4vector3.h index 92d08f1..e45ba50 100644 --- a/linden/indra/llmath/llv4vector3.h +++ b/linden/indra/llmath/llv4vector3.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2007-2008, Linden Research, Inc. | 7 | * Copyright (c) 2007-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/llvolume.cpp b/linden/indra/llmath/llvolume.cpp index 7b6c6a9..5603a9c 100644 --- a/linden/indra/llmath/llvolume.cpp +++ b/linden/indra/llmath/llvolume.cpp | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * $LicenseInfo:firstyear=2002&license=viewergpl$ | 4 | * $LicenseInfo:firstyear=2002&license=viewergpl$ |
5 | * | 5 | * |
6 | * Copyright (c) 2002-2008, Linden Research, Inc. | 6 | * Copyright (c) 2002-2009, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -1650,9 +1650,13 @@ void LLPathParams::copyParams(const LLPathParams ¶ms) | |||
1650 | setSkew(params.getSkew()); | 1650 | setSkew(params.getSkew()); |
1651 | } | 1651 | } |
1652 | 1652 | ||
1653 | S32 profile_delete_lock = 1 ; | ||
1653 | LLProfile::~LLProfile() | 1654 | LLProfile::~LLProfile() |
1654 | { | 1655 | { |
1655 | 1656 | if(profile_delete_lock) | |
1657 | { | ||
1658 | llerrs << "LLProfile should not be deleted here!" << llendl ; | ||
1659 | } | ||
1656 | } | 1660 | } |
1657 | 1661 | ||
1658 | 1662 | ||
@@ -1709,7 +1713,11 @@ LLVolume::~LLVolume() | |||
1709 | { | 1713 | { |
1710 | sNumMeshPoints -= mMesh.size(); | 1714 | sNumMeshPoints -= mMesh.size(); |
1711 | delete mPathp; | 1715 | delete mPathp; |
1716 | |||
1717 | profile_delete_lock = 0 ; | ||
1712 | delete mProfilep; | 1718 | delete mProfilep; |
1719 | profile_delete_lock = 1 ; | ||
1720 | |||
1713 | mPathp = NULL; | 1721 | mPathp = NULL; |
1714 | mProfilep = NULL; | 1722 | mProfilep = NULL; |
1715 | mVolumeFaces.clear(); | 1723 | mVolumeFaces.clear(); |
@@ -1754,18 +1762,47 @@ BOOL LLVolume::generate() | |||
1754 | mLODScaleBias.setVec(0.6f, 0.6f, 0.6f); | 1762 | mLODScaleBias.setVec(0.6f, 0.6f, 0.6f); |
1755 | } | 1763 | } |
1756 | 1764 | ||
1765 | //******************************************************************** | ||
1766 | //debug info, to be removed | ||
1767 | if((U32)(mPathp->mPath.size() * mProfilep->mProfile.size()) > (1u << 20)) | ||
1768 | { | ||
1769 | llinfos << "sizeS: " << mPathp->mPath.size() << " sizeT: " << mProfilep->mProfile.size() << llendl ; | ||
1770 | llinfos << "path_detail : " << path_detail << " split: " << split << " profile_detail: " << profile_detail << llendl ; | ||
1771 | llinfos << mParams << llendl ; | ||
1772 | llinfos << "more info to check if mProfilep is deleted or not." << llendl ; | ||
1773 | llinfos << mProfilep->mNormals.size() << " : " << mProfilep->mFaces.size() << " : " << mProfilep->mEdgeNormals.size() << " : " << mProfilep->mEdgeCenters.size() << llendl ; | ||
1774 | |||
1775 | llerrs << "LLVolume corrupted!" << llendl ; | ||
1776 | } | ||
1777 | //******************************************************************** | ||
1778 | |||
1757 | BOOL regenPath = mPathp->generate(mParams.getPathParams(), path_detail, split); | 1779 | BOOL regenPath = mPathp->generate(mParams.getPathParams(), path_detail, split); |
1758 | BOOL regenProf = mProfilep->generate(mParams.getProfileParams(), mPathp->isOpen(),profile_detail, split); | 1780 | BOOL regenProf = mProfilep->generate(mParams.getProfileParams(), mPathp->isOpen(),profile_detail, split); |
1759 | 1781 | ||
1760 | if (regenPath || regenProf ) | 1782 | if (regenPath || regenProf ) |
1761 | { | 1783 | { |
1762 | sNumMeshPoints -= mMesh.size(); | ||
1763 | mMesh.resize(mProfilep->mProfile.size() * mPathp->mPath.size()); | ||
1764 | sNumMeshPoints += mMesh.size(); | ||
1765 | |||
1766 | S32 sizeS = mPathp->mPath.size(); | 1784 | S32 sizeS = mPathp->mPath.size(); |
1767 | S32 sizeT = mProfilep->mProfile.size(); | 1785 | S32 sizeT = mProfilep->mProfile.size(); |
1768 | 1786 | ||
1787 | //******************************************************************** | ||
1788 | //debug info, to be removed | ||
1789 | if((U32)(sizeS * sizeT) > (1u << 20)) | ||
1790 | { | ||
1791 | llinfos << "regenPath: " << (S32)regenPath << " regenProf: " << (S32)regenProf << llendl ; | ||
1792 | llinfos << "sizeS: " << sizeS << " sizeT: " << sizeT << llendl ; | ||
1793 | llinfos << "path_detail : " << path_detail << " split: " << split << " profile_detail: " << profile_detail << llendl ; | ||
1794 | llinfos << mParams << llendl ; | ||
1795 | llinfos << "more info to check if mProfilep is deleted or not." << llendl ; | ||
1796 | llinfos << mProfilep->mNormals.size() << " : " << mProfilep->mFaces.size() << " : " << mProfilep->mEdgeNormals.size() << " : " << mProfilep->mEdgeCenters.size() << llendl ; | ||
1797 | |||
1798 | llerrs << "LLVolume corrupted!" << llendl ; | ||
1799 | } | ||
1800 | //******************************************************************** | ||
1801 | |||
1802 | sNumMeshPoints -= mMesh.size(); | ||
1803 | mMesh.resize(sizeT * sizeS); | ||
1804 | sNumMeshPoints += mMesh.size(); | ||
1805 | |||
1769 | //generate vertex positions | 1806 | //generate vertex positions |
1770 | 1807 | ||
1771 | // Run along the path. | 1808 | // Run along the path. |
diff --git a/linden/indra/llmath/llvolume.h b/linden/indra/llmath/llvolume.h index 8ac0e71..48c48e4 100644 --- a/linden/indra/llmath/llvolume.h +++ b/linden/indra/llmath/llvolume.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2002&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2002&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2002-2008, Linden Research, Inc. | 7 | * Copyright (c) 2002-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
@@ -671,9 +671,7 @@ public: | |||
671 | mConcave(FALSE), | 671 | mConcave(FALSE), |
672 | mDirty(TRUE), | 672 | mDirty(TRUE), |
673 | mTotalOut(0), | 673 | mTotalOut(0), |
674 | mTotal(2), | 674 | mTotal(2) |
675 | mMinX(0.f), | ||
676 | mMaxX(0.f) | ||
677 | { | 675 | { |
678 | } | 676 | } |
679 | 677 | ||
@@ -721,9 +719,6 @@ protected: | |||
721 | 719 | ||
722 | S32 mTotalOut; | 720 | S32 mTotalOut; |
723 | S32 mTotal; | 721 | S32 mTotal; |
724 | |||
725 | F32 mMaxX; | ||
726 | F32 mMinX; | ||
727 | }; | 722 | }; |
728 | 723 | ||
729 | //------------------------------------------------------------------- | 724 | //------------------------------------------------------------------- |
diff --git a/linden/indra/llmath/llvolumemgr.cpp b/linden/indra/llmath/llvolumemgr.cpp index a3cd6b5..edd7513 100644 --- a/linden/indra/llmath/llvolumemgr.cpp +++ b/linden/indra/llmath/llvolumemgr.cpp | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * $LicenseInfo:firstyear=2002&license=viewergpl$ | 4 | * $LicenseInfo:firstyear=2002&license=viewergpl$ |
5 | * | 5 | * |
6 | * Copyright (c) 2002-2008, Linden Research, Inc. | 6 | * Copyright (c) 2002-2009, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
diff --git a/linden/indra/llmath/llvolumemgr.h b/linden/indra/llmath/llvolumemgr.h index d579fed..0348373 100644 --- a/linden/indra/llmath/llvolumemgr.h +++ b/linden/indra/llmath/llvolumemgr.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2002&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2002&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2002-2008, Linden Research, Inc. | 7 | * Copyright (c) 2002-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/m3math.cpp b/linden/indra/llmath/m3math.cpp index 5c3eb08..578a4c6 100644 --- a/linden/indra/llmath/m3math.cpp +++ b/linden/indra/llmath/m3math.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/m3math.h b/linden/indra/llmath/m3math.h index cd22a86..76ee1ea 100644 --- a/linden/indra/llmath/m3math.h +++ b/linden/indra/llmath/m3math.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/m4math.cpp b/linden/indra/llmath/m4math.cpp index f2db478..dc6b0b5 100644 --- a/linden/indra/llmath/m4math.cpp +++ b/linden/indra/llmath/m4math.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/m4math.h b/linden/indra/llmath/m4math.h index 96e0a31..1d30489 100644 --- a/linden/indra/llmath/m4math.h +++ b/linden/indra/llmath/m4math.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/raytrace.cpp b/linden/indra/llmath/raytrace.cpp index a3049cd..0116502 100644 --- a/linden/indra/llmath/raytrace.cpp +++ b/linden/indra/llmath/raytrace.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | 7 | * Copyright (c) 2001-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/raytrace.h b/linden/indra/llmath/raytrace.h index 9499f84..757181f 100644 --- a/linden/indra/llmath/raytrace.h +++ b/linden/indra/llmath/raytrace.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | 7 | * Copyright (c) 2001-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/v2math.cpp b/linden/indra/llmath/v2math.cpp index c3bb093..ee60143 100644 --- a/linden/indra/llmath/v2math.cpp +++ b/linden/indra/llmath/v2math.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/v2math.h b/linden/indra/llmath/v2math.h index 350079d..6016c04 100644 --- a/linden/indra/llmath/v2math.h +++ b/linden/indra/llmath/v2math.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/v3color.cpp b/linden/indra/llmath/v3color.cpp index 9bdcd27..b55b883 100644 --- a/linden/indra/llmath/v3color.cpp +++ b/linden/indra/llmath/v3color.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/v3color.h b/linden/indra/llmath/v3color.h index b9bc641..d530187 100644 --- a/linden/indra/llmath/v3color.h +++ b/linden/indra/llmath/v3color.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | 7 | * Copyright (c) 2001-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
@@ -82,13 +82,23 @@ public: | |||
82 | 82 | ||
83 | const LLColor3& setToBlack(); // Clears LLColor3 to (0, 0, 0) | 83 | const LLColor3& setToBlack(); // Clears LLColor3 to (0, 0, 0) |
84 | const LLColor3& setToWhite(); // Zero LLColor3 to (0, 0, 0) | 84 | const LLColor3& setToWhite(); // Zero LLColor3 to (0, 0, 0) |
85 | const LLColor3& setVec(F32 x, F32 y, F32 z); // Sets LLColor3 to (x, y, z) | 85 | |
86 | const LLColor3& setVec(const LLColor3 &vec); // Sets LLColor3 to vec | 86 | const LLColor3& setVec(F32 x, F32 y, F32 z); // deprecated |
87 | const LLColor3& setVec(const F32 *vec); // Sets LLColor3 to vec | 87 | const LLColor3& setVec(const LLColor3 &vec); // deprecated |
88 | const LLColor3& setVec(const F32 *vec); // deprecated | ||
89 | |||
90 | const LLColor3& set(F32 x, F32 y, F32 z); // Sets LLColor3 to (x, y, z) | ||
91 | const LLColor3& set(const LLColor3 &vec); // Sets LLColor3 to vec | ||
92 | const LLColor3& set(const F32 *vec); // Sets LLColor3 to vec | ||
93 | |||
94 | F32 magVec() const; // deprecated | ||
95 | F32 magVecSquared() const; // deprecated | ||
96 | F32 normVec(); // deprecated | ||
97 | |||
98 | F32 length() const; // Returns magnitude of LLColor3 | ||
99 | F32 lengthSquared() const; // Returns magnitude squared of LLColor3 | ||
100 | F32 normalize(); // Normalizes and returns the magnitude of LLColor3 | ||
88 | 101 | ||
89 | F32 magVec() const; // Returns magnitude of LLColor3 | ||
90 | F32 magVecSquared() const; // Returns magnitude squared of LLColor3 | ||
91 | F32 normVec(); // Normalizes and returns the magnitude of LLColor3 | ||
92 | F32 brightness() const; // Returns brightness of LLColor3 | 102 | F32 brightness() const; // Returns brightness of LLColor3 |
93 | 103 | ||
94 | const LLColor3& operator=(const LLColor4 &a); | 104 | const LLColor3& operator=(const LLColor4 &a); |
@@ -214,6 +224,31 @@ inline const LLColor3& LLColor3::setToWhite(void) | |||
214 | return (*this); | 224 | return (*this); |
215 | } | 225 | } |
216 | 226 | ||
227 | inline const LLColor3& LLColor3::set(F32 r, F32 g, F32 b) | ||
228 | { | ||
229 | mV[0] = r; | ||
230 | mV[1] = g; | ||
231 | mV[2] = b; | ||
232 | return (*this); | ||
233 | } | ||
234 | |||
235 | inline const LLColor3& LLColor3::set(const LLColor3 &vec) | ||
236 | { | ||
237 | mV[0] = vec.mV[0]; | ||
238 | mV[1] = vec.mV[1]; | ||
239 | mV[2] = vec.mV[2]; | ||
240 | return (*this); | ||
241 | } | ||
242 | |||
243 | inline const LLColor3& LLColor3::set(const F32 *vec) | ||
244 | { | ||
245 | mV[0] = vec[0]; | ||
246 | mV[1] = vec[1]; | ||
247 | mV[2] = vec[2]; | ||
248 | return (*this); | ||
249 | } | ||
250 | |||
251 | // deprecated | ||
217 | inline const LLColor3& LLColor3::setVec(F32 r, F32 g, F32 b) | 252 | inline const LLColor3& LLColor3::setVec(F32 r, F32 g, F32 b) |
218 | { | 253 | { |
219 | mV[0] = r; | 254 | mV[0] = r; |
@@ -222,6 +257,7 @@ inline const LLColor3& LLColor3::setVec(F32 r, F32 g, F32 b) | |||
222 | return (*this); | 257 | return (*this); |
223 | } | 258 | } |
224 | 259 | ||
260 | // deprecated | ||
225 | inline const LLColor3& LLColor3::setVec(const LLColor3 &vec) | 261 | inline const LLColor3& LLColor3::setVec(const LLColor3 &vec) |
226 | { | 262 | { |
227 | mV[0] = vec.mV[0]; | 263 | mV[0] = vec.mV[0]; |
@@ -230,6 +266,7 @@ inline const LLColor3& LLColor3::setVec(const LLColor3 &vec) | |||
230 | return (*this); | 266 | return (*this); |
231 | } | 267 | } |
232 | 268 | ||
269 | // deprecated | ||
233 | inline const LLColor3& LLColor3::setVec(const F32 *vec) | 270 | inline const LLColor3& LLColor3::setVec(const F32 *vec) |
234 | { | 271 | { |
235 | mV[0] = vec[0]; | 272 | mV[0] = vec[0]; |
@@ -243,16 +280,44 @@ inline F32 LLColor3::brightness(void) const | |||
243 | return (mV[0] + mV[1] + mV[2]) / 3.0f; | 280 | return (mV[0] + mV[1] + mV[2]) / 3.0f; |
244 | } | 281 | } |
245 | 282 | ||
283 | inline F32 LLColor3::length(void) const | ||
284 | { | ||
285 | return fsqrtf(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); | ||
286 | } | ||
287 | |||
288 | inline F32 LLColor3::lengthSquared(void) const | ||
289 | { | ||
290 | return mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]; | ||
291 | } | ||
292 | |||
293 | inline F32 LLColor3::normalize(void) | ||
294 | { | ||
295 | F32 mag = fsqrtf(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); | ||
296 | F32 oomag; | ||
297 | |||
298 | if (mag) | ||
299 | { | ||
300 | oomag = 1.f/mag; | ||
301 | mV[0] *= oomag; | ||
302 | mV[1] *= oomag; | ||
303 | mV[2] *= oomag; | ||
304 | } | ||
305 | return (mag); | ||
306 | } | ||
307 | |||
308 | // deprecated | ||
246 | inline F32 LLColor3::magVec(void) const | 309 | inline F32 LLColor3::magVec(void) const |
247 | { | 310 | { |
248 | return fsqrtf(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); | 311 | return fsqrtf(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); |
249 | } | 312 | } |
250 | 313 | ||
314 | // deprecated | ||
251 | inline F32 LLColor3::magVecSquared(void) const | 315 | inline F32 LLColor3::magVecSquared(void) const |
252 | { | 316 | { |
253 | return mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]; | 317 | return mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]; |
254 | } | 318 | } |
255 | 319 | ||
320 | // deprecated | ||
256 | inline F32 LLColor3::normVec(void) | 321 | inline F32 LLColor3::normVec(void) |
257 | { | 322 | { |
258 | F32 mag = fsqrtf(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); | 323 | F32 mag = fsqrtf(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]); |
diff --git a/linden/indra/llmath/v3dmath.cpp b/linden/indra/llmath/v3dmath.cpp index 5a3246c..bd42830 100644 --- a/linden/indra/llmath/v3dmath.cpp +++ b/linden/indra/llmath/v3dmath.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/v3dmath.h b/linden/indra/llmath/v3dmath.h index ecb333a..078fde8 100644 --- a/linden/indra/llmath/v3dmath.h +++ b/linden/indra/llmath/v3dmath.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/v3math.cpp b/linden/indra/llmath/v3math.cpp index cb87836..b97b410 100644 --- a/linden/indra/llmath/v3math.cpp +++ b/linden/indra/llmath/v3math.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/v3math.h b/linden/indra/llmath/v3math.h index 65932cd..4935443 100644 --- a/linden/indra/llmath/v3math.h +++ b/linden/indra/llmath/v3math.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/v4color.cpp b/linden/indra/llmath/v4color.cpp index 88237a0..32cfd5e 100644 --- a/linden/indra/llmath/v4color.cpp +++ b/linden/indra/llmath/v4color.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
@@ -161,6 +161,38 @@ LLColor4::LLColor4(const LLVector4& vector4) | |||
161 | mV[VW] = vector4.mV[VW]; | 161 | mV[VW] = vector4.mV[VW]; |
162 | } | 162 | } |
163 | 163 | ||
164 | const LLColor4& LLColor4::set(const LLColor4U& color4u) | ||
165 | { | ||
166 | const F32 SCALE = 1.f/255.f; | ||
167 | mV[VX] = color4u.mV[VX] * SCALE; | ||
168 | mV[VY] = color4u.mV[VY] * SCALE; | ||
169 | mV[VZ] = color4u.mV[VZ] * SCALE; | ||
170 | mV[VW] = color4u.mV[VW] * SCALE; | ||
171 | return (*this); | ||
172 | } | ||
173 | |||
174 | const LLColor4& LLColor4::set(const LLColor3 &vec) | ||
175 | { | ||
176 | mV[VX] = vec.mV[VX]; | ||
177 | mV[VY] = vec.mV[VY]; | ||
178 | mV[VZ] = vec.mV[VZ]; | ||
179 | |||
180 | // no change to alpha! | ||
181 | // mV[VW] = 1.f; | ||
182 | |||
183 | return (*this); | ||
184 | } | ||
185 | |||
186 | const LLColor4& LLColor4::set(const LLColor3 &vec, F32 a) | ||
187 | { | ||
188 | mV[VX] = vec.mV[VX]; | ||
189 | mV[VY] = vec.mV[VY]; | ||
190 | mV[VZ] = vec.mV[VZ]; | ||
191 | mV[VW] = a; | ||
192 | return (*this); | ||
193 | } | ||
194 | |||
195 | // deprecated -- use set() | ||
164 | const LLColor4& LLColor4::setVec(const LLColor4U& color4u) | 196 | const LLColor4& LLColor4::setVec(const LLColor4U& color4u) |
165 | { | 197 | { |
166 | const F32 SCALE = 1.f/255.f; | 198 | const F32 SCALE = 1.f/255.f; |
@@ -171,6 +203,7 @@ const LLColor4& LLColor4::setVec(const LLColor4U& color4u) | |||
171 | return (*this); | 203 | return (*this); |
172 | } | 204 | } |
173 | 205 | ||
206 | // deprecated -- use set() | ||
174 | const LLColor4& LLColor4::setVec(const LLColor3 &vec) | 207 | const LLColor4& LLColor4::setVec(const LLColor3 &vec) |
175 | { | 208 | { |
176 | mV[VX] = vec.mV[VX]; | 209 | mV[VX] = vec.mV[VX]; |
@@ -183,6 +216,7 @@ const LLColor4& LLColor4::setVec(const LLColor3 &vec) | |||
183 | return (*this); | 216 | return (*this); |
184 | } | 217 | } |
185 | 218 | ||
219 | // deprecated -- use set() | ||
186 | const LLColor4& LLColor4::setVec(const LLColor3 &vec, F32 a) | 220 | const LLColor4& LLColor4::setVec(const LLColor3 &vec, F32 a) |
187 | { | 221 | { |
188 | mV[VX] = vec.mV[VX]; | 222 | mV[VX] = vec.mV[VX]; |
@@ -338,270 +372,270 @@ BOOL LLColor4::parseColor(const std::string& buf, LLColor4* color) | |||
338 | { | 372 | { |
339 | v = v * (1.f / 255.f); | 373 | v = v * (1.f / 255.f); |
340 | } | 374 | } |
341 | color->setVec( v ); | 375 | color->set( v ); |
342 | } | 376 | } |
343 | else // Single value. Read as a named color. | 377 | else // Single value. Read as a named color. |
344 | { | 378 | { |
345 | // We have a color name | 379 | // We have a color name |
346 | if ( "red" == color_name ) | 380 | if ( "red" == color_name ) |
347 | { | 381 | { |
348 | color->setVec(LLColor4::red); | 382 | color->set(LLColor4::red); |
349 | } | 383 | } |
350 | else if ( "red1" == color_name ) | 384 | else if ( "red1" == color_name ) |
351 | { | 385 | { |
352 | color->setVec(LLColor4::red1); | 386 | color->set(LLColor4::red1); |
353 | } | 387 | } |
354 | else if ( "red2" == color_name ) | 388 | else if ( "red2" == color_name ) |
355 | { | 389 | { |
356 | color->setVec(LLColor4::red2); | 390 | color->set(LLColor4::red2); |
357 | } | 391 | } |
358 | else if ( "red3" == color_name ) | 392 | else if ( "red3" == color_name ) |
359 | { | 393 | { |
360 | color->setVec(LLColor4::red3); | 394 | color->set(LLColor4::red3); |
361 | } | 395 | } |
362 | else if ( "red4" == color_name ) | 396 | else if ( "red4" == color_name ) |
363 | { | 397 | { |
364 | color->setVec(LLColor4::red4); | 398 | color->set(LLColor4::red4); |
365 | } | 399 | } |
366 | else if ( "red5" == color_name ) | 400 | else if ( "red5" == color_name ) |
367 | { | 401 | { |
368 | color->setVec(LLColor4::red5); | 402 | color->set(LLColor4::red5); |
369 | } | 403 | } |
370 | else if( "green" == color_name ) | 404 | else if( "green" == color_name ) |
371 | { | 405 | { |
372 | color->setVec(LLColor4::green); | 406 | color->set(LLColor4::green); |
373 | } | 407 | } |
374 | else if( "green1" == color_name ) | 408 | else if( "green1" == color_name ) |
375 | { | 409 | { |
376 | color->setVec(LLColor4::green1); | 410 | color->set(LLColor4::green1); |
377 | } | 411 | } |
378 | else if( "green2" == color_name ) | 412 | else if( "green2" == color_name ) |
379 | { | 413 | { |
380 | color->setVec(LLColor4::green2); | 414 | color->set(LLColor4::green2); |
381 | } | 415 | } |
382 | else if( "green3" == color_name ) | 416 | else if( "green3" == color_name ) |
383 | { | 417 | { |
384 | color->setVec(LLColor4::green3); | 418 | color->set(LLColor4::green3); |
385 | } | 419 | } |
386 | else if( "green4" == color_name ) | 420 | else if( "green4" == color_name ) |
387 | { | 421 | { |
388 | color->setVec(LLColor4::green4); | 422 | color->set(LLColor4::green4); |
389 | } | 423 | } |
390 | else if( "green5" == color_name ) | 424 | else if( "green5" == color_name ) |
391 | { | 425 | { |
392 | color->setVec(LLColor4::green5); | 426 | color->set(LLColor4::green5); |
393 | } | 427 | } |
394 | else if( "green6" == color_name ) | 428 | else if( "green6" == color_name ) |
395 | { | 429 | { |
396 | color->setVec(LLColor4::green6); | 430 | color->set(LLColor4::green6); |
397 | } | 431 | } |
398 | else if( "blue" == color_name ) | 432 | else if( "blue" == color_name ) |
399 | { | 433 | { |
400 | color->setVec(LLColor4::blue); | 434 | color->set(LLColor4::blue); |
401 | } | 435 | } |
402 | else if( "blue1" == color_name ) | 436 | else if( "blue1" == color_name ) |
403 | { | 437 | { |
404 | color->setVec(LLColor4::blue1); | 438 | color->set(LLColor4::blue1); |
405 | } | 439 | } |
406 | else if( "blue2" == color_name ) | 440 | else if( "blue2" == color_name ) |
407 | { | 441 | { |
408 | color->setVec(LLColor4::blue2); | 442 | color->set(LLColor4::blue2); |
409 | } | 443 | } |
410 | else if( "blue3" == color_name ) | 444 | else if( "blue3" == color_name ) |
411 | { | 445 | { |
412 | color->setVec(LLColor4::blue3); | 446 | color->set(LLColor4::blue3); |
413 | } | 447 | } |
414 | else if( "blue4" == color_name ) | 448 | else if( "blue4" == color_name ) |
415 | { | 449 | { |
416 | color->setVec(LLColor4::blue4); | 450 | color->set(LLColor4::blue4); |
417 | } | 451 | } |
418 | else if( "blue5" == color_name ) | 452 | else if( "blue5" == color_name ) |
419 | { | 453 | { |
420 | color->setVec(LLColor4::blue5); | 454 | color->set(LLColor4::blue5); |
421 | } | 455 | } |
422 | else if( "blue6" == color_name ) | 456 | else if( "blue6" == color_name ) |
423 | { | 457 | { |
424 | color->setVec(LLColor4::blue6); | 458 | color->set(LLColor4::blue6); |
425 | } | 459 | } |
426 | else if( "black" == color_name ) | 460 | else if( "black" == color_name ) |
427 | { | 461 | { |
428 | color->setVec(LLColor4::black); | 462 | color->set(LLColor4::black); |
429 | } | 463 | } |
430 | else if( "white" == color_name ) | 464 | else if( "white" == color_name ) |
431 | { | 465 | { |
432 | color->setVec(LLColor4::white); | 466 | color->set(LLColor4::white); |
433 | } | 467 | } |
434 | else if( "yellow" == color_name ) | 468 | else if( "yellow" == color_name ) |
435 | { | 469 | { |
436 | color->setVec(LLColor4::yellow); | 470 | color->set(LLColor4::yellow); |
437 | } | 471 | } |
438 | else if( "yellow1" == color_name ) | 472 | else if( "yellow1" == color_name ) |
439 | { | 473 | { |
440 | color->setVec(LLColor4::yellow1); | 474 | color->set(LLColor4::yellow1); |
441 | } | 475 | } |
442 | else if( "yellow2" == color_name ) | 476 | else if( "yellow2" == color_name ) |
443 | { | 477 | { |
444 | color->setVec(LLColor4::yellow2); | 478 | color->set(LLColor4::yellow2); |
445 | } | 479 | } |
446 | else if( "yellow3" == color_name ) | 480 | else if( "yellow3" == color_name ) |
447 | { | 481 | { |
448 | color->setVec(LLColor4::yellow3); | 482 | color->set(LLColor4::yellow3); |
449 | } | 483 | } |
450 | else if( "yellow4" == color_name ) | 484 | else if( "yellow4" == color_name ) |
451 | { | 485 | { |
452 | color->setVec(LLColor4::yellow4); | 486 | color->set(LLColor4::yellow4); |
453 | } | 487 | } |
454 | else if( "yellow5" == color_name ) | 488 | else if( "yellow5" == color_name ) |
455 | { | 489 | { |
456 | color->setVec(LLColor4::yellow5); | 490 | color->set(LLColor4::yellow5); |
457 | } | 491 | } |
458 | else if( "yellow6" == color_name ) | 492 | else if( "yellow6" == color_name ) |
459 | { | 493 | { |
460 | color->setVec(LLColor4::yellow6); | 494 | color->set(LLColor4::yellow6); |
461 | } | 495 | } |
462 | else if( "magenta" == color_name ) | 496 | else if( "magenta" == color_name ) |
463 | { | 497 | { |
464 | color->setVec(LLColor4::magenta); | 498 | color->set(LLColor4::magenta); |
465 | } | 499 | } |
466 | else if( "magenta1" == color_name ) | 500 | else if( "magenta1" == color_name ) |
467 | { | 501 | { |
468 | color->setVec(LLColor4::magenta1); | 502 | color->set(LLColor4::magenta1); |
469 | } | 503 | } |
470 | else if( "magenta2" == color_name ) | 504 | else if( "magenta2" == color_name ) |
471 | { | 505 | { |
472 | color->setVec(LLColor4::magenta2); | 506 | color->set(LLColor4::magenta2); |
473 | } | 507 | } |
474 | else if( "magenta3" == color_name ) | 508 | else if( "magenta3" == color_name ) |
475 | { | 509 | { |
476 | color->setVec(LLColor4::magenta3); | 510 | color->set(LLColor4::magenta3); |
477 | } | 511 | } |
478 | else if( "magenta4" == color_name ) | 512 | else if( "magenta4" == color_name ) |
479 | { | 513 | { |
480 | color->setVec(LLColor4::magenta4); | 514 | color->set(LLColor4::magenta4); |
481 | } | 515 | } |
482 | else if( "purple" == color_name ) | 516 | else if( "purple" == color_name ) |
483 | { | 517 | { |
484 | color->setVec(LLColor4::purple); | 518 | color->set(LLColor4::purple); |
485 | } | 519 | } |
486 | else if( "purple1" == color_name ) | 520 | else if( "purple1" == color_name ) |
487 | { | 521 | { |
488 | color->setVec(LLColor4::purple1); | 522 | color->set(LLColor4::purple1); |
489 | } | 523 | } |
490 | else if( "purple2" == color_name ) | 524 | else if( "purple2" == color_name ) |
491 | { | 525 | { |
492 | color->setVec(LLColor4::purple2); | 526 | color->set(LLColor4::purple2); |
493 | } | 527 | } |
494 | else if( "purple3" == color_name ) | 528 | else if( "purple3" == color_name ) |
495 | { | 529 | { |
496 | color->setVec(LLColor4::purple3); | 530 | color->set(LLColor4::purple3); |
497 | } | 531 | } |
498 | else if( "purple4" == color_name ) | 532 | else if( "purple4" == color_name ) |
499 | { | 533 | { |
500 | color->setVec(LLColor4::purple4); | 534 | color->set(LLColor4::purple4); |
501 | } | 535 | } |
502 | else if( "purple5" == color_name ) | 536 | else if( "purple5" == color_name ) |
503 | { | 537 | { |
504 | color->setVec(LLColor4::purple5); | 538 | color->set(LLColor4::purple5); |
505 | } | 539 | } |
506 | else if( "purple6" == color_name ) | 540 | else if( "purple6" == color_name ) |
507 | { | 541 | { |
508 | color->setVec(LLColor4::purple6); | 542 | color->set(LLColor4::purple6); |
509 | } | 543 | } |
510 | else if( "pink" == color_name ) | 544 | else if( "pink" == color_name ) |
511 | { | 545 | { |
512 | color->setVec(LLColor4::pink); | 546 | color->set(LLColor4::pink); |
513 | } | 547 | } |
514 | else if( "pink1" == color_name ) | 548 | else if( "pink1" == color_name ) |
515 | { | 549 | { |
516 | color->setVec(LLColor4::pink1); | 550 | color->set(LLColor4::pink1); |
517 | } | 551 | } |
518 | else if( "pink2" == color_name ) | 552 | else if( "pink2" == color_name ) |
519 | { | 553 | { |
520 | color->setVec(LLColor4::pink2); | 554 | color->set(LLColor4::pink2); |
521 | } | 555 | } |
522 | else if( "cyan" == color_name ) | 556 | else if( "cyan" == color_name ) |
523 | { | 557 | { |
524 | color->setVec(LLColor4::cyan); | 558 | color->set(LLColor4::cyan); |
525 | } | 559 | } |
526 | else if( "cyan1" == color_name ) | 560 | else if( "cyan1" == color_name ) |
527 | { | 561 | { |
528 | color->setVec(LLColor4::cyan1); | 562 | color->set(LLColor4::cyan1); |
529 | } | 563 | } |
530 | else if( "cyan2" == color_name ) | 564 | else if( "cyan2" == color_name ) |
531 | { | 565 | { |
532 | color->setVec(LLColor4::cyan2); | 566 | color->set(LLColor4::cyan2); |
533 | } | 567 | } |
534 | else if( "cyan3" == color_name ) | 568 | else if( "cyan3" == color_name ) |
535 | { | 569 | { |
536 | color->setVec(LLColor4::cyan3); | 570 | color->set(LLColor4::cyan3); |
537 | } | 571 | } |
538 | else if( "cyan4" == color_name ) | 572 | else if( "cyan4" == color_name ) |
539 | { | 573 | { |
540 | color->setVec(LLColor4::cyan4); | 574 | color->set(LLColor4::cyan4); |
541 | } | 575 | } |
542 | else if( "cyan5" == color_name ) | 576 | else if( "cyan5" == color_name ) |
543 | { | 577 | { |
544 | color->setVec(LLColor4::cyan5); | 578 | color->set(LLColor4::cyan5); |
545 | } | 579 | } |
546 | else if( "cyan6" == color_name ) | 580 | else if( "cyan6" == color_name ) |
547 | { | 581 | { |
548 | color->setVec(LLColor4::cyan6); | 582 | color->set(LLColor4::cyan6); |
549 | } | 583 | } |
550 | else if( "smoke" == color_name ) | 584 | else if( "smoke" == color_name ) |
551 | { | 585 | { |
552 | color->setVec(LLColor4::smoke); | 586 | color->set(LLColor4::smoke); |
553 | } | 587 | } |
554 | else if( "grey" == color_name ) | 588 | else if( "grey" == color_name ) |
555 | { | 589 | { |
556 | color->setVec(LLColor4::grey); | 590 | color->set(LLColor4::grey); |
557 | } | 591 | } |
558 | else if( "grey1" == color_name ) | 592 | else if( "grey1" == color_name ) |
559 | { | 593 | { |
560 | color->setVec(LLColor4::grey1); | 594 | color->set(LLColor4::grey1); |
561 | } | 595 | } |
562 | else if( "grey2" == color_name ) | 596 | else if( "grey2" == color_name ) |
563 | { | 597 | { |
564 | color->setVec(LLColor4::grey2); | 598 | color->set(LLColor4::grey2); |
565 | } | 599 | } |
566 | else if( "grey3" == color_name ) | 600 | else if( "grey3" == color_name ) |
567 | { | 601 | { |
568 | color->setVec(LLColor4::grey3); | 602 | color->set(LLColor4::grey3); |
569 | } | 603 | } |
570 | else if( "grey4" == color_name ) | 604 | else if( "grey4" == color_name ) |
571 | { | 605 | { |
572 | color->setVec(LLColor4::grey4); | 606 | color->set(LLColor4::grey4); |
573 | } | 607 | } |
574 | else if( "orange" == color_name ) | 608 | else if( "orange" == color_name ) |
575 | { | 609 | { |
576 | color->setVec(LLColor4::orange); | 610 | color->set(LLColor4::orange); |
577 | } | 611 | } |
578 | else if( "orange1" == color_name ) | 612 | else if( "orange1" == color_name ) |
579 | { | 613 | { |
580 | color->setVec(LLColor4::orange1); | 614 | color->set(LLColor4::orange1); |
581 | } | 615 | } |
582 | else if( "orange2" == color_name ) | 616 | else if( "orange2" == color_name ) |
583 | { | 617 | { |
584 | color->setVec(LLColor4::orange2); | 618 | color->set(LLColor4::orange2); |
585 | } | 619 | } |
586 | else if( "orange3" == color_name ) | 620 | else if( "orange3" == color_name ) |
587 | { | 621 | { |
588 | color->setVec(LLColor4::orange3); | 622 | color->set(LLColor4::orange3); |
589 | } | 623 | } |
590 | else if( "orange4" == color_name ) | 624 | else if( "orange4" == color_name ) |
591 | { | 625 | { |
592 | color->setVec(LLColor4::orange4); | 626 | color->set(LLColor4::orange4); |
593 | } | 627 | } |
594 | else if( "orange5" == color_name ) | 628 | else if( "orange5" == color_name ) |
595 | { | 629 | { |
596 | color->setVec(LLColor4::orange5); | 630 | color->set(LLColor4::orange5); |
597 | } | 631 | } |
598 | else if( "orange6" == color_name ) | 632 | else if( "orange6" == color_name ) |
599 | { | 633 | { |
600 | color->setVec(LLColor4::orange6); | 634 | color->set(LLColor4::orange6); |
601 | } | 635 | } |
602 | else if ( "clear" == color_name ) | 636 | else if ( "clear" == color_name ) |
603 | { | 637 | { |
604 | color->setVec(0.f, 0.f, 0.f, 0.f); | 638 | color->set(0.f, 0.f, 0.f, 0.f); |
605 | } | 639 | } |
606 | else | 640 | else |
607 | { | 641 | { |
diff --git a/linden/indra/llmath/v4color.h b/linden/indra/llmath/v4color.h index 53e4407..57055c5 100644 --- a/linden/indra/llmath/v4color.h +++ b/linden/indra/llmath/v4color.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | 7 | * Copyright (c) 2001-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
@@ -84,20 +84,33 @@ class LLColor4 | |||
84 | const LLColor4& setToBlack(); // zero LLColor4 to (0, 0, 0, 1) | 84 | const LLColor4& setToBlack(); // zero LLColor4 to (0, 0, 0, 1) |
85 | const LLColor4& setToWhite(); // zero LLColor4 to (0, 0, 0, 1) | 85 | const LLColor4& setToWhite(); // zero LLColor4 to (0, 0, 0, 1) |
86 | 86 | ||
87 | const LLColor4& setVec(F32 r, F32 g, F32 b, F32 a); // Sets LLColor4 to (r, g, b, a) | 87 | const LLColor4& setVec(F32 r, F32 g, F32 b, F32 a); // deprecated -- use set() |
88 | const LLColor4& setVec(F32 r, F32 g, F32 b); // Sets LLColor4 to (r, g, b) (no change in a) | 88 | const LLColor4& setVec(F32 r, F32 g, F32 b); // deprecated -- use set() |
89 | const LLColor4& setVec(const LLColor4 &vec); // Sets LLColor4 to vec | 89 | const LLColor4& setVec(const LLColor4 &vec); // deprecated -- use set() |
90 | const LLColor4& setVec(const LLColor3 &vec); // Sets LLColor4 to LLColor3 vec (no change in alpha) | 90 | const LLColor4& setVec(const LLColor3 &vec); // deprecated -- use set() |
91 | const LLColor4& setVec(const LLColor3 &vec, F32 a); // Sets LLColor4 to LLColor3 vec, with alpha specified | 91 | const LLColor4& setVec(const LLColor3 &vec, F32 a); // deprecated -- use set() |
92 | const LLColor4& setVec(const F32 *vec); // Sets LLColor4 to vec | 92 | const LLColor4& setVec(const F32 *vec); // deprecated -- use set() |
93 | const LLColor4& setVec(const LLColor4U& color4u); // Sets LLColor4 to color4u, rescaled. | 93 | const LLColor4& setVec(const LLColor4U& color4u); // deprecated -- use set() |
94 | |||
95 | const LLColor4& set(F32 r, F32 g, F32 b, F32 a); // Sets LLColor4 to (r, g, b, a) | ||
96 | const LLColor4& set(F32 r, F32 g, F32 b); // Sets LLColor4 to (r, g, b) (no change in a) | ||
97 | const LLColor4& set(const LLColor4 &vec); // Sets LLColor4 to vec | ||
98 | const LLColor4& set(const LLColor3 &vec); // Sets LLColor4 to LLColor3 vec (no change in alpha) | ||
99 | const LLColor4& set(const LLColor3 &vec, F32 a); // Sets LLColor4 to LLColor3 vec, with alpha specified | ||
100 | const LLColor4& set(const F32 *vec); // Sets LLColor4 to vec | ||
101 | const LLColor4& set(const LLColor4U& color4u); // Sets LLColor4 to color4u, rescaled. | ||
94 | 102 | ||
95 | 103 | ||
96 | const LLColor4& setAlpha(F32 a); | 104 | const LLColor4& setAlpha(F32 a); |
97 | 105 | ||
98 | F32 magVec() const; // Returns magnitude of LLColor4 | 106 | F32 magVec() const; // deprecated -- use length() |
99 | F32 magVecSquared() const; // Returns magnitude squared of LLColor4 | 107 | F32 magVecSquared() const; // deprecated -- use lengthSquared() |
100 | F32 normVec(); // Normalizes and returns the magnitude of LLColor4 | 108 | F32 normVec(); // deprecated -- use normalize() |
109 | |||
110 | F32 length() const; // Returns magnitude of LLColor4 | ||
111 | F32 lengthSquared() const; // Returns magnitude squared of LLColor4 | ||
112 | F32 normalize(); // deprecated -- use normalize() | ||
113 | |||
101 | BOOL isOpaque() { return mV[VALPHA] == 1.f; } | 114 | BOOL isOpaque() { return mV[VALPHA] == 1.f; } |
102 | 115 | ||
103 | F32 operator[](int idx) const { return mV[idx]; } | 116 | F32 operator[](int idx) const { return mV[idx]; } |
@@ -289,6 +302,47 @@ inline const LLColor4& LLColor4::setToWhite(void) | |||
289 | return (*this); | 302 | return (*this); |
290 | } | 303 | } |
291 | 304 | ||
305 | inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z) | ||
306 | { | ||
307 | mV[VX] = x; | ||
308 | mV[VY] = y; | ||
309 | mV[VZ] = z; | ||
310 | |||
311 | // no change to alpha! | ||
312 | // mV[VW] = 1.f; | ||
313 | |||
314 | return (*this); | ||
315 | } | ||
316 | |||
317 | inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z, F32 a) | ||
318 | { | ||
319 | mV[VX] = x; | ||
320 | mV[VY] = y; | ||
321 | mV[VZ] = z; | ||
322 | mV[VW] = a; | ||
323 | return (*this); | ||
324 | } | ||
325 | |||
326 | inline const LLColor4& LLColor4::set(const LLColor4 &vec) | ||
327 | { | ||
328 | mV[VX] = vec.mV[VX]; | ||
329 | mV[VY] = vec.mV[VY]; | ||
330 | mV[VZ] = vec.mV[VZ]; | ||
331 | mV[VW] = vec.mV[VW]; | ||
332 | return (*this); | ||
333 | } | ||
334 | |||
335 | |||
336 | inline const LLColor4& LLColor4::set(const F32 *vec) | ||
337 | { | ||
338 | mV[VX] = vec[VX]; | ||
339 | mV[VY] = vec[VY]; | ||
340 | mV[VZ] = vec[VZ]; | ||
341 | mV[VW] = vec[VW]; | ||
342 | return (*this); | ||
343 | } | ||
344 | |||
345 | // deprecated | ||
292 | inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z) | 346 | inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z) |
293 | { | 347 | { |
294 | mV[VX] = x; | 348 | mV[VX] = x; |
@@ -301,6 +355,7 @@ inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z) | |||
301 | return (*this); | 355 | return (*this); |
302 | } | 356 | } |
303 | 357 | ||
358 | // deprecated | ||
304 | inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z, F32 a) | 359 | inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z, F32 a) |
305 | { | 360 | { |
306 | mV[VX] = x; | 361 | mV[VX] = x; |
@@ -310,6 +365,7 @@ inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z, F32 a) | |||
310 | return (*this); | 365 | return (*this); |
311 | } | 366 | } |
312 | 367 | ||
368 | // deprecated | ||
313 | inline const LLColor4& LLColor4::setVec(const LLColor4 &vec) | 369 | inline const LLColor4& LLColor4::setVec(const LLColor4 &vec) |
314 | { | 370 | { |
315 | mV[VX] = vec.mV[VX]; | 371 | mV[VX] = vec.mV[VX]; |
@@ -320,6 +376,7 @@ inline const LLColor4& LLColor4::setVec(const LLColor4 &vec) | |||
320 | } | 376 | } |
321 | 377 | ||
322 | 378 | ||
379 | // deprecated | ||
323 | inline const LLColor4& LLColor4::setVec(const F32 *vec) | 380 | inline const LLColor4& LLColor4::setVec(const F32 *vec) |
324 | { | 381 | { |
325 | mV[VX] = vec[VX]; | 382 | mV[VX] = vec[VX]; |
@@ -337,16 +394,44 @@ inline const LLColor4& LLColor4::setAlpha(F32 a) | |||
337 | 394 | ||
338 | // LLColor4 Magnitude and Normalization Functions | 395 | // LLColor4 Magnitude and Normalization Functions |
339 | 396 | ||
397 | inline F32 LLColor4::length(void) const | ||
398 | { | ||
399 | return fsqrtf(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); | ||
400 | } | ||
401 | |||
402 | inline F32 LLColor4::lengthSquared(void) const | ||
403 | { | ||
404 | return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]; | ||
405 | } | ||
406 | |||
407 | inline F32 LLColor4::normalize(void) | ||
408 | { | ||
409 | F32 mag = fsqrtf(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); | ||
410 | F32 oomag; | ||
411 | |||
412 | if (mag) | ||
413 | { | ||
414 | oomag = 1.f/mag; | ||
415 | mV[VX] *= oomag; | ||
416 | mV[VY] *= oomag; | ||
417 | mV[VZ] *= oomag; | ||
418 | } | ||
419 | return (mag); | ||
420 | } | ||
421 | |||
422 | // deprecated | ||
340 | inline F32 LLColor4::magVec(void) const | 423 | inline F32 LLColor4::magVec(void) const |
341 | { | 424 | { |
342 | return fsqrtf(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); | 425 | return fsqrtf(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); |
343 | } | 426 | } |
344 | 427 | ||
428 | // deprecated | ||
345 | inline F32 LLColor4::magVecSquared(void) const | 429 | inline F32 LLColor4::magVecSquared(void) const |
346 | { | 430 | { |
347 | return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]; | 431 | return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]; |
348 | } | 432 | } |
349 | 433 | ||
434 | // deprecated | ||
350 | inline F32 LLColor4::normVec(void) | 435 | inline F32 LLColor4::normVec(void) |
351 | { | 436 | { |
352 | F32 mag = fsqrtf(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); | 437 | F32 mag = fsqrtf(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]); |
@@ -497,13 +582,13 @@ inline const LLColor4& operator%=(LLColor4 &a, F32 k) | |||
497 | inline F32 distVec(const LLColor4 &a, const LLColor4 &b) | 582 | inline F32 distVec(const LLColor4 &a, const LLColor4 &b) |
498 | { | 583 | { |
499 | LLColor4 vec = a - b; | 584 | LLColor4 vec = a - b; |
500 | return (vec.magVec()); | 585 | return (vec.length()); |
501 | } | 586 | } |
502 | 587 | ||
503 | inline F32 distVec_squared(const LLColor4 &a, const LLColor4 &b) | 588 | inline F32 distVec_squared(const LLColor4 &a, const LLColor4 &b) |
504 | { | 589 | { |
505 | LLColor4 vec = a - b; | 590 | LLColor4 vec = a - b; |
506 | return (vec.magVecSquared()); | 591 | return (vec.lengthSquared()); |
507 | } | 592 | } |
508 | 593 | ||
509 | inline LLColor4 lerp(const LLColor4 &a, const LLColor4 &b, F32 u) | 594 | inline LLColor4 lerp(const LLColor4 &a, const LLColor4 &b, F32 u) |
diff --git a/linden/indra/llmath/v4coloru.cpp b/linden/indra/llmath/v4coloru.cpp index 7ad7eb2..b127a53 100644 --- a/linden/indra/llmath/v4coloru.cpp +++ b/linden/indra/llmath/v4coloru.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | 7 | * Copyright (c) 2001-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
@@ -120,6 +120,6 @@ BOOL LLColor4U::parseColor4U(const std::string& buf, LLColor4U* value) | |||
120 | } | 120 | } |
121 | } | 121 | } |
122 | 122 | ||
123 | value->setVec( U8(v[0]), U8(v[1]), U8(v[2]), U8(v[3]) ); | 123 | value->set( U8(v[0]), U8(v[1]), U8(v[2]), U8(v[3]) ); |
124 | return TRUE; | 124 | return TRUE; |
125 | } | 125 | } |
diff --git a/linden/indra/llmath/v4coloru.h b/linden/indra/llmath/v4coloru.h index 910a081..f3f1c57 100644 --- a/linden/indra/llmath/v4coloru.h +++ b/linden/indra/llmath/v4coloru.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | 7 | * Copyright (c) 2001-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
@@ -97,15 +97,23 @@ public: | |||
97 | const LLColor4U& setToBlack(); // zero LLColor4U to (0, 0, 0, 1) | 97 | const LLColor4U& setToBlack(); // zero LLColor4U to (0, 0, 0, 1) |
98 | const LLColor4U& setToWhite(); // zero LLColor4U to (0, 0, 0, 1) | 98 | const LLColor4U& setToWhite(); // zero LLColor4U to (0, 0, 0, 1) |
99 | 99 | ||
100 | const LLColor4U& setVec(U8 r, U8 g, U8 b, U8 a); // Sets LLColor4U to (r, g, b, a) | 100 | const LLColor4U& set(U8 r, U8 g, U8 b, U8 a);// Sets LLColor4U to (r, g, b, a) |
101 | const LLColor4U& setVec(U8 r, U8 g, U8 b); // Sets LLColor4U to (r, g, b) (no change in a) | 101 | const LLColor4U& set(U8 r, U8 g, U8 b); // Sets LLColor4U to (r, g, b) (no change in a) |
102 | const LLColor4U& setVec(const LLColor4U &vec); // Sets LLColor4U to vec | 102 | const LLColor4U& set(const LLColor4U &vec); // Sets LLColor4U to vec |
103 | const LLColor4U& setVec(const U8 *vec); // Sets LLColor4U to vec | 103 | const LLColor4U& set(const U8 *vec); // Sets LLColor4U to vec |
104 | |||
105 | const LLColor4U& setVec(U8 r, U8 g, U8 b, U8 a); // deprecated -- use set() | ||
106 | const LLColor4U& setVec(U8 r, U8 g, U8 b); // deprecated -- use set() | ||
107 | const LLColor4U& setVec(const LLColor4U &vec); // deprecated -- use set() | ||
108 | const LLColor4U& setVec(const U8 *vec); // deprecated -- use set() | ||
104 | 109 | ||
105 | const LLColor4U& setAlpha(U8 a); | 110 | const LLColor4U& setAlpha(U8 a); |
106 | 111 | ||
107 | F32 magVec() const; // Returns magnitude of LLColor4U | 112 | F32 magVec() const; // deprecated -- use length() |
108 | F32 magVecSquared() const; // Returns magnitude squared of LLColor4U | 113 | F32 magVecSquared() const; // deprecated -- use lengthSquared() |
114 | |||
115 | F32 length() const; // Returns magnitude squared of LLColor4U | ||
116 | F32 lengthSquared() const; // Returns magnitude squared of LLColor4U | ||
109 | 117 | ||
110 | friend std::ostream& operator<<(std::ostream& s, const LLColor4U &a); // Print a | 118 | friend std::ostream& operator<<(std::ostream& s, const LLColor4U &a); // Print a |
111 | friend LLColor4U operator+(const LLColor4U &a, const LLColor4U &b); // Return vector a + b | 119 | friend LLColor4U operator+(const LLColor4U &a, const LLColor4U &b); // Return vector a + b |
@@ -199,7 +207,7 @@ inline const LLColor4U& LLColor4U::setToWhite(void) | |||
199 | return (*this); | 207 | return (*this); |
200 | } | 208 | } |
201 | 209 | ||
202 | inline const LLColor4U& LLColor4U::setVec(const U8 x, const U8 y, const U8 z) | 210 | inline const LLColor4U& LLColor4U::set(const U8 x, const U8 y, const U8 z) |
203 | { | 211 | { |
204 | mV[VX] = x; | 212 | mV[VX] = x; |
205 | mV[VY] = y; | 213 | mV[VY] = y; |
@@ -211,7 +219,7 @@ inline const LLColor4U& LLColor4U::setVec(const U8 x, const U8 y, const U8 z) | |||
211 | return (*this); | 219 | return (*this); |
212 | } | 220 | } |
213 | 221 | ||
214 | inline const LLColor4U& LLColor4U::setVec(const U8 r, const U8 g, const U8 b, U8 a) | 222 | inline const LLColor4U& LLColor4U::set(const U8 r, const U8 g, const U8 b, U8 a) |
215 | { | 223 | { |
216 | mV[0] = r; | 224 | mV[0] = r; |
217 | mV[1] = g; | 225 | mV[1] = g; |
@@ -220,7 +228,7 @@ inline const LLColor4U& LLColor4U::setVec(const U8 r, const U8 g, const U8 b, U8 | |||
220 | return (*this); | 228 | return (*this); |
221 | } | 229 | } |
222 | 230 | ||
223 | inline const LLColor4U& LLColor4U::setVec(const LLColor4U &vec) | 231 | inline const LLColor4U& LLColor4U::set(const LLColor4U &vec) |
224 | { | 232 | { |
225 | mV[VX] = vec.mV[VX]; | 233 | mV[VX] = vec.mV[VX]; |
226 | mV[VY] = vec.mV[VY]; | 234 | mV[VY] = vec.mV[VY]; |
@@ -229,17 +237,49 @@ inline const LLColor4U& LLColor4U::setVec(const LLColor4U &vec) | |||
229 | return (*this); | 237 | return (*this); |
230 | } | 238 | } |
231 | 239 | ||
232 | /* | 240 | inline const LLColor4U& LLColor4U::set(const U8 *vec) |
233 | inline const LLColor4U& LLColor4U::setVec(const LLColor4 &vec) | ||
234 | { | 241 | { |
235 | mV[VX] = (U8) (llmin(1.f, vec.mV[VX]) * 255.f); | 242 | mV[VX] = vec[VX]; |
236 | mV[VY] = (U8) (llmin(1.f, vec.mV[VY]) * 255.f); | 243 | mV[VY] = vec[VY]; |
237 | mV[VZ] = (U8) (llmin(1.f, vec.mV[VZ]) * 255.f); | 244 | mV[VZ] = vec[VZ]; |
238 | mV[VW] = (U8) (llmin(1.f, vec.mV[VW]) * 255.f); | 245 | mV[VW] = vec[VW]; |
239 | return (*this); | 246 | return (*this); |
240 | } | 247 | } |
241 | */ | ||
242 | 248 | ||
249 | // deprecated | ||
250 | inline const LLColor4U& LLColor4U::setVec(const U8 x, const U8 y, const U8 z) | ||
251 | { | ||
252 | mV[VX] = x; | ||
253 | mV[VY] = y; | ||
254 | mV[VZ] = z; | ||
255 | |||
256 | // no change to alpha! | ||
257 | // mV[VW] = 255; | ||
258 | |||
259 | return (*this); | ||
260 | } | ||
261 | |||
262 | // deprecated | ||
263 | inline const LLColor4U& LLColor4U::setVec(const U8 r, const U8 g, const U8 b, U8 a) | ||
264 | { | ||
265 | mV[0] = r; | ||
266 | mV[1] = g; | ||
267 | mV[2] = b; | ||
268 | mV[3] = a; | ||
269 | return (*this); | ||
270 | } | ||
271 | |||
272 | // deprecated | ||
273 | inline const LLColor4U& LLColor4U::setVec(const LLColor4U &vec) | ||
274 | { | ||
275 | mV[VX] = vec.mV[VX]; | ||
276 | mV[VY] = vec.mV[VY]; | ||
277 | mV[VZ] = vec.mV[VZ]; | ||
278 | mV[VW] = vec.mV[VW]; | ||
279 | return (*this); | ||
280 | } | ||
281 | |||
282 | // deprecated | ||
243 | inline const LLColor4U& LLColor4U::setVec(const U8 *vec) | 283 | inline const LLColor4U& LLColor4U::setVec(const U8 *vec) |
244 | { | 284 | { |
245 | mV[VX] = vec[VX]; | 285 | mV[VX] = vec[VX]; |
@@ -256,13 +296,24 @@ inline const LLColor4U& LLColor4U::setAlpha(U8 a) | |||
256 | } | 296 | } |
257 | 297 | ||
258 | // LLColor4U Magnitude and Normalization Functions | 298 | // LLColor4U Magnitude and Normalization Functions |
259 | // bookmark | ||
260 | 299 | ||
300 | inline F32 LLColor4U::length(void) const | ||
301 | { | ||
302 | return fsqrtf( ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ] ); | ||
303 | } | ||
304 | |||
305 | inline F32 LLColor4U::lengthSquared(void) const | ||
306 | { | ||
307 | return ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ]; | ||
308 | } | ||
309 | |||
310 | // deprecated | ||
261 | inline F32 LLColor4U::magVec(void) const | 311 | inline F32 LLColor4U::magVec(void) const |
262 | { | 312 | { |
263 | return fsqrtf( ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ] ); | 313 | return fsqrtf( ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ] ); |
264 | } | 314 | } |
265 | 315 | ||
316 | // deprecated | ||
266 | inline F32 LLColor4U::magVecSquared(void) const | 317 | inline F32 LLColor4U::magVecSquared(void) const |
267 | { | 318 | { |
268 | return ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ]; | 319 | return ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ]; |
@@ -407,13 +458,13 @@ inline const LLColor4U& operator%=(LLColor4U &a, U8 k) | |||
407 | inline F32 distVec(const LLColor4U &a, const LLColor4U &b) | 458 | inline F32 distVec(const LLColor4U &a, const LLColor4U &b) |
408 | { | 459 | { |
409 | LLColor4U vec = a - b; | 460 | LLColor4U vec = a - b; |
410 | return (vec.magVec()); | 461 | return (vec.length()); |
411 | } | 462 | } |
412 | 463 | ||
413 | inline F32 distVec_squared(const LLColor4U &a, const LLColor4U &b) | 464 | inline F32 distVec_squared(const LLColor4U &a, const LLColor4U &b) |
414 | { | 465 | { |
415 | LLColor4U vec = a - b; | 466 | LLColor4U vec = a - b; |
416 | return (vec.magVecSquared()); | 467 | return (vec.lengthSquared()); |
417 | } | 468 | } |
418 | 469 | ||
419 | void LLColor4U::setVecScaleClamp(const LLColor4& color) | 470 | void LLColor4U::setVecScaleClamp(const LLColor4& color) |
diff --git a/linden/indra/llmath/v4math.cpp b/linden/indra/llmath/v4math.cpp index 34b8f07..a183c78 100644 --- a/linden/indra/llmath/v4math.cpp +++ b/linden/indra/llmath/v4math.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/v4math.h b/linden/indra/llmath/v4math.h index 4ef2d32..6234b17 100644 --- a/linden/indra/llmath/v4math.h +++ b/linden/indra/llmath/v4math.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2000&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2008, Linden Research, Inc. | 7 | * Copyright (c) 2000-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * 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 |
diff --git a/linden/indra/llmath/xform.cpp b/linden/indra/llmath/xform.cpp index d8d7991..9917880 100644 --- a/linden/indra/llmath/xform.cpp +++ b/linden/indra/llmath/xform.cpp | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
5 | * | 5 | * |
6 | * Copyright (c) 2001-2008, Linden Research, Inc. | 6 | * Copyright (c) 2001-2009, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
diff --git a/linden/indra/llmath/xform.h b/linden/indra/llmath/xform.h index ad2a944..6f880cb 100644 --- a/linden/indra/llmath/xform.h +++ b/linden/indra/llmath/xform.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 4 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
5 | * | 5 | * |
6 | * Copyright (c) 2001-2008, Linden Research, Inc. | 6 | * Copyright (c) 2001-2009, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |