亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? nodetree.h

?? 3D游戲引擎 Programming Role-Playing Games with DirectX, 2nd Edition by Jim Adams
?? H
字號:
#ifndef _NODETREE_H_
#define _NODETREE_H_

// Enumerate the two types of tree structures
enum TreeTypes { QUADTREE = 0, OCTREE };

class cNodeTreeMesh
{
  private:
    // The sVertex structure is a custom vertex structure that
    // contains only the 3-D coordinates. This is used to
    // retrieve coordinate info from a mesh's vertex buffer.
    typedef struct sVertex { float x, y, z; } sVertex;

    // The polygon structure maintains a material group (by #)
    // the time it was last drawn (so you don't redraw it
    // many times over per frame), and the three vertices
    // used to render the polygon (which you'll read on later).
    typedef struct sPolygon {
      unsigned long  Group;    // Material group
      unsigned long  Timer;    // Frame last drawn

      unsigned short Vertex0;  // Vertex index #1
      unsigned short Vertex1;  // Vertex index #2
      unsigned short Vertex2;  // Vertex index #3

      sPolygon() { Group = Timer = 0; }
    } sPolygon;

    // The node structure keeps count of the # of polygons in
    // its 3-D space, an array of sPolygon structures, the
    // 3-D coordinates of the node (as well as the size, which
    // is the distance from the center to one edge making the node
    // a perfect cube), and pointers to the child nodes.
    typedef struct sNode {
      float           XPos, YPos, ZPos; // Center coordinate of node
      float           Size;             // Size of node

      unsigned long   NumPolygons;      // # of polygons in node
      unsigned long  *PolygonList;      // Polygon list

      sNode          *Nodes[8];         // Child nodes 4=quad, 8=oct

      // Constructor used to clear out variables
      sNode()
      {
        XPos = YPos = ZPos = Size = 0.0f; // Position and size
        NumPolygons = 0;        // Set to no polygons in node
        PolygonList = NULL;     // Clear polygon list
        for(short i=0;i<8;i++)  // Quadtrees only uses first 4
          Nodes[i] = NULL;      // Clear out child node pointers
      }

      // Destructor to clear child nodes and variables
      ~sNode()
      {
        delete [] PolygonList;  // Delete list of polygons
        PolygonList = NULL;
        for(short i=0;i<8;i++) {
          delete Nodes[i];      // Delete child nodes
          Nodes[i] = NULL;
        }
      }
    } sNode;

    // The material group structure uses a cVertexBuffer class
    // from the Graphics Core to store polygons that need to
    // be rendered in a single frame, also it maintains the
    // number of polygons in a material group and how many
    // polygons to draw each frame.
    typedef struct sGroup {
      unsigned long  NumPolygons;       // # polygons in group
      unsigned long  NumPolygonsToDraw; // # polygon to draw

      IDirect3DIndexBuffer9 *IndexBuffer;
      unsigned short        *IndexPtr;

      // Clear # polygons
      sGroup() { NumPolygons = 0; IndexBuffer = NULL; }  

      // Free index buffer
      ~sGroup() 
      { 
        if(IndexBuffer != NULL) 
          IndexBuffer->Release(); 
        IndexBuffer = NULL;
      }

    } sGroup;

    int            m_TreeType;     // Type of nodetree
                                   // QUADTREE or OCTREE

    cGraphics     *m_Graphics;     // Parent cGraphics object
    cFrustum      *m_Frustum;      // Viewing frustum

    float          m_Size;         // Size of world cube
    float          m_MaxSize;      // Maximum node size

    sNode         *m_ParentNode;   // Node linked list parent

    unsigned long  m_NumGroups;    // # of material groups
    sGroup        *m_Groups;       // Material groups

    unsigned long  m_MaxPolygons;  // Maximum # of polygons per node

    unsigned long  m_NumPolygons;  // # polygons in scene
    sPolygon      *m_Polygons;     // List of polygons

    unsigned long  m_Timer;        // Current draw timer

    sMesh         *m_Mesh;         // Parent mesh
    char          *m_VertexPtr;    // Pointer to mesh vertices
    unsigned long  m_VertexFVF;    // Mesh vertex FVF
    unsigned long  m_VertexSize;   // Size of mesh vertex

