]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Plane.hh
miscellaneous cleanup
[chaz/yoink] / src / Moof / Plane.hh
index 248a3128161afe0cadbdde10fa781d6b3e89c405..4739bb825406d5599d853ea0e39671d387e8041e 100644 (file)
@@ -39,6 +39,11 @@ class Aabb;
 class Sphere;
 
 
+/*
+ * A plane in 3-space defined by the equation Ax + By + Cz = D, where [A, B, C]
+ * is normal to the plane.
+ */
+
 struct Plane
 {
        Vector3 normal;
@@ -60,6 +65,8 @@ struct Plane
                d(scalar) {}
 
 
+       /* Causes the normal of the plane to become normalized.  The scalar may also
+        * be changed to keep the equation true. */
        void normalize()
        {
                Scalar mag = normal.length();
@@ -68,12 +75,15 @@ struct Plane
                d /= mag;
        }
 
+       /**
+        * Determine the shortest distance between a point and the plane. */
+
        inline Scalar getDistanceToPoint(const Vector3& point) const
        {
                return cml::dot(point, normal) + d;
        }
 
-       inline Halfspace intersectsPoint(const Vector3& point) const
+       inline Halfspace intersects(const Vector3& point) const
        {
                Scalar distance = getDistanceToPoint(point);
 
@@ -82,8 +92,8 @@ struct Plane
                else                        return POSITIVE;
        }
 
-       Halfspace intersectsAabb(const Aabb& aabb) const;
-       Halfspace intersectsSphere(const Sphere& sphere) const;
+       Halfspace intersects(const Aabb& aabb) const;
+       Halfspace intersects(const Sphere& sphere) const;
 };
 
 
This page took 0.019139 seconds and 4 git commands to generate.