test(gl): regression coverage for camera angles and Scene.select - #168
Merged
Conversation
Co-authored-by: Boden <th3w1zard1@users.noreply.github.com>
Co-authored-by: Boden <th3w1zard1@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds focused regression tests for recent GL scene/camera changes: angle wrapping and smoothing in the module designer camera stack, and
Scene.selectbehavior when callers pass aGITObject.Type of Change
Package(s) Affected
Risky behavior now covered
Camera.rotate:_wrap_angle_pibehavior for yaw and pitch whenclamp=False, including a full (2\pi) yaw delta; invertedlower_limit/upper_limitclamp path (midpoint, no crash).CameraController._lerp_angle: shortest arc across the (\pm\pi) seam (relevant to smoothing after orbit/wrap fixes).CameraController._determine_mode:InputState.pan_buttonforces pan mode (documented for Ctrl+LMB-style bindings).Scene.select: resolves aGITObjectto theRenderObjectwhose.datamatches;clear_existingclears vs append; unknown GIT leaves selection empty when clearing.Test files added/updated
Libraries/PyKotor/tests/gl/test_camera_controller.py— extended.Libraries/PyKotor/tests/gl/test_scene_select.py— new.Why these tests materially reduce regression risk
Camera math bugs surface as subtle viewport drift, gimbal-like jumps, or wrong smoothing after large rotations; the new tests pin the wrap and shortest-path interpolation contracts. Selection bugs break the editor workflow when code passes GIT instances instead of render wrappers; the new tests lock the resolution and multi-select semantics without requiring a GL context (stub + bound
Scene.select).Testing
PYTHONPATH=Libraries/PyKotor/src:Libraries/bioware-kaitai-formats/src QT_QPA_PLATFORM=offscreen python3 -m pytest --import-mode=importlib -m "not gui and not slow" --timeout=120 Libraries/PyKotor/tests/gl/test_camera_controller.py Libraries/PyKotor/tests/gl/test_scene_select.pypyrighton the two test files (0 issues).Note:
Scene()full construction compiles shaders and can fail headless;test_scene_selectuses a minimal stub with_module is NonesoSceneCache.build_cacheis a no-op, while still executing the realScene.selectimplementation.Checklist