-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGenerator.h
108 lines (102 loc) · 1.87 KB
/
Generator.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#pragma once
#include "Ogre.h"
#include "PhysObject.h"
#include "global.h"
#include "SharedLuaCallback.h"
//lua
class Generator: public Singleton<Generator>
{
public:
Generator();
~Generator();
void init();
static int setPhysObject(lua_State* pL)
{
int n = lua_gettop(pL);
if (n!=2)
{
return 0;
}
if (lua_isstring(pL, 1)&&lua_isstring(pL, 2))
{
SharedLuaCallback::getSingleton().shared_genSetPO(lua_tostring(pL, 1),StringConverter::parseVector3(lua_tostring(pL, 2)));
}
return 1;
}
static int setNumberX(lua_State* pL)
{
int n = lua_gettop(pL);
if (n!=1)
{
return 0;
}
if (lua_isnumber(pL, 1))
{
SharedLuaCallback::getSingleton().shared_genSetX(lua_tonumber(pL, 1));
}
return 1;
}
static int setNumberY(lua_State* pL)
{
int n = lua_gettop(pL);
if (n!=1)
{
return 0;
}
if (lua_isnumber(pL, 1))
{
SharedLuaCallback::getSingleton().shared_genSetY(lua_tonumber(pL, 1));
}
return 1;
}
static int setNumberZ(lua_State* pL)
{
int n = lua_gettop(pL);
if (n!=1)
{
return 0;
}
if (lua_isnumber(pL, 1))
{
SharedLuaCallback::getSingleton().shared_genSetZ(lua_tonumber(pL, 1));
}
return 1;
}
static int setCenter(lua_State* pL)
{
int n = lua_gettop(pL);
if (n!=1)
{
return 0;
}
if (lua_isstring(pL, 1))
{
SharedLuaCallback::getSingleton().shared_genSetCenter(StringConverter::parseVector3(lua_tostring(pL, 1)));
}
return 1;
}
static int setSpace(lua_State* pL)
{
int n = lua_gettop(pL);
if (n!=1)
{
return 0;
}
if (lua_isstring(pL, 1))
{
SharedLuaCallback::getSingleton().shared_genSetSp(StringConverter::parseReal(lua_tostring(pL, 1)));
}
return 1;
}
static int Fire(lua_State* pL)
{
SharedLuaCallback::getSingleton().shared_genFire();
return 1;
}
unsigned int nx,ny,nz;
Real spacing;
Vector3 pos;
String meshFile;
Vector3 scale;
void fireGenerator();
};