|
@@ -571,6 +571,13 @@ static int matrix4x4_identity(lua_State* L)
|
|
|
return 1;
|
|
return 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+static int matrix4x4_transform(lua_State* L)
|
|
|
|
|
+{
|
|
|
|
|
+ LuaStack stack(L);
|
|
|
|
|
+ stack.push_vector3(stack.get_vector3(2) * stack.get_matrix4x4(1));
|
|
|
|
|
+ return 1;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
static int matrix4x4_to_string(lua_State* L)
|
|
static int matrix4x4_to_string(lua_State* L)
|
|
|
{
|
|
{
|
|
|
LuaStack stack(L);
|
|
LuaStack stack(L);
|
|
@@ -966,6 +973,7 @@ void load_math(LuaEnvironment& env)
|
|
|
env.load_module_function("Matrix4x4", "rotation", matrix4x4_rotation);
|
|
env.load_module_function("Matrix4x4", "rotation", matrix4x4_rotation);
|
|
|
env.load_module_function("Matrix4x4", "set_rotation", matrix4x4_set_rotation);
|
|
env.load_module_function("Matrix4x4", "set_rotation", matrix4x4_set_rotation);
|
|
|
env.load_module_function("Matrix4x4", "identity", matrix4x4_identity);
|
|
env.load_module_function("Matrix4x4", "identity", matrix4x4_identity);
|
|
|
|
|
+ env.load_module_function("Matrix4x4", "transform", matrix4x4_transform);
|
|
|
env.load_module_function("Matrix4x4", "to_string", matrix4x4_to_string);
|
|
env.load_module_function("Matrix4x4", "to_string", matrix4x4_to_string);
|
|
|
|
|
|
|
|
env.load_module_constructor("Matrix4x4", matrix4x4_ctor);
|
|
env.load_module_constructor("Matrix4x4", matrix4x4_ctor);
|