Frustum.pkg 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. $#include "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 DefineOrtho(float orthoSize, float aspectRatio, float zoom, float nearZ, float farZ, const Matrix3x4& transform = Matrix3x4::IDENTITY);
  22. void Transform(const Matrix3& transform);
  23. void Transform(const Matrix3x4& transform);
  24. Intersection IsInside(const Vector3& point) const;
  25. Intersection IsInside(const Sphere& sphere) const;
  26. Intersection IsInsideFast(const Sphere& sphere) const;
  27. Intersection IsInside(const BoundingBox& box) const;
  28. Intersection IsInsideFast(const BoundingBox& box) const;
  29. float Distance(const Vector3& point) const;
  30. Frustum Transformed(const Matrix3& transform) const;
  31. Frustum Transformed(const Matrix3x4& transform) const;
  32. Rect Projected(const Matrix4& transform) const;
  33. void UpdatePlanes();
  34. };