added getCamera()
git-svn-id: svn://anubis/anaglym/trunk@117 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
parent
ebb8667962
commit
a235db919a
14
Engine.cc
14
Engine.cc
@ -257,6 +257,20 @@ int Engine::setCamera(lua_State * L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Engine::getCamera(lua_State * L)
|
||||
{
|
||||
lua_pushnumber(L, m_eye[0]);
|
||||
lua_pushnumber(L, m_eye[1]);
|
||||
lua_pushnumber(L, m_eye[2]);
|
||||
lua_pushnumber(L, m_center[0]);
|
||||
lua_pushnumber(L, m_center[1]);
|
||||
lua_pushnumber(L, m_center[2]);
|
||||
lua_pushnumber(L, m_up[0]);
|
||||
lua_pushnumber(L, m_up[1]);
|
||||
lua_pushnumber(L, m_up[2]);
|
||||
return 9;
|
||||
}
|
||||
|
||||
int Engine::registerEventHandler(lua_State * L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
|
1
Engine.h
1
Engine.h
@ -109,6 +109,7 @@ class Engine
|
||||
|
||||
/* lua services */
|
||||
int setCamera(lua_State * L);
|
||||
int getCamera(lua_State * L);
|
||||
int registerEventHandler(lua_State * L);
|
||||
int clearEventHandler(lua_State * L);
|
||||
|
||||
|
6
ag.cc
6
ag.cc
@ -29,6 +29,7 @@ namespace ag
|
||||
{ "startFrame", startFrame },
|
||||
{ "endFrame", endFrame },
|
||||
{ "setCamera", setCamera },
|
||||
{ "getCamera", getCamera },
|
||||
{ "elapsedTime", elapsedTime },
|
||||
{ "doPhysics", doPhysics },
|
||||
{ "drawObjects", drawObjects },
|
||||
@ -208,6 +209,11 @@ namespace ag
|
||||
return g_engine->setCamera(L);
|
||||
}
|
||||
|
||||
int getCamera(lua_State * L)
|
||||
{
|
||||
return g_engine->getCamera(L);
|
||||
}
|
||||
|
||||
int elapsedTime(lua_State * L)
|
||||
{
|
||||
lua_pushinteger(L, SDL_GetTicks());
|
||||
|
Loading…
x
Reference in New Issue
Block a user