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;
|
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 Engine::registerEventHandler(lua_State * L)
|
||||||
{
|
{
|
||||||
int argc = lua_gettop(L);
|
int argc = lua_gettop(L);
|
||||||
|
1
Engine.h
1
Engine.h
@ -109,6 +109,7 @@ class Engine
|
|||||||
|
|
||||||
/* lua services */
|
/* lua services */
|
||||||
int setCamera(lua_State * L);
|
int setCamera(lua_State * L);
|
||||||
|
int getCamera(lua_State * L);
|
||||||
int registerEventHandler(lua_State * L);
|
int registerEventHandler(lua_State * L);
|
||||||
int clearEventHandler(lua_State * L);
|
int clearEventHandler(lua_State * L);
|
||||||
|
|
||||||
|
6
ag.cc
6
ag.cc
@ -29,6 +29,7 @@ namespace ag
|
|||||||
{ "startFrame", startFrame },
|
{ "startFrame", startFrame },
|
||||||
{ "endFrame", endFrame },
|
{ "endFrame", endFrame },
|
||||||
{ "setCamera", setCamera },
|
{ "setCamera", setCamera },
|
||||||
|
{ "getCamera", getCamera },
|
||||||
{ "elapsedTime", elapsedTime },
|
{ "elapsedTime", elapsedTime },
|
||||||
{ "doPhysics", doPhysics },
|
{ "doPhysics", doPhysics },
|
||||||
{ "drawObjects", drawObjects },
|
{ "drawObjects", drawObjects },
|
||||||
@ -208,6 +209,11 @@ namespace ag
|
|||||||
return g_engine->setCamera(L);
|
return g_engine->setCamera(L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getCamera(lua_State * L)
|
||||||
|
{
|
||||||
|
return g_engine->getCamera(L);
|
||||||
|
}
|
||||||
|
|
||||||
int elapsedTime(lua_State * L)
|
int elapsedTime(lua_State * L)
|
||||||
{
|
{
|
||||||
lua_pushinteger(L, SDL_GetTicks());
|
lua_pushinteger(L, SDL_GetTicks());
|
||||||
|
1
ag.h
1
ag.h
@ -15,6 +15,7 @@ namespace ag
|
|||||||
int startFrame(lua_State * L);
|
int startFrame(lua_State * L);
|
||||||
int endFrame(lua_State * L);
|
int endFrame(lua_State * L);
|
||||||
int setCamera(lua_State * L);
|
int setCamera(lua_State * L);
|
||||||
|
int getCamera(lua_State * L);
|
||||||
int elapsedTime(lua_State * L);
|
int elapsedTime(lua_State * L);
|
||||||
int doPhysics(lua_State * L);
|
int doPhysics(lua_State * L);
|
||||||
int drawObjects(lua_State * L);
|
int drawObjects(lua_State * L);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user