⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frustum.h

📁 3D游戏引擎 Programming Role-Playing Games with DirectX, 2nd Edition by Jim Adams
💻 H
字号:
#ifndef _FRUSTUM_H_
#define _FRUSTUM_H_

class cFrustum
{
  private:
    D3DXPLANE m_Planes[6]; // The frustum planes

  public:
    // Construct the six planes from current view and
    // projection. Can override the default depth value.
    BOOL Construct(cGraphics *Graphics, float ZDistance = 0.0f);

    // The following functions check a single point, cube,
    // rectangle, and sphere if contained in the frustum.
    // A return value of TRUE means visible, FALSE not visible.
    // When checking cubes or rectangles, you can
    // supply a BOOL variable that determines if all the
    // points are in the frustum.
    BOOL CheckPoint(float XPos, float YPos, float ZPos);

    BOOL CheckCube(float XCenter, float YCenter,               \
                   float ZCenter, float Size,                  \
                   BOOL *CompletelyContained = NULL);
    
    BOOL CheckRectangle(float XCenter, float YCenter,          \
                        float ZCenter, float XSize,            \
                        float YSize, float ZSize,              \
                        BOOL *CompletelyContained = NULL);
    
    BOOL CheckSphere(float XCenter, float YCenter,             \
                     float ZCenter, float Radius);
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -