]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Sphere.hh
beginning CD implementation
[chaz/yoink] / src / Moof / Sphere.hh
index b20ca741748f076e648328593ffd8484be57367a..d6903564eac5309c59f6f793eef60e8ea0c0844b 100644 (file)
@@ -38,7 +38,7 @@ namespace Mf {
 
 
 /**
- * Axis-aligned Bounding Box
+ * A round object.
  */
 
 struct Sphere : public Cullable, public Drawable
@@ -56,16 +56,22 @@ struct Sphere : public Cullable, public Drawable
                point(x, y, z),
                radius(r) {}
 
-       inline void init(const Vector3& p, Scalar r)
+       void init(const Vector3& p, Scalar r)
        {
                point = p;
                radius = r;
        }
 
+       void init(const Vector3& p, const Vector3& o)
+       {
+               point = p;
+               radius = (o - p).length();
+       }
+
        void encloseVertices(const Vector3 vertices[], unsigned count);
 
        void draw(Scalar alpha = 0.0) const;
-       bool isVisible(const Camera& cam) const;
+       bool isVisible(const Frustum& frustum) const;
 };
 
 
This page took 0.016945 seconds and 4 git commands to generate.