Repository navigation
Blend the first-person weapon's own fast animations between ticks - #530
Merged
Merged
Conversation
A rocket launcher's melee was drawn at 30 Hz at any frame rate. The first-person pose was blended between ticks only while no node moved more than 0.25 world units relative to the camera in a tick, a limit meant to tell another weapon's skeleton from this one moving; the rocket launcher's melee (and other wide, fast animations) moves further, so the whole pose snapped every tick of the swing. The pose now remembers the weapon and the animation graph it was of, and blends only from the same weapon's and graph's pose of the tick just before, so a weapon switch, even between two frames of a tick, still snaps while the weapon's own animations blend however far they move. A position that is not a number still snaps the pose. A node whose two rotations are about half a turn apart (the rocket launcher's barrels set back after a shot) snaps alone, since which way it turned cannot be told; the other nodes still blend. Only what is drawn changes, nothing the machines send or agree on: no network version change. Checked: ninja windows; tools/harness/tests/test_first_person_interpolation.py (8 cases, and 6 negative controls, the old 0.25 limit among them, that fail); the whole harness on Windows fails the same 632 tests as testing does (the Windows environment's) and passes the 14 new ones. Not built for Android or the web here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
A rocket launcher's melee was drawn at 30 Hz at any frame rate.
The first-person pose (
render_interpolation_first_person) was blended between ticks only while no node moved more than 0.25 world units relative to the camera in a tick. That limit was there to tell another weapon's skeleton from this one moving, but the rocket launcher's melee, and other wide, fast animations, move further, so the whole pose snapped on every tick of the swing.Changes
first_person_weapon_build_node_matricespasses the weapon and its first-person animation graph (aport:change insource/interface/first_person_weapons.c).Only what is drawn changes, nothing the machines send or agree on, so the network version is unchanged.
Checked
ninja windows.tools/harness/tests/test_first_person_interpolation.py: 8 cases (melee, weapon and graph switches, a switch within a tick, a gap, a node not a number, a half turn, a 170° turn) and 6 negative controls that must fail, the old 0.25 limit among them.testingdoes there (the Windows environment's) and passes the 14 new ones.🤖 Generated with Claude Code