Shader like vectors for C# Scripting

This commit is contained in:
Simon Lübeß
2023-07-20 17:48:28 +02:00
parent f0de874572
commit 3e55a1614a
24 changed files with 1572 additions and 486 deletions
+14
View File
@@ -53,6 +53,8 @@ static class ScriptGlue
public static void Init()
{
RegisterCalls();
RegisterMathFunctions();
}
public static void RegisterManagedComponents()
@@ -284,6 +286,18 @@ static class ScriptGlue
#endregion Physics2D
#region Math
private static void RegisterMathFunctions()
{
RegisterCall<function float(float, out float)>("ScriptGlue::modf_float", => GlitchyEngine.Math.modf);
RegisterCall<function float2(float2, out float2)>("ScriptGlue::modf_float2", => GlitchyEngine.Math.modf);
RegisterCall<function float3(float3, out float3)>("ScriptGlue::modf_float3", => GlitchyEngine.Math.modf);
RegisterCall<function float4(float4, out float4)>("ScriptGlue::modf_float4", => GlitchyEngine.Math.modf);
}
#endregion
private static void RegisterCall<T>(String name, T method) where T : var
{
Mono.mono_add_internal_call(scope $"GlitchyEngine.{name}", (void*)method);