Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
56 lines
1.4 KiB
C++
56 lines
1.4 KiB
C++
// Octree.h: interface for the COctree class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#if !defined(AFX_OCTREE_H__E2D2D94E_00CE_4D60_B3C2_56C46A1EF03D__INCLUDED_)
|
|
#define AFX_OCTREE_H__E2D2D94E_00CE_4D60_B3C2_56C46A1EF03D__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
#include <Vertex.h>
|
|
#include <3DMath.h>
|
|
#include <List.h>
|
|
#include "ViewCamera.h"
|
|
|
|
class PolyNode {
|
|
public:
|
|
vector3 m_vecPoly[3];
|
|
int m_used;
|
|
PolyNode(vector3 *vecPoly)
|
|
{
|
|
m_vecPoly[0]=vecPoly[0];
|
|
m_vecPoly[1]=vecPoly[1];
|
|
m_vecPoly[2]=vecPoly[2];
|
|
m_used=0;
|
|
};
|
|
};
|
|
|
|
class COctree
|
|
{
|
|
vector3 m_MinBox,m_MaxBox;
|
|
public:
|
|
|
|
List<long> m_PolyNodeID;
|
|
COctree *m_pChild[8];
|
|
|
|
void CullSphere(vector3 vecCenter,float fRad,List<PolyNode *> &PolyList,List<int> &PolyID);
|
|
void CullFrustum(CViewCamera *pCamera,List<PolyNode *> &PolyList,List<int> &PolyID);
|
|
void CullRay(vector3 vecStart,vector3 vecDir,float fLens,List<PolyNode *> &PolyList,List<int> &PolyID);
|
|
|
|
void CalcBoundBox(List<PolyNode *> &PolyList);
|
|
void SplitNode(int DepthNode,List<PolyNode *> &PolyList);
|
|
|
|
int IntersectionRay(const D3DXVECTOR3 &vecRayOrigin,const D3DXVECTOR3 &vecRayDir,float &fNear,float &fFar);
|
|
|
|
void Render(LPDIRECT3DDEVICE8 pd3dDevice);
|
|
|
|
void Save(FILE *fp);
|
|
void Load(FILE *fp);
|
|
COctree();
|
|
virtual ~COctree();
|
|
};
|
|
|
|
#endif // !defined(AFX_OCTREE_H__E2D2D94E_00CE_4D60_B3C2_56C46A1EF03D__INCLUDED_)
|