Skip to content

Fix for camera pitch clamping (software renderer)#599

Merged
jerethk merged 1 commit into
TheForceEngine:masterfrom
jerethk:Clamp_camera_pitch_fix
Jul 7, 2026
Merged

Fix for camera pitch clamping (software renderer)#599
jerethk merged 1 commit into
TheForceEngine:masterfrom
jerethk:Clamp_camera_pitch_fix

Conversation

@jerethk

@jerethk jerethk commented May 3, 2026

Copy link
Copy Markdown
Collaborator

This fixes a bug associated with #468
where I clamped the camera's pitch for the software renderer, but did not account for situations where pitch is expressed as a value between 180 and 360.

Angles between 180 and 360 need to first be converted to a value between -180 and 0, by subtracting 360
(This will not fix values that are > 540 and < 180 but I think it is fair to assume that such values won't be encountered in practice. This issue only occurred when transforming the camera object with a VUE, where all pitch values will be between 0 and 360)

If an angle between 180 and 360 degrees is passed in, convert it to negative by subtracting 360

This will not fix values that are > 540 and < 180 but I think it is fair to assume that such values won't be encountered in practice

@ifeldshteyn ifeldshteyn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good.

@jerethk jerethk merged commit 97789aa into TheForceEngine:master Jul 7, 2026
2 checks passed
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.

2 participants