aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon/llsmoothstep.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/llcommon/llsmoothstep.h
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to '')
-rw-r--r--linden/indra/llcommon/llsmoothstep.h (renamed from linden/indra/newview/llsphere.h)40
1 files changed, 16 insertions, 24 deletions
diff --git a/linden/indra/newview/llsphere.h b/linden/indra/llcommon/llsmoothstep.h
index 3a827c9..c2b3447 100644
--- a/linden/indra/newview/llsphere.h
+++ b/linden/indra/llcommon/llsmoothstep.h
@@ -1,6 +1,6 @@
1/** 1/**
2 * @file llsphere.h 2 * @file llsmoothstep.h
3 * @brief interface for the LLSphere class. 3 * @brief Smoothstep - transition from 0 to 1 - function, first and second derivatives all continuous (smooth)
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$ 5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 * 6 *
@@ -29,30 +29,22 @@
29 * $/LicenseInfo$ 29 * $/LicenseInfo$
30 */ 30 */
31 31
32#ifndef LL_LLSPHERE_H 32#ifndef LL_LLSMOOTHSTEP_H
33#define LL_LLSPHERE_H 33#define LL_LLSMOOTHSTEP_H
34 34
35//#include "vmath.h" 35template <class LLDATATYPE>
36#include "llmath.h" 36inline LLDATATYPE llsmoothstep(const LLDATATYPE& edge0, const LLDATATYPE& edge1, const LLDATATYPE& value)
37#include "v3math.h" 37{
38#include "v4math.h" 38 if (value < edge0)
39#include "m3math.h" 39 return (LLDATATYPE)0;
40#include "m4math.h"
41#include "v4color.h"
42#include "llgl.h"
43 40
44void lat2xyz(LLVector3 * result, F32 lat, F32 lon); // utility routine 41 if (value >= edge1)
42 return (LLDATATYPE)1;
45 43
46class LLSphere 44 // Scale/bias into [0..1] range
47{ 45 LLDATATYPE scaled_value = (value - edge0) / (edge1 - edge0);
48public:
49 LLGLuint mDList[5];
50 46
51 void prerender(); 47 return scaled_value * scaled_value * (3 - 2 * scaled_value);
52 void cleanupGL(); 48}
53 void render(F32 pixel_area); // of a box of size 1.0 at that position
54 void render(); // render at highest LOD
55};
56 49
57extern LLSphere gSphere; 50#endif // LL_LLSMOOTHSTEP_H
58#endif