Plane.h 939 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // This code is in the public domain -- Ignacio Castańo <castano@gmail.com>
  2. #pragma once
  3. #ifndef NV_MATH_PLANE_H
  4. #define NV_MATH_PLANE_H
  5. #include "nvmath.h"
  6. #include "Vector.h"
  7. namespace nv
  8. {
  9. class Matrix;
  10. class NVMATH_CLASS Plane
  11. {
  12. public:
  13. Plane();
  14. Plane(float x, float y, float z, float w);
  15. Plane(const Vector4 & v);
  16. Plane(const Vector3 & v, float d);
  17. Plane(const Vector3 & normal, const Vector3 & point);
  18. Plane(const Vector3 & v0, const Vector3 & v1, const Vector3 & v2);
  19. const Plane & operator=(const Plane & v);
  20. Vector3 vector() const;
  21. float offset() const;
  22. Vector3 normal() const;
  23. void operator*=(float s);
  24. Vector4 v;
  25. };
  26. Plane transformPlane(const Matrix &, const Plane &);
  27. Vector3 planeIntersection(const Plane & a, const Plane & b, const Plane & c);
  28. } // nv namespace
  29. #endif // NV_MATH_PLANE_H