aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmath/llcamera.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/llmath/llcamera.h
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to '')
-rw-r--r--linden/indra/llmath/llcamera.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/linden/indra/llmath/llcamera.h b/linden/indra/llmath/llcamera.h
index 0e20798..7066b9f 100644
--- a/linden/indra/llmath/llcamera.h
+++ b/linden/indra/llmath/llcamera.h
@@ -46,7 +46,7 @@ const F32 MAX_FIELD_OF_VIEW = F_PI;
46const F32 MAX_ASPECT_RATIO = 50.0f; 46const F32 MAX_ASPECT_RATIO = 50.0f;
47const F32 MAX_NEAR_PLANE = 10.f; 47const F32 MAX_NEAR_PLANE = 10.f;
48const F32 MAX_FAR_PLANE = 100000.0f; //1000000.0f; // Max allowed. Not good Z precision though. 48const F32 MAX_FAR_PLANE = 100000.0f; //1000000.0f; // Max allowed. Not good Z precision though.
49const F32 MAX_FAR_CLIP = 1024.0f; 49const F32 MAX_FAR_CLIP = 512.0f;
50 50
51const F32 MIN_FIELD_OF_VIEW = 0.1f; 51const F32 MIN_FIELD_OF_VIEW = 0.1f;
52const F32 MIN_ASPECT_RATIO = 0.02f; 52const F32 MIN_ASPECT_RATIO = 0.02f;
@@ -114,16 +114,28 @@ protected:
114 114
115 LLPlane mWorldPlanes[PLANE_NUM]; 115 LLPlane mWorldPlanes[PLANE_NUM];
116 LLPlane mHorizPlanes[HORIZ_PLANE_NUM]; 116 LLPlane mHorizPlanes[HORIZ_PLANE_NUM];
117 LLPlane mAgentPlanes[6]; //frustum in agent space a la gluUnproject (I'm a bastard, I know) - DaveP 117
118 U8 mAgentPlaneMask[6]; 118 typedef struct
119 {
120 LLPlane p;
121 U8 mask;
122 } frustum_plane;
123 frustum_plane mAgentPlanes[7]; //frustum planes in agent space a la gluUnproject (I'm a bastard, I know) - DaveP
124
125 U32 mPlaneCount; //defaults to 6, if setUserClipPlane is called, uses user supplied clip plane in
126
119 LLVector3 mWorldPlanePos; // Position of World Planes (may be offset from camera) 127 LLVector3 mWorldPlanePos; // Position of World Planes (may be offset from camera)
120public: 128public:
121 LLVector3 mAgentFrustum[8]; 129 LLVector3 mAgentFrustum[8]; //8 corners of 6-plane frustum
130 F32 mFrustumCornerDist; //distance to corner of frustum against far clip plane
122 131
123public: 132public:
124 LLCamera(); 133 LLCamera();
125 LLCamera(F32 z_field_of_view, F32 aspect_ratio, S32 view_height_in_pixels, F32 near_plane, F32 far_plane); 134 LLCamera(F32 z_field_of_view, F32 aspect_ratio, S32 view_height_in_pixels, F32 near_plane, F32 far_plane);
126 135
136 void setUserClipPlane(LLPlane plane);
137 void disableUserClipPlane();
138 U8 calcPlaneMask(const LLPlane& plane);
127 void setView(F32 new_view); 139 void setView(F32 new_view);
128 void setViewHeightInPixels(S32 height); 140 void setViewHeightInPixels(S32 height);
129 void setAspect(F32 new_aspect); 141 void setAspect(F32 new_aspect);
@@ -164,6 +176,8 @@ public:
164 S32 pointInFrustum(const LLVector3 &point) const { return sphereInFrustum(point, 0.0f); } 176 S32 pointInFrustum(const LLVector3 &point) const { return sphereInFrustum(point, 0.0f); }
165 S32 sphereInFrustumFull(const LLVector3 &center, const F32 radius) const { return sphereInFrustum(center, radius); } 177 S32 sphereInFrustumFull(const LLVector3 &center, const F32 radius) const { return sphereInFrustum(center, radius); }
166 S32 AABBInFrustum(const LLVector3 &center, const LLVector3& radius); 178 S32 AABBInFrustum(const LLVector3 &center, const LLVector3& radius);
179 S32 AABBInFrustumNoFarClip(const LLVector3 &center, const LLVector3& radius);
180
167 //does a quick 'n dirty sphere-sphere check 181 //does a quick 'n dirty sphere-sphere check
168 S32 sphereInFrustumQuick(const LLVector3 &sphere_center, const F32 radius); 182 S32 sphereInFrustumQuick(const LLVector3 &sphere_center, const F32 radius);
169 183