Frustum.h
Upload User: cxh8989
Upload Date: 2021-01-22
Package Size: 2544k
Code Size: 1k
Category:

Shot Game

Development Platform:

Visual C++

  1. #ifndef _FRUSTUM_H
  2. #define _FRUSTUM_H
  3. #include "main.h"
  4. /** 平锥体类 */
  5. class CFrustum {
  6. public:
  7. void CalculateFrustum();
  8. /** 判断一点是否在平头体内 */
  9. bool PointInFrustum(float x, float y, float z);
  10. bool SphereInFrustum(float x, float y, float z, float radius);
  11. bool CubeInFrustum(float x, float y, float z, float size);
  12. bool BoxInFrustum(float x, float y, float z, float sizeX, float sizeY, float sizeZ);
  13. private:
  14.      /** 组成平头体的六个平面方程系数 */
  15. float m_Frustum[6][4];
  16. };
  17. class CDebug 
  18. {
  19. public:
  20. void AddDebugLine(CVector3 vPoint1, CVector3 vPoint2);
  21. void AddDebugBox(CVector3 vCenter, float width, float height, float depth);
  22. void RenderDebugLines();
  23. void Clear();
  24. private:
  25. vector<CVector3> m_vLines;
  26. };
  27. #endif