forked from luke-c-sargent/ogre_3rd_person_ninjas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tile.h
executable file
·59 lines (47 loc) · 1.26 KB
/
Tile.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pragma once
#include <string>
#include <stdio.h>
#include <OgreRoot.h>
#include <OgreEntity.h>
#include <OgreSceneManager.h>
#include <btBulletDynamicsCommon.h>
#define TSIZE 5.0 //cube dimensions
#define WALLSIZE 0.3 //wall thickness
#define TCOUNT 2
using std::string;
using std::cout;
struct TileInput
{
int n:1;//=0;
int s:1;//=0;
int e:1;//=0;
int w:1;//=0;
int ne:1;//=0;
int se:1;//=0;
int sw:1;//=0;
int nw:1;//=0;
};
class Tile
{
static const string wallMesh;
Ogre::SceneNode * levelNode;
Ogre::SceneManager * smp;
btCompoundShape* lvlBodies;
TileInput defaultTile,nTile,sTile,wTile,eTile;
TileInput n_eTile, n_wTile, s_eTile, s_wTile;
TileInput n_s_eTile, n_s_wTile, n_e_wTile, s_e_wTile;
btCollisionShape* boxShape;
//static
static const int x = TSIZE;
static const int y = TSIZE;
static const int z = TSIZE;
void bindTileEntity(TileInput t, string id, Ogre::Vector3 tileOffset);
void makeWall(string pos, string name, Ogre::SceneNode * tn, Ogre::Vector3 cs, Ogre::Vector3 offset);
public:
Tile(Ogre::SceneNode * lvlptr, Ogre::SceneManager * smptr, btCompoundShape* tb);
Tile();
void genTile(int id, int xi, int yi, int zi);
//return pointer to first tile
Tile* getList();
};
btVector3 o2bVector3(Ogre::Vector3 in);