Gameplay tests: fix the camera-measured yaw, expose the aim tolerance - #8939
Merged
Conversation
The world direction a 3D camera looks at is its angle minus 90 (games set the camera angle to 'facing + 90'): getRelativePosition's fromCamera yaw was off by that offset, turning the view away when driven to zero. Also expose toleranceDegrees on lookTowardWithMouseDelta (default 3): a shooting test needs 'aimed well enough to hit', which can be under a degree on a far target. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaQQdPZ68X8zkybtsxWE1b
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.
Both issues reported from the starter tests were valid:
angle - 90: with the ZYX rotation order, a camera pitched to the horizon faces the former "screen-up" direction, which is why games (e.g.LookFromObjectEyes) set the camera angle tofacing + 90.getRelativePosition'sfromCamerayaw now subtracts that offset — the reportedyawDiff: -90.04while demonstrably facing the target becomes ~0, andlookTowardWithMouseDelta's camera mode inherits the fix. (The pitch from the same call was already exact.)toleranceDegreesexposed onlookTowardWithMouseDelta(default 3): a shooting test needs "aimed well enough to hit", which can be under a degree on a small or far target — at 1.3° off the helper reportedaimed: trueand a second call stepped zero frames.Validated: GDJS type-check and build clean, harness karma suite 32/32.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AaQQdPZ68X8zkybtsxWE1b
Generated by Claude Code