Conversation
There was a problem hiding this comment.
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::CameraAxesas a non-type template parameter to control forward/right inversion, and use it inget_forward(),get_right(), and new view-matrix extraction helpers. - Add
Camera::calc_view_angles_from_view_matrix()andCamera::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
Cameratemplate 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.
| <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" /> |
There was a problem hiding this comment.
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.
| <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" /> |
There was a problem hiding this comment.
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.
| <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" /> |
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.