Frustum.h 715 B

1234567891011121314151617181920212223
  1. #ifndef CORE_FRUSTUM_H
  2. #define CORE_FRUSTUM_H
  3. #include "core/Matrix.h"
  4. #include "core/Plane.h"
  5. typedef struct {
  6. Matrix projection;
  7. Plane planes[6];
  8. float tan;
  9. float nearClip;
  10. float farClip;
  11. } Frustum;
  12. void initFrustum(Frustum* f, float fieldOfView, float nearClip, float farClip);
  13. const Matrix* updateProjection(Frustum* f, const IntVector2* size);
  14. void updateFrustumPlanes(Frustum* f, const Vector3* pos, const Vector3* right,
  15. const Vector3* up, const Vector3* front,
  16. const IntVector2* size);
  17. bool isInsideFrustum(const Frustum* f, const Vector3* pos);
  18. bool isInsideFrustumRadius(const Frustum* f, const Vector3* pos, float radius);
  19. #endif