]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Frustum.hh
port to NetBSD
[chaz/yoink] / src / Moof / Frustum.hh
index ac2b353e263409f1be648a60854f249fc263ff9b..c708c065bd79209cfcf0a17fa51e533cceb43de8 100644 (file)
@@ -29,6 +29,7 @@
 #ifndef _MOOF_FRUSTUM_HH_
 #define _MOOF_FRUSTUM_HH_
        
+#include <Moof/Math.hh>
 #include <Moof/Plane.hh>
 
 
@@ -36,11 +37,11 @@ namespace Mf {
 
 
 class Aabb;
+class Sphere;
 
 class Frustum
 {
-       //Matrix4 projection;
-       Plane left, right, bottom, top, near, far;
+       Plane   mPlanes[6]; // left, right, bottom, top, near, far
 
 public:
        typedef enum
@@ -50,16 +51,23 @@ public:
                INTERSECT       = 2
        } Collision;
 
-       //Frustum() {}
-       //Frustum(Scalar l, Scalar r, Scalar b, Scalar t, Scalar n, Scalar f);
-       //Frustum(Scalar fovy, Scalar aspect, Scalar near, Scalar far);
-
-       inline Collision checkAabb(const Aabb& aabb) const
+       Frustum() {}
+       Frustum(const Matrix4& modelview, const Matrix4& projection)
+       {
+               init(modelview, projection);
+       }
+       Frustum(const Matrix4& modelview, Scalar fovy, Scalar aspect,
+                       Scalar abutting, Scalar distant)
        {
-               return INSIDE;
+               init(modelview, fovy, aspect, abutting, distant);
        }
+       
+       void init(const Matrix4& modelview, const Matrix4& projection);
+       void init(const Matrix4& modelview, Scalar fovy, Scalar aspect,
+                       Scalar abutting, Scalar distant);
 
-       //const Matrix4& getMatrix() const;
+       Collision contains(const Aabb& aabb) const;
+       Collision contains(const Sphere& sphere) const;
 };
 
 
This page took 0.018006 seconds and 4 git commands to generate.