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

"Free camera" flight controls / input refactoring #204

Open
assertivist opened this issue Nov 18, 2021 · 1 comment · Fixed by Ymihere03/Avara#1
Open

"Free camera" flight controls / input refactoring #204

assertivist opened this issue Nov 18, 2021 · 1 comment · Fixed by Ymihere03/Avara#1
Labels
enhancement New feature or request graphics Problems with OpenGL or generally rendering related

Comments

@assertivist
Copy link
Member

assertivist commented Nov 18, 2021

As an Avara user, in spectator mode, I should be able to switch between witnessing through other players' views (currently implemented), and a free-flight mode where the camera can be rotated and moved anywhere in the level space.

Bonus points:

  • Ability to pick a focus object or player, so that the camera always rotates to keep that object or player in view, no matter the position of the camera
  • Implement in such a way that it is easily added to BSPViewer and a future phase game film playback mode
  • Keep SDL input handling to a single class (avoid adding more places where SDL_Events must be handled)

Extra extra bonus points:

  • Move all input handling into its own class (no SDL_Events anywhere else in the code base)
@assertivist assertivist added enhancement New feature or request graphics Problems with OpenGL or generally rendering related labels Jan 29, 2022
@Ymihere03
Copy link
Contributor

PRs #391 and #392 have added a free flight camera used in spectator mode. A new file CFreeCam.cpp was added to contain all the handling for the new camera. Additional code was added outside the new class to make the new camera view get used at the proper time.

Here are the features that align with this issue:
Free camera can toggle on/off during spectator mode.
When toggled on:

  • Free camera can strafe in the six orthogonal directions in 3d space
  • Camera can rotate in a complete sphere around the sphere's center (camera always looks at the center)
  • Camera can zoom in and out (changes radius of the sphere)
  • User can select a player to follow using the existing Spectate Next/Previous controls
  • Camera sphere will stay centered on the selected spectate player until the following occurs:
    • Free cam is toggled off
    • Spectate Next/Previous controls are pressed again
    • The camera is moved in any of the 6 orthogonal directions. Zooming or rotating the camera will keep the camera centered on the spectate player.
  • At the time of this comment, HECTOR's are the only in-game object that the free camera can center on

Please review if the free camera implementation is "easily added to BSPViewer" as I don't know the requirements for this goal.

As far as I can tell, the free cam has not added more SDL_Event handling but the FunctionTable for keyboard keys is read inside of CFreeCam.cpp.
My PRs have no other changes to SDL_events.

I will not close this issue yet due to the unfinished tasks in the bonus section.

@Ymihere03 Ymihere03 linked a pull request Mar 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request graphics Problems with OpenGL or generally rendering related
Projects
Status: Avara 1.0
Development

Successfully merging a pull request may close this issue.

2 participants