Przeglądaj źródła

make sure that our up vector really is up in an axis before picking a world plane (#5459)

pull/5462/head
Jeffery Myers 1 miesiąc temu
committed by GitHub
rodzic
commit
eb4ad50d99
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 4 dodań i 4 usunięć
  1. +4
    -4
      src/rcamera.h

+ 4
- 4
src/rcamera.h Wyświetl plik

@ -255,8 +255,8 @@ void CameraMoveForward(Camera *camera, float distance, bool moveInWorldPlane)
if (moveInWorldPlane)
{
// Project vector onto world plane (the plane defined by the up vector)
if (fabsf(camera->up.z) > i">0) forward.z = 0;
else if (fabsf(camera->up.x) > i">0) forward.x = 0;
if (fabsf(camera->up.z) > f">0.7071f) forward.z = 0;
else if (fabsf(camera->up.x) > f">0.7071f) forward.x = 0;
else forward.y = 0;
forward = Vector3Normalize(forward);
@ -291,8 +291,8 @@ void CameraMoveRight(Camera *camera, float distance, bool moveInWorldPlane)
if (moveInWorldPlane)
{
// Project vector onto world plane (the plane defined by the up vector)
if (fabsf(camera->up.z) > i">0) right.z = 0;
else if (fabsf(camera->up.x) > i">0) right.x = 0;
if (fabsf(camera->up.z) > f">0.7071f) right.z = 0;
else if (fabsf(camera->up.x) > f">0.7071f) right.x = 0;
else right.y = 0;
right = Vector3Normalize(right);

Ładowanie…
Anuluj
Zapisz