    // SortNode groups the polygons into nodes and splits
    // the nodes into child nodes as needed.
    void           SortNode(sNode *Node,                      \
                         float XPos, float YPos, float ZPos,  \
                         float Size);

    // AddNode adds a node into the list of nodes to draw.
    void           AddNode(sNode *Node);

    // IsPolygonContained return TRUE if a polygon's bounding
    // box intersects with the specified cube space.
    BOOL           IsPolygonContained(
                         sPolygon *Polygon,
                         float XPos, float YPos, float ZPos,  \
                         float Size);

    // CountPolygons returns the # of polygons in a 3-D cube.
    unsigned long  CountPolygons(                             \
                         float XPos, float YPos, float ZPos,  \
                         float Size);

  public:
    cNodeTreeMesh();   // Constructor
    ~cNodeTreeMesh();  // Destructor

    // Functions to create and free a node/tree mesh from
    // a source cMesh object, specifying the maximum # of
    // polygons in an area that is larger than a specific
    // size (forcing node splits).
    BOOL Create(cGraphics *Graphics, cMesh *Mesh,             \
              int TreeType = OCTREE,                          \
              float MaxSize = 256.0f, long MaxPolygons = 32);
    BOOL Free();

    // Render the current view using the current view
    // transformation and overloaded distance of view.
    // Also specify to use a pre-calculate frustum or
    // force a calculation of own frustum.
    BOOL Render(cFrustum *Frustum = NULL, float ZDistance = 0.0f);

    // Get closest height above or below point
    float GetClosestHeight(float XPos, float YPos, float ZPos);

    // Get height below and above point
    float GetHeightBelow(float XPos, float YPos, float ZPos);
    float GetHeightAbove(float XPos, float YPos, float ZPos);

    // Check if a polygon blocks path from start to end
    BOOL CheckIntersect(float XStart, float YStart, float ZStart,
                        float XEnd,   float YEnd,   float ZEnd,
                        float *Length);
};

