MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / getLuaVectorArg

Function getLuaVectorArg

examples/LuaDemo/LuaPhysicsSetup.cpp:145–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145btVector3 getLuaVectorArg(lua_State* L, int index)
146{
147 btVector3 pos(0, 0, 0);
148
149 int sz = luaL_returnlen(L, index); // get size of table
150 {
151 lua_rawgeti(L, index, 1); // push t[i]
152 pos[0] = lua_tonumber(L, -1);
153 lua_pop(L, 1);
154 lua_rawgeti(L, index, 2); // push t[i]
155 pos[1] = lua_tonumber(L, -1);
156 lua_pop(L, 1);
157 lua_rawgeti(L, index, 3); // push t[i]
158 pos[2] = lua_tonumber(L, -1);
159 lua_pop(L, 1);
160 }
161 return pos;
162}
163
164btQuaternion getLuaQuaternionArg(lua_State* L, int index)
165{

Callers 3

gLoadMultiBodyFromUrdfFunction · 0.85
gCreateRigidBodyFunction · 0.85
gSetBodyPositionFunction · 0.85

Calls 2

luaL_returnlenFunction · 0.85
lua_rawgetiFunction · 0.85

Tested by

no test coverage detected