Screen/world-space related functions rename

This commit is contained in:
aiaf 2024-02-25 09:34:59 +02:00
commit fb3f616be5
4 changed files with 9 additions and 9 deletions

View file

@ -60,7 +60,7 @@ int main(void)
{
if (!collision.hit)
{
ray = GetMouseRay(GetMousePosition(), camera);
ray = GetScreenToWorldRay(GetMousePosition(), camera);
// Check collision between ray and box
collision = GetRayCollisionBox(ray,

View file

@ -109,7 +109,7 @@ int main(void)
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
{
// Check collision between ray and box
if (GetRayCollisionBox(GetMouseRay(GetMousePosition(), camera), bounds).hit) selected = !selected;
if (GetRayCollisionBox(GetScreenToWorldRay(GetMousePosition(), camera), bounds).hit) selected = !selected;
else selected = false;
}
//----------------------------------------------------------------------------------

View file

@ -88,7 +88,7 @@ int main(void)
Color cursorColor = WHITE;
// Get ray and test against objects
ray = GetMouseRay(GetMousePosition(), camera);
ray = GetScreenToWorldRay(GetMousePosition(), camera);
// Check ray collision against ground quad
RayCollision groundHitInfo = GetRayCollisionQuad(ray, g0, g1, g2, g3);

View file

@ -195,7 +195,7 @@ int main(void)
// Handle clicking the cube
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
{
Ray ray = GetMouseRay(GetMousePosition(), camera);
Ray ray = GetScreenToWorldRay(GetMousePosition(), camera);
// Check collision between ray and box
RayCollision collision = GetRayCollisionBox(ray,