Skip to content

Feature/camera upgrade#182

Merged
orange-cpp merged 4 commits intomainfrom
feature/camera_upgrade
Apr 15, 2026
Merged

Feature/camera upgrade#182
orange-cpp merged 4 commits intomainfrom
feature/camera_upgrade

Conversation

@orange-cpp
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the projection Camera template to support per-engine axis sign conventions and adds unit tests to validate extracting view angles/origin from a view matrix across multiple engine camera types.

Changes:

  • Introduce projection::CameraAxes as a non-type template parameter to control forward/right inversion, and use it in get_forward(), get_right(), and new view-matrix extraction helpers.
  • Add Camera::calc_view_angles_from_view_matrix() and Camera::calc_origin_from_view_matrix() plus extensive unit tests covering these behaviors (Source + Unity) and basis vectors (multiple engines).
  • Update engine camera typedefs to the new Camera template parameter order and set appropriate axis inversion flags (Unity/OpenGL forward, Unreal right).

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
include/omath/projection/camera.hpp Adds CameraAxes and new static helpers to recover angles/origin from a view matrix; replaces old inversion boolean with axis flags.
include/omath/engines/source_engine/camera.hpp Updates Camera alias to new template signature (no axis overrides).
include/omath/engines/unity_engine/camera.hpp Updates Camera alias and enables inverted_forward.
include/omath/engines/opengl_engine/camera.hpp Updates Camera alias and enables inverted_forward.
include/omath/engines/unreal_engine/camera.hpp Updates Camera alias and enables inverted_right.
include/omath/engines/cry_engine/camera.hpp Updates Camera alias to new template signature.
include/omath/engines/frostbite_engine/camera.hpp Updates Camera alias to new template signature (also contains a namespace-comment issue).
include/omath/engines/iw_engine/camera.hpp Updates Camera alias to new template signature.
tests/general/unit_test_projection.cpp Adds many unit tests for view-matrix angle/origin recovery and per-engine basis vectors.
.idea/editor.xml Changes IDE inspection severity settings.
Files not reviewed (1)
  • .idea/editor.xml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread include/omath/engines/frostbite_engine/camera.hpp Outdated
Comment thread .idea/editor.xml
Comment on lines 105 to 107
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

This PR includes changes to IDE inspection severity settings in .idea/editor.xml, which appear unrelated to the camera upgrade and can create noisy diffs/team-wide IDE behavior changes. If this wasn’t intentional, consider reverting these .idea changes or moving them to a separate PR focused on IDE configuration.

Copilot uses AI. Check for mistakes.
Comment thread .idea/editor.xml
Comment on lines 203 to 206
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexedValue" value="HINT" type="string" />
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

Similar to the earlier hunk: updating .idea/editor.xml inspection severities (e.g., enabling new warnings) is likely orthogonal to the camera feature work. If the intent is just camera behavior changes, please drop these IDE config edits or split them into a dedicated tooling/config PR.

Copilot uses AI. Check for mistakes.
Comment thread .idea/editor.xml
Comment on lines 218 to 220
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexedValue" value="WARNING" type="string" />
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

Another IDE-severity-only change in .idea/editor.xml that doesn’t seem tied to the camera upgrade. Consider reverting/splitting these to avoid unrelated configuration churn in this PR.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@orange-cpp orange-cpp merged commit f3f454b into main Apr 15, 2026
20 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