Polyhedron.pkg 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. $#include "Polyhedron.h"
  2. /// A convex volume built from polygon faces.
  3. class Polyhedron
  4. {
  5. public:
  6. /// Construct empty.
  7. Polyhedron();
  8. /// Copy-construct from another polyhedron.
  9. Polyhedron(const Polyhedron& polyhedron);
  10. /// Construct from a bounding box.
  11. Polyhedron(const BoundingBox& box);
  12. /// Construct from a frustum.
  13. Polyhedron(const Frustum& frustum);
  14. /// Destruct.
  15. ~Polyhedron();
  16. /// Define from a bounding box.
  17. void Define(const BoundingBox& box);
  18. /// Define from a frustum.
  19. void Define(const Frustum& frustum);
  20. /// Add a triangle face.
  21. void AddFace(const Vector3& v0, const Vector3& v1, const Vector3& v2);
  22. /// Add a quadrilateral face.
  23. void AddFace(const Vector3& v0, const Vector3& v1, const Vector3& v2, const Vector3& v3);
  24. /// Clip with a plane.
  25. void Clip(const Plane& plane);
  26. /// Clip with a bounding box.
  27. void Clip(const BoundingBox& box);
  28. /// Clip with a frustum.
  29. void Clip(const Frustum& box);
  30. /// Clear all faces.
  31. void Clear();
  32. /// Transform with a 3x3 matrix.
  33. void Transform(const Matrix3& transform);
  34. /// Transform with a 3x4 matrix.
  35. void Transform(const Matrix3x4& transform);
  36. /// Return transformed with a 3x3 matrix.
  37. Polyhedron Transformed(const Matrix3& transform) const;
  38. /// Return transformed with a 3x4 matrix.
  39. Polyhedron Transformed(const Matrix3x4& transform) const;
  40. /// Return whether is empty.
  41. bool Empty() const;
  42. };