plane.h 894 B

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