#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久国产精品午夜一区ai换脸| 99国产一区二区三精品乱码| 在线欧美日韩国产| 亚洲三级久久久| 91麻豆国产福利精品| 亚洲日本中文字幕区| 色狠狠桃花综合| 亚洲综合免费观看高清完整版在线| 久久你懂得1024| 国产一区二区三区蝌蚪| 国产午夜一区二区三区| 99久久婷婷国产综合精品电影| 中文字幕一区二区三区视频| 日本电影欧美片| 亚洲va国产天堂va久久en| 日韩一卡二卡三卡四卡| 国产最新精品免费| 99久久精品费精品国产一区二区 | 国产一区二区免费视频| 国产午夜亚洲精品午夜鲁丝片 | 久久综合国产精品| 国产精品18久久久久久久久| 国产精品成人一区二区三区夜夜夜| 高清国产一区二区| 亚洲欧美国产77777| 欧美日韩午夜在线| 国产精品18久久久久久vr| 樱桃国产成人精品视频| 欧美一区二区在线看| 国产精品自拍在线| 曰韩精品一区二区| 日韩欧美成人激情| av在线不卡网| 全部av―极品视觉盛宴亚洲| 久久亚洲二区三区| 欧美性色欧美a在线播放| 韩国精品免费视频| 亚洲精品欧美专区| 久久久综合九色合综国产精品| 91亚洲国产成人精品一区二区三| 视频一区二区三区中文字幕| 国产精品私人影院| 欧美一区二区三区在线视频| 成人国产精品免费网站| 亚洲免费av网站| 91婷婷韩国欧美一区二区| 午夜欧美大尺度福利影院在线看| 久久久精品2019中文字幕之3| 色伊人久久综合中文字幕| 一二三区精品视频| 国产欧美日韩视频一区二区| 秋霞午夜av一区二区三区| 日本麻豆一区二区三区视频| 蜜臀a∨国产成人精品| 欧美a级一区二区| 狠狠色丁香久久婷婷综合丁香| 狠狠色狠狠色合久久伊人| 国产成人精品三级麻豆| 99视频一区二区| 91豆麻精品91久久久久久| 欧美日韩大陆在线| 日韩视频在线你懂得| 久久久天堂av| 国产精品久久久99| 亚洲自拍与偷拍| 日本美女一区二区三区视频| 国产在线一区二区综合免费视频| 国产成人av电影| 一本久道中文字幕精品亚洲嫩| 欧美视频日韩视频| 欧美一级夜夜爽| 国产日韩欧美制服另类| 亚洲精品精品亚洲| 日韩综合小视频| 免费精品视频在线| 久久久久久久久久久久久久久99| 91久久一区二区| 91精品国产综合久久小美女| 亚洲精品一区二区三区精华液| 国产精品久久久久影院亚瑟| 洋洋av久久久久久久一区| 麻豆精品国产91久久久久久| 处破女av一区二区| 欧美群妇大交群的观看方式| 2欧美一区二区三区在线观看视频| 国产精品色在线观看| 亚洲成a人在线观看| 国产精品亚洲午夜一区二区三区 | 波多野结衣一区二区三区| 欧美四级电影在线观看| 欧美精品一区二区三区蜜桃 | 蜜臀av一区二区在线免费观看| 国产**成人网毛片九色| 欧美三级电影在线观看| 欧美精品一区二区三| 亚洲综合视频在线观看| 国产一区美女在线| 欧美日韩国产综合一区二区| 国产日韩精品一区| 日韩综合一区二区| 91丨porny丨最新| 欧美精品一区视频| 亚洲成人第一页| www.视频一区| 26uuu精品一区二区| 亚洲国产一区在线观看| 成人激情小说网站| 精品国内二区三区| 天堂久久久久va久久久久| a亚洲天堂av| 久久久久99精品国产片| 爽好多水快深点欧美视频| 91色在线porny| 欧美极品美女视频| 国产原创一区二区三区| 在线成人免费视频| 亚洲综合精品久久| av不卡免费电影| 久久久精品综合| 久久成人精品无人区| 欧美色老头old∨ideo| 国产精品不卡在线| 国产99一区视频免费| 精品国产乱码久久久久久老虎| 亚洲一区电影777| 一本大道久久精品懂色aⅴ| 国产日韩精品一区二区浪潮av | 亚洲国产中文字幕| 一本一道波多野结衣一区二区| 中文字幕高清一区| 国产精品资源在线看| 久久蜜臀中文字幕| 激情六月婷婷久久| 精品福利一区二区三区| 久久精品国产澳门| 精品国产一区久久| 激情另类小说区图片区视频区| 91精品午夜视频| 亚洲一区二区精品视频| 亚洲精品第1页| 欧美va亚洲va在线观看蝴蝶网| 中文在线免费一区三区高中清不卡| 奇米影视在线99精品| 欧美日韩亚洲综合一区二区三区| 一区二区三区四区乱视频| 91激情在线视频| 一区二区高清在线| 精品视频在线免费| 五月天一区二区| 欧美一卡二卡在线观看| 九一九一国产精品| 久久久久久久性| 成人永久免费视频| 亚洲精选视频在线| 欧美最新大片在线看| 日韩精品视频网| 欧美v亚洲v综合ⅴ国产v| 国产一区二区调教| 国产精品成人网| 欧美午夜电影网| 美女视频第一区二区三区免费观看网站| 日韩一区二区高清| 国产91精品一区二区麻豆网站| 成人免费一区二区三区在线观看| 在线一区二区视频| 免费成人性网站| 中文字幕巨乱亚洲| 欧美性videosxxxxx| 免费看欧美女人艹b| 日本一区二区三区四区在线视频| 91免费视频网| 免费欧美在线视频| 国产精品麻豆视频| 欧美精品免费视频| 国产风韵犹存在线视精品| 亚洲精品视频免费观看| 欧美一区二区视频网站| 成人看片黄a免费看在线| 亚洲狠狠爱一区二区三区| 久久影院视频免费| 色哦色哦哦色天天综合| 麻豆精品在线看| 1024精品合集| 日韩欧美国产综合| 99re8在线精品视频免费播放| 日韩精品1区2区3区| 欧美高清在线一区| 欧美另类高清zo欧美| 成人精品国产免费网站| 日韩国产欧美在线视频| 国产精品二三区| 日韩写真欧美这视频| 91视频91自| 韩国成人福利片在线播放| 又紧又大又爽精品一区二区| 久久久久久久综合| 欧美人与性动xxxx| 成人app下载| 久久爱另类一区二区小说| 亚洲自拍另类综合|