aboutsummaryrefslogtreecommitdiff
path: root/dep/g3dlite/include/G3D/Frustum.h
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2014-08-22 16:58:23 +0200
committerjackpoz <giacomopoz@gmail.com>2014-08-22 21:00:56 +0200
commit5e8277e923c5545a15bae7c740ab6afaa597a59f (patch)
tree4cf5212c080588a7e868ee60134fc7fff51e400a /dep/g3dlite/include/G3D/Frustum.h
parenta63aa858dcb400eafb97eed1f590e34c27d934a4 (diff)
Core/Dependencies: Update G3D to v9.0 r4036
Diffstat (limited to 'dep/g3dlite/include/G3D/Frustum.h')
-rw-r--r--dep/g3dlite/include/G3D/Frustum.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/dep/g3dlite/include/G3D/Frustum.h b/dep/g3dlite/include/G3D/Frustum.h
new file mode 100644
index 00000000000..6c2d2a41303
--- /dev/null
+++ b/dep/g3dlite/include/G3D/Frustum.h
@@ -0,0 +1,57 @@
+/**
+ \file G3D/Frustum.h
+
+ \maintainer Morgan McGuire, http://graphics.cs.williams.edu
+
+ \created 2005-07-20
+ \edited 2013-06-11
+*/
+
+#ifndef G3D_Frustum_h
+#define G3D_Frustum_h
+
+#include "G3D/platform.h"
+#include "G3D/g3dmath.h"
+#include "G3D/Plane.h"
+#include "G3D/SmallArray.h"
+#include "G3D/Vector4.h"
+
+namespace G3D {
+
+class Box;
+
+/** \see Projection */
+class Frustum {
+public:
+ class Face {
+ public:
+ /** Counter clockwise indices into vertexPos */
+ int vertexIndex[4];
+
+ /** The plane containing the face. */
+ Plane plane;
+ };
+
+ /** The vertices, in homogeneous space. The order is that of
+ the near face, starting from the (object space) +x,+y corner
+ and proceeding CCW from the camera's point of view; followed
+ by the far face also in CCW order.
+
+ If w == 0,
+ a vertex is at infinity. */
+ SmallArray<Vector4, 8> vertexPos;
+
+ /** The faces in the frustum. When the
+ far plane is at infinity, there are 5 faces,
+ otherwise there are 6. The faces are in the order
+ N,R,L,B,T,[F].
+ */
+ SmallArray<Face, 6> faceArray;
+
+ /** \param minObjectSpaceDepth Smallest value permitted for the near plane Z - far plane Z (e.g., to force finite bounds)*/
+ Box boundingBox(float minObjectSpaceDepth = finf()) const;
+};
+
+} // namespace G3D
+
+#endif