Plane.pkg 982 B

123456789101112131415161718192021222324252627282930313233343536
  1. $#include "Plane.h"
  2. /// Surface in three-dimensional space.
  3. class Plane
  4. {
  5. public:
  6. /// Construct undefined.
  7. Plane();
  8. /// Copy-construct from another plane.
  9. Plane(const Plane& plane);
  10. /// Construct from 3 vertices.
  11. Plane(const Vector3& v0, const Vector3& v1, const Vector3& v2);
  12. /// Construct from a normal vector and a point on the plane.
  13. Plane(const Vector3& normal, const Vector3& point);
  14. /// Define from 3 vertices.
  15. void Define(const Vector3& v0, const Vector3& v1, const Vector3& v2);
  16. /// Define from a normal and a point.
  17. void Define(const Vector3& normal, const Vector3& point);
  18. /// Return signed distance to a point.
  19. float Distance(const Vector3& point) const;
  20. /// Plane normal.
  21. Vector3 normal_ @ normal;
  22. /// Plane absolute normal.
  23. Vector3 absNormal_ @ absNormal;
  24. /// Plane intercept parameter.
  25. float intercept_ @ intercept;
  26. };