static int Refent_GetLightingOrigin(lua_State *L) { rent_t *rent; rent = Lua_GetRent(L, 1); Lua_PushVector(L, rent->r->lightingOrigin); return 1; }
static int Refent_GetAxis2(lua_State *L) { rent_t *rent; rent = Lua_GetRent(L, 1); Lua_PushVector(L, rent->r->axis[2]); return 1; }
static int Refent_GetOldOrigin(lua_State *L) { rent_t *rent; rent = Lua_GetRent(L, 1); Lua_PushVector(L, rent->r->oldorigin); return 1; }
/*** Get end position of the trace. @function GetEndpos @return End position of the trace. */ static int Trace_GetEndpos(lua_State *L) { ltrace_t *tr; tr = Lua_GetTrace(L, 1); Lua_PushVector(L, tr->tr->endpos); return 1; }
/*** Add vector b to vector a and return the result. @function Add @param a Vector. @param b Vector. @return Result. */ static int Vector_Add(lua_State *L) { vec_t *a, *b; vec3_t c; a = Lua_GetVector(L, 1); b = Lua_GetVector(L, 2); VectorAdd(a, b, c); Lua_PushVector(L, c); return 0; }
static int Vector_NegateOperator(lua_State *L) { vec_t *a; vec3_t b; a = Lua_GetVector(L, 1); VectorNegate(a, b); Lua_PushVector(L, b); return 1; }
/*** Scale vector a by value b and return the result. @function Scale. @param a Vector. @param b Scaling factor. @return Result. */ static int Vector_Scale(lua_State *L) { vec_t *a, b; vec3_t c; a = Lua_GetVector(L, 1); b = luaL_checknumber(L, 2); VectorScale(a,b,c); Lua_PushVector(L, c); return 0; }
static int Vector_SubOperator(lua_State *L) { vec_t *a, *b; vec3_t c; a = Lua_GetVector(L, 1); b = Lua_GetVector(L, 2); VectorSubtract(a, b, c); Lua_PushVector(L, c); return 1; }
static int weapon_GetForward(lua_State *L) { Lua_PushVector(L, forward); return 1; }
static int weapon_GetMuzzle(lua_State *L) { Lua_PushVector(L, muzzle); return 1; }
static int weapon_GetUp(lua_State *L) { Lua_PushVector(L, up); return 1; }
static int weapon_GetRight(lua_State *L) { Lua_PushVector(L, right); return 1; }