Frustum.pkg 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. $#include "Math/Frustum.h"
  2. enum FrustumPlane
  3. {
  4. PLANE_NEAR = 0,
  5. PLANE_LEFT,
  6. PLANE_RIGHT,
  7. PLANE_UP,
  8. PLANE_DOWN,
  9. PLANE_FAR,
  10. };
  11. static const unsigned NUM_FRUSTUM_PLANES;
  12. static const unsigned NUM_FRUSTUM_VERTICES;
  13. class Frustum
  14. {
  15. Frustum();
  16. Frustum(const Frustum& frustum);
  17. ~Frustum();
  18. void Define(float fov, float aspectRatio, float zoom, float nearZ, float farZ, const Matrix3x4& transform = Matrix3x4::IDENTITY);
  19. void Define(const Vector3& near, const Vector3& far, const Matrix3x4& transform = Matrix3x4::IDENTITY);
  20. void Define(const BoundingBox& box, const Matrix3x4& transform = Matrix3x4::IDENTITY);
  21. void Define(const Matrix4& projection);
  22. void DefineOrtho(float orthoSize, float aspectRatio, float zoom, float nearZ, float farZ, const Matrix3x4& transform = Matrix3x4::IDENTITY);
  23. void DefineSplit(const Matrix4& projection, float near, float far);
  24. void Transform(const Matrix3& transform);
  25. void Transform(const Matrix3x4& transform);
  26. Intersection IsInside(const Vector3& point) const;
  27. Intersection IsInside(const Sphere& sphere) const;
  28. Intersection IsInsideFast(const Sphere& sphere) const;
  29. Intersection IsInside(const BoundingBox& box) const;
  30. Intersection IsInsideFast(const BoundingBox& box) const;
  31. float Distance(const Vector3& point) const;
  32. Frustum Transformed(const Matrix3& transform) const;
  33. Frustum Transformed(const Matrix3x4& transform) const;
  34. Rect Projected(const Matrix4& transform) const;
  35. void UpdatePlanes();
  36. };