Update RingRayLib - raylib.c - Add Function : Ray GetMouseRay(Vector2 mousePosition, Camera camera)
@@ -493,6 +493,25 @@ RING_FUNC(ring_EndTextureMode)
EndTextureMode();
}
+
+RING_FUNC(ring_GetMouseRay)
+{
+ if ( RING_API_PARACOUNT != 2 ) {
+ RING_API_ERROR(RING_API_MISS2PARA);
+ return ;
+ }
+ {
+ Ray *pValue ;
+ pValue = (Ray *) ring_state_malloc(((VM *) pPointer)->pRingState,sizeof(Ray)) ;
+ *pValue = GetMouseRay(* (Vector2 *) RING_API_GETCPOINTER(1,"Vector2"),* (Camera *) RING_API_GETCPOINTER(2,"Camera"));
+ if (RING_API_ISCPOINTERNOTASSIGNED(1))
+ ring_state_free(((VM *) pPointer)->pRingState,RING_API_GETCPOINTER(1,"Vector2"));
+ if (RING_API_ISCPOINTERNOTASSIGNED(2))
+ ring_state_free(((VM *) pPointer)->pRingState,RING_API_GETCPOINTER(2,"Camera"));
+ RING_API_RETMANAGEDCPOINTER(pValue,"Ray",ring_state_free);
+ }
+}
+
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("initwindow",ring_InitWindow);
@@ -536,4 +555,5 @@ RING_API void ringlib_init(RingState *pRingState)
ring_vm_funcregister("endmode3d",ring_EndMode3D);
ring_vm_funcregister("begintexturemode",ring_BeginTextureMode);
ring_vm_funcregister("endtexturemode",ring_EndTextureMode);
+ ring_vm_funcregister("getmouseray",ring_GetMouseRay);
}
