Implement Managed Friendly version of CheckCollisionPointPoly
This commit is contained in:
parent
377a32a9db
commit
e171a4fba6
1 changed files with 6 additions and 0 deletions
|
|
@ -1290,6 +1290,12 @@ public static unsafe partial class Raylib
|
||||||
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern CBool CheckCollisionPointPoly(Vector2 point, Vector2* points, int pointCount);
|
public static extern CBool CheckCollisionPointPoly(Vector2 point, Vector2* points, int pointCount);
|
||||||
|
|
||||||
|
public unsafe static bool CheckCollisionPointPoly(Vector2 point, Vector2[] points, int pointCount)
|
||||||
|
{
|
||||||
|
var pointsPtr = (Vector2*)Unsafe.AsPointer<Vector2>(ref MemoryMarshal.GetArrayDataReference(points));
|
||||||
|
return Raylib.CheckCollisionPointPoly(point, pointsPtr, pointCount);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check the collision between two lines defined by two points each, returns collision point by reference
|
/// Check the collision between two lines defined by two points each, returns collision point by reference
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue