Files
Neutron/docs/orbit-camera.md
T

60 lines
3.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Orbit camera handedness correction
Follow-up: the user clarified that the remaining issue was inverted Left/Right
input; Up/Down was correct. Orbit Left/A now increases azimuth, Right/D decreases
it, matching the corrected view. Elevation, projection and gameplay controls
are unchanged. This is a two-line modern input mapping correction.
Both executables republished from clean70cba65 using the unchanged verified
packaged assets. Standalone native Linux GTX1070/private Xvfb input/resize smoke
passes with enabled Vulkan validation and zero errors; evidence is
artifacts/orbit-camera/horizontal-{build-linux.log,build-windows.log,native.log}.
Native Windows runtime testing remains pending.
2026-11-03. User reports the world flips when using orbit inspection.
This is a modern camera bug; no new original-binary interpretation is needed.
## Cause and correction
Program used System.Numerics CreateLookAt/CreatePerspectiveFieldOfView for
inspection, both right-handed. Gameplay and source geometry use positive-Z
left-handed camera space. At the same eye/target/up, swapping the paired view
and perspective conventions reverses screen X. The old orbit view therefore
mirrored the world relative to gameplay. Vulkan's shared M22 viewport flip is
still required for screen Y; removing that would introduce another inversion.
OrbitCamera now owns the inspector eye/view/projection calculation and uses
CreateLookAtLeftHanded/CreatePerspectiveFieldOfViewLeftHanded. The caller applies
the same single Vulkan Y correction as gameplay. Existing orbit positions,
elevation limits, zoom, field of view and depth range are retained. Gameplay,
scripted and Rocketship cameras keep their existing math.
## Verification
ProjectionTests covers36 combinations of four azimuths, three elevations and
three aspect ratios (4:3,16:9,21:9). Tests independently construct forward/right/up
vectors and verify centered target, screen directions, positive-Z forward and
Vulkan0..1 near/far depth. Existing all35 level clip mappings and actual outside
geometry regression also pass. Main .NET build passes.
Before/after960×720 llvmpipe model captures show the horizontal reflection;
mirroring the old image matches the corrected view to under.0012 mean intensity
per RGB channel, versus2.68–4.77 without reflection. Both runs enable Vulkan
validation and report zero errors. Captures were inspected. The two-frame lab
gameplay readbacks before/after are byte-identical with the same copied assets.
Generated evidence: artifacts/orbit-camera/{projection.log,build.log,before.log,
after.log,comparison.log,comparison.png,gameplay-before.log,gameplay-after.log}.
The first test compile had an ambiguous target-typed Vector4 overload; specifying
Vector4 fixed it before validation.
Native Linux GTX1070/private Xvfb starts the actual orbit path at1920×1080,
receives SDL Right, resizes the swapchain800×600 and renders six frames with
validation enabled and zero errors. Both self-contained packages rebuilt from
clean d8f1b51c8610aeaadc5e1792548c24c74e3a4881 (source_dirty=no). Standalone Linux
from /tmp renders an orbit capture byte-identical to the corrected source
capture using only packaged assets. Its release headless invocation has no
available validation layer. All539 original file hashes verify after packaging.
Additional evidence: artifacts/orbit-camera/{native.log,package.log,
package-provenance.log,package-runtime.log,originals-final.log}. Later
documentation-only changes retain this compiled-source provenance. Native
Windows execution of this correction remains pending.