Update RingRayLib - raylib.c - Add Function : RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3)
@@ -5742,6 +5742,29 @@ RING_FUNC(ring_GetCollisionRayModel)
}
}
+
+RING_FUNC(ring_GetCollisionRayTriangle)
+{
+ if ( RING_API_PARACOUNT != 4 ) {
+ RING_API_ERROR(RING_API_MISS4PARA);
+ return ;
+ }
+ {
+ RayHitInfo *pValue ;
+ pValue = (RayHitInfo *) ring_state_malloc(((VM *) pPointer)->pRingState,sizeof(RayHitInfo)) ;
+ *pValue = GetCollisionRayTriangle(* (Ray *) RING_API_GETCPOINTER(1,"Ray"),* (Vector3 *) RING_API_GETCPOINTER(2,"Vector3"),* (Vector3 *) RING_API_GETCPOINTER(3,"Vector3"),* (Vector3 *) RING_API_GETCPOINTER(4,"Vector3"));
+ if (RING_API_ISCPOINTERNOTASSIGNED(1))
+ ring_state_free(((VM *) pPointer)->pRingState,RING_API_GETCPOINTER(1,"Ray"));
+ if (RING_API_ISCPOINTERNOTASSIGNED(2))
+ ring_state_free(((VM *) pPointer)->pRingState,RING_API_GETCPOINTER(2,"Vector3"));
+ if (RING_API_ISCPOINTERNOTASSIGNED(3))
+ ring_state_free(((VM *) pPointer)->pRingState,RING_API_GETCPOINTER(3,"Vector3"));
+ if (RING_API_ISCPOINTERNOTASSIGNED(4))
+ ring_state_free(((VM *) pPointer)->pRingState,RING_API_GETCPOINTER(4,"Vector3"));
+ RING_API_RETMANAGEDCPOINTER(pValue,"RayHitInfo",ring_state_free);
+ }
+}
+
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("initwindow",ring_InitWindow);
@@ -6062,4 +6085,5 @@ RING_API void ringlib_init(RingState *pRingState)
ring_vm_funcregister("checkcollisionraysphereex",ring_CheckCollisionRaySphereEx);
ring_vm_funcregister("checkcollisionraybox",ring_CheckCollisionRayBox);
ring_vm_funcregister("getcollisionraymodel",ring_GetCollisionRayModel);
+ ring_vm_funcregister("getcollisionraytriangle",ring_GetCollisionRayTriangle);
}
