コード例 #1
0
ファイル: lua_refent.c プロジェクト: UberGames/RPG-X2-rpgxEF
static int Refent_GetLightingOrigin(lua_State *L) {
	rent_t *rent;

	rent = Lua_GetRent(L, 1);
	Lua_PushVector(L, rent->r->lightingOrigin);

	return 1;
}
コード例 #2
0
ファイル: lua_refent.c プロジェクト: UberGames/RPG-X2-rpgxEF
static int Refent_GetAxis2(lua_State *L) {
	rent_t *rent;

	rent = Lua_GetRent(L, 1);
	Lua_PushVector(L, rent->r->axis[2]);

	return 1;
}
コード例 #3
0
ファイル: lua_refent.c プロジェクト: UberGames/RPG-X2-rpgxEF
static int Refent_GetOldOrigin(lua_State *L) {
	rent_t *rent;

	rent = Lua_GetRent(L, 1);
	Lua_PushVector(L, rent->r->oldorigin);

	return 1;
}
コード例 #4
0
ファイル: lua_trace.c プロジェクト: gitter-badger/rpgxEF
/***
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;
}
コード例 #5
0
ファイル: lua_vector.c プロジェクト: gitter-badger/rpgxEF
/***
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;
}
コード例 #6
0
ファイル: lua_vector.c プロジェクト: gitter-badger/rpgxEF
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;
}
コード例 #7
0
ファイル: lua_vector.c プロジェクト: gitter-badger/rpgxEF
/***
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;
}
コード例 #8
0
ファイル: lua_vector.c プロジェクト: gitter-badger/rpgxEF
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;
}
コード例 #9
0
static int weapon_GetForward(lua_State *L) {
	Lua_PushVector(L, forward);

	return 1;
}
コード例 #10
0
static int weapon_GetMuzzle(lua_State *L) {
	Lua_PushVector(L, muzzle);

	return 1;
}
コード例 #11
0
static int weapon_GetUp(lua_State *L) {
	Lua_PushVector(L, up);

	return 1;
}
コード例 #12
0
static int weapon_GetRight(lua_State *L) {
	Lua_PushVector(L, right);

	return 1;
}