added setAMotorAxis
git-svn-id: svn://anubis/anaglym/trunk@235 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
parent
4ce1891cd1
commit
50cb363151
@ -312,6 +312,15 @@ int Engine::addAMotor(Object * o1, Object * o2)
|
||||
return id;
|
||||
}
|
||||
|
||||
void Engine::setAMotorAxis(int jid, int anum, int rel,
|
||||
dReal x, dReal y, dReal z)
|
||||
{
|
||||
if (m_joints.find(jid) != m_joints.end())
|
||||
{
|
||||
m_world.setAMotorAxis(m_joints[jid], anum, rel, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
void Engine::setAMotorNumAxes(int jid, int num_axes)
|
||||
{
|
||||
if (m_joints.find(jid) != m_joints.end())
|
||||
|
2
Engine.h
2
Engine.h
@ -125,6 +125,8 @@ class Engine
|
||||
int addObject(bool is_static, OdeWorld::GeomType geom_type,
|
||||
refptr< std::vector<float> > args);
|
||||
int addAMotor(Object * o1, Object * o2);
|
||||
void setAMotorAxis(int jid, int anum, int rel,
|
||||
dReal x, dReal y, dReal z);
|
||||
void setAMotorNumAxes(int jid, int num_axes);
|
||||
void setAMotorLoStop(int jid, dReal val);
|
||||
void setAMotorHiStop(int jid, dReal val);
|
||||
|
29
ag.cc
29
ag.cc
@ -275,6 +275,8 @@ namespace ag
|
||||
lua_setfield(L, -2, "setFMax");
|
||||
lua_pushcfunction(L, joint::setAMotorBounce);
|
||||
lua_setfield(L, -2, "setBounce");
|
||||
lua_pushcfunction(L, joint::setAMotorAxis);
|
||||
lua_setfield(L, -2, "setAxis");
|
||||
}
|
||||
|
||||
int _createAMotor(lua_State * L)
|
||||
@ -1262,6 +1264,33 @@ namespace ag
|
||||
|
||||
namespace joint
|
||||
{
|
||||
int setAMotorAxis(lua_State * L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
if (argc == 6
|
||||
&& lua_istable(L, 1)
|
||||
&& lua_isnumber(L, 2)
|
||||
&& lua_isnumber(L, 3)
|
||||
&& lua_isnumber(L, 4)
|
||||
&& lua_isnumber(L, 5)
|
||||
&& lua_isnumber(L, 6))
|
||||
{
|
||||
lua_getfield(L, 1, "id");
|
||||
if (lua_isnumber(L, -1))
|
||||
{
|
||||
int jid = lua_tointeger(L, -1);
|
||||
g_engine->setAMotorAxis(jid,
|
||||
lua_tointeger(L, 2),
|
||||
lua_tointeger(L, 3),
|
||||
lua_tonumber(L, 4),
|
||||
lua_tonumber(L, 5),
|
||||
lua_tonumber(L, 6));
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int setAMotorLoStop(lua_State * L)
|
||||
{
|
||||
int argc = lua_gettop(L);
|
||||
|
1
ag.h
1
ag.h
@ -91,6 +91,7 @@ namespace ag
|
||||
|
||||
namespace joint
|
||||
{
|
||||
int setAMotorAxis(lua_State * L);
|
||||
int setAMotorLoStop(lua_State * L);
|
||||
int setAMotorHiStop(lua_State * L);
|
||||
int setAMotorVel(lua_State * L);
|
||||
|
Loading…
x
Reference in New Issue
Block a user