My Project: openb3dlib.mod/openb3d/src/octree.h Source File

My Project

octree.h
Go to the documentation of this file.
1 #ifndef OCTREE_H
2 #define OCTREE_H
3
4 #include "terrain.h"
5 #include "mesh.h"
6
7 using namespace std;
8
9 class OcTreeChild{
10
11 public:
12 OcTreeChild* child[8];
13 int isBlock;
14 float x,y,z, width, height, depth;
15 float near,far;
16
17 Mesh* mesh;
18
19
20
21 void AddToOctree(Mesh* mesh1, int level, float X, float Y, float Z, float Near, float Far, int block);
22 void FreeChild();
23 OcTreeChild* CopyChild();
24 //void FreeOctreeNode(int level, float X, float Y, float Z);
25 void RenderChild();
26 void Coll_Child();
27 };
28
29 class OcTree : public Terrain{
30
31 public:
32 OcTreeChild child;
33
34 list<Mesh*> Rendered_Blocks;
35 list<Mesh*> Rendered_Meshes;
36
37 static OcTree* CreateOcTree(float w=1, float h=1, float d=1, Entity* parent_ent=0);
38 OcTree* CopyEntity(Entity* parent_ent=NULL);
39 void FreeEntity(void);
40
41
42 void OctreeMesh(Mesh* mesh, int level, float X, float Y, float Z, float Near=0.0, float Far=1000.0);
43 void OctreeBlock(Mesh* mesh, int level, float X, float Y, float Z, float Near=0.0, float Far=1000.0);
44 void TreeCheck(CollisionInfo* ci);
45 void UpdateTerrain();
46
47 };
48
49 #endif
OcTree::Rendered_Blocks
list< Mesh * > Rendered_Blocks
Definition: octree.h:34
Mesh
Definition: mesh.h:34
terrain.h
Terrain
Definition: terrain.h:22
AddToOctree
void DLL_EXPORT AddToOctree(OcTree *octree, Mesh *mesh, int level, float X, float Y, float Z, float Near, float Far)
OcTreeChild
Definition: octree.h:9
CopyEntity
Entity * CopyEntity(Entity *ent, Entity *parent)
Definition: functions.cpp:421
mesh.h
CreateOcTree
OcTree * CreateOcTree(float w, float h, float d, Entity *parent_ent=0)
Definition: functions.cpp:1943
std
TreeCheck
void TreeCheck(Mesh *obj)
Definition: methods.cpp:312
OcTree
Definition: octree.h:29
FreeEntity
void FreeEntity(Entity *ent)
Definition: functions.cpp:882
Entity
Definition: entity.h:27
OcTreeChild::isBlock
int isBlock
Definition: octree.h:13
OcTreeChild::mesh
Mesh * mesh
Definition: octree.h:17
load3ds::mesh
Mesh * mesh
Definition: 3ds.cpp:46
OcTree::Rendered_Meshes
list< Mesh * > Rendered_Meshes
Definition: octree.h:35
UpdateTerrain
void UpdateTerrain(Terrain *obj)
Definition: methods.cpp:438
OcTree::child
OcTreeChild child
Definition: octree.h:32
OcTreeChild::near
float near
Definition: octree.h:15
CollisionInfo
Definition: collision.h:51
OcTreeChild::z
float z
Definition: octree.h:14
OctreeMesh
void OctreeMesh(OcTree *octree, Mesh *mesh, int level, float X, float Y, float Z, float Near=0.0, float Far=1000.0)
Definition: functions.cpp:1951
OctreeBlock
void OctreeBlock(OcTree *octree, Mesh *mesh, int level, float X, float Y, float Z, float Near=0.0, float Far=1000.0)
Definition: functions.cpp:1947
NULL
#define NULL
Definition: tree.cpp:4