Watch
2
0
Fork
You've already forked raylib-cs
0

GetMouseRay is GetScreenToWorldRay now

This commit is contained in:
JupiterRider 2024-12-03 20:11:01 +01:00
commit 315b0139e8
2 changed files with 9 additions and 2 deletions

View file

@ -408,9 +408,9 @@ public static unsafe partial class Raylib
// Screen-space-related functions // Screen-space-related functions
/// <summary>Get a ray trace from mouse position</summary> /// <summary>Get a ray trace from screen position (i.e mouse)</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Ray GetMouseRay(Vector2 mousePosition, Camera3D camera); public static extern Ray GetScreenToWorldRay(Vector2 position, Camera3D camera);
/// <summary>Get camera transform matrix (view matrix)</summary> /// <summary>Get camera transform matrix (view matrix)</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]

View file

@ -1322,4 +1322,11 @@ public static unsafe partial class Raylib
{ {
model.Materials[materialIndex].Shader = shader; model.Materials[materialIndex].Shader = shader;
} }
/// <summary>Get a ray trace from mouse position</summary>
[ObsoleteAttribute("This method is obsolete. Call GetScreenToWorldRay instead.")]
public static Ray GetMouseRay(Vector2 mousePosition, Camera3D camera)
{
return GetScreenToWorldRay(mousePosition, camera);
}
} }