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

Grab rotation flags #58

Merged
merged 8 commits into from
Apr 22, 2024
Merged

Conversation

Deconimus
Copy link
Contributor

As discussed in PR #31, specifically this implements "step 2" from this comment.

Introduces enum GrabRotationFlags and related functions, designed to model all possible grab rotation behaviors in a modular fashion. With the current set of flags, all possible combinations result in a sensible rotation type, except perhaps for having both GrabRotationSnapToCubeNormals and GrabRotationTurnTowardsPlayer enabled, as the latter would effectively override the former.

Currently, this only changes the behavior of radios, as they are now rotated towards the player and rotated with respect to the player's Z-axis looking direction (like in Portal-PC and previous versions of Portal64).

The new source files grab_rotation.* are inside src/player/. At first I was debating wether to put them into decor/ or physics/ but the GrabRotationFlags are neither exclusive to decor_object nor collision_object.

@mwpenny mwpenny added the enhancement New feature or request label Apr 15, 2024
Copy link
Owner

@mwpenny mwpenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. Just a few small comments.

src/player/grab_rotation.c Outdated Show resolved Hide resolved
src/player/grab_rotation.c Outdated Show resolved Hide resolved
src/player/player.c Show resolved Hide resolved
@Deconimus Deconimus requested a review from mwpenny April 21, 2024 11:14
@mwpenny mwpenny merged commit 247e66f into mwpenny:master Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants