mirror of
https://github.com/raylib-cs/raylib-cs
synced 2025-09-09 03:01:41 -04:00
Replacing Matrix with Matrix4x4.
- Matrix in raylib is column major whereas in numerics it is row major. The type marshals and works but it needs to be transposed before it can be used. At first I looked into keeping the matrix type and converting between the 2 as that made sense but I think using just the on type and documenting the difference is a better tradeoff. It may be easy to create bugs by forgetting to transpose but with good documentation I think this is better than having to deal with the 2 types. I may be wrong about this so we will see how it goes.
This commit is contained in:
@@ -283,7 +283,7 @@ namespace Raylib_cs
|
||||
|
||||
// Get world coordinates from screen coordinates
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector3 rlUnproject(Vector3 source, Matrix proj, Matrix view);
|
||||
public static extern Vector3 rlUnproject(Vector3 source, Matrix4x4 proj, Matrix4x4 view);
|
||||
|
||||
// Textures data management
|
||||
// Load texture in GPU
|
||||
@@ -355,7 +355,7 @@ namespace Raylib_cs
|
||||
|
||||
// Draw a 3d mesh with material and transform
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void rlDrawMesh(Mesh mesh, Material material, Matrix transform);
|
||||
public static extern void rlDrawMesh(Mesh mesh, Material material, Matrix4x4 transform);
|
||||
|
||||
// Unload mesh data from CPU and GPU
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
|
Reference in New Issue
Block a user