소스 검색

Make CameraMove up and right work with Z up cameras like the other functions do.

pull/5458/head
Jeffery Myers 2 달 전
부모
커밋
d1e802e738
1개의 변경된 파일15개의 추가작업 그리고 4개의 파일을 삭제
  1. +15
    -4
      src/rcamera.h

+ 15
- 4
src/rcamera.h 파일 보기

@ -252,8 +252,13 @@ void CameraMoveForward(Camera *camera, float distance, bool moveInWorldPlane)
if (moveInWorldPlane)
{
// Project vector onto world plane
forward.y = 0;
// Project vector onto world plane (the plane defined by the up vector)
if (fabsf(camera->up.z) > 0)
forward.z = 0;
else if (fabsf(camera->up.x) > 0)
forward.x = 0;
else
forward.y = 0;
forward = Vector3Normalize(forward);
}
@ -285,8 +290,14 @@ void CameraMoveRight(Camera *camera, float distance, bool moveInWorldPlane)
if (moveInWorldPlane)
{
// Project vector onto world plane
right.y = 0;
// Project vector onto world plane (the plane defined by the up vector)
if (fabsf(camera->up.z) > 0)
right.z = 0;
else if (fabsf(camera->up.x) > 0)
right.x = 0;
else
right.y = 0;
right = Vector3Normalize(right);
}

불러오는 중...
취소
저장