Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Examples] Update core_3d_camera_first_personCamera #4221

Closed
wants to merge 7 commits into from

Conversation

kai-z99
Copy link
Contributor

@kai-z99 kai-z99 commented Aug 7, 2024

Regarding issue #4208 for core_3d_camera_first_person.

It doesn't mention that SPACE and LCTRL only work in CAMERA_FREE mode. So I added some text to clarify. Im not sure if adding functionallity to SPACE AND LCTRL was the intention for CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON, and CAMERA_ORBITAL? Because that would make CAMERA_FREE and CAMERA_FIRST_PERSON function identical if im not mistaken?

Also it never mentions that the zoom functionality is not availible in CAMERA_FIRST_PERSON, so I propose the change that zooming in CAMERA_FIRST_PERSON changes your fovy which mimics how zoom works first-person gameplay. It just resets back to the default value of 60.0f once you change cameraMode. That will make CAMERA_FIRST_PERSON differ a little more from CAMERA_FREE.

@casperbear
Copy link

Can attest that I did wonder about SPACE and LCTRL several months ago when started to learn RayLib. Thought they were for jumping and sneaking, but were broken. :) Never realized they were for free camera.

@CrackedPixel
Copy link
Sponsor Contributor

I think this has way too many changes that aren't necessary. Why not display different controls based on the camera mode and leave it at that? Or something

@kai-z99
Copy link
Contributor Author

kai-z99 commented Aug 8, 2024

@CrackedPixel For me its just makes it more consistant that each mode can zoom. And it stops the free camera being the same as the first person camera.

I updated the pr to include your idea of displaying different controls. based on camera mode. I still think adding zooming to the first-person mode makes sense but I comment it out for now.

Comment on lines +120 to +123
////Camera zooming
//float wheelMove = GetMouseWheelMove();
//bool zoomIn = IsKeyDown(KEY_KP_ADD);
//bool zoomOut = IsKeyDown(KEY_KP_SUBTRACT);

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
Comment on lines +125 to +135
//if (cameraMode == CAMERA_FIRST_PERSON && (wheelMove != 0 || zoomIn || zoomOut))
//{
// if ((wheelMove > 0 || zoomIn) && camera.fovy >= 20.0f)
// {
// camera.fovy -= 5.0f;
// }
// else if ((wheelMove < 0 || zoomOut) && camera.fovy <= 90.0f)
// {
// camera.fovy += 5.0f;
// }
//}

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
@raysan5
Copy link
Owner

raysan5 commented Aug 10, 2024

@kai-z99 why that code is commented? Add it or remove it.

@kai-z99
Copy link
Contributor Author

kai-z99 commented Aug 10, 2024

@raysan5 I was wondering if you would rather have that feature or remove it?

@raysan5
Copy link
Owner

raysan5 commented Aug 12, 2024

@kai-z99 in that case, I prefer to leave the example as it is.

@raysan5 raysan5 closed this Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants