feat(ludic.anim): skin_joint - a bone looked up in the skin's own joints, not the file's first of that name

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 08:41:51 +03:00
parent 6e2212de7b
commit 473552cc81
4 changed files with 26 additions and 0 deletions

View file

@ -86,6 +86,14 @@ program AnimTest {
expect_near(pose_z(sk), 0.0, 0.001)
}
test "a bone is found in the skin's own joints, not the file's first of that name" {
gltf_doc = Json.parse("{\"nodes\": [{\"name\": \"bone\"}, {\"name\": \"root\", \"children\": [2]}, {\"name\": \"bone\"}], \"skins\": [{\"joints\": [1, 2]}]}")
let sk = skin_load(0)
expect_eq(skin_joint(sk, "bone"), 2)
expect_eq(skin_joint_quiet(sk, "wing_l"), -1)
expect_eq(skin_joint_quiet(null, "bone"), -1)
}
test "no skin or no clip plays nothing" {
expect(not anim_play(null, turn("t"), 0.0, null, 0.0, 0.0))
expect(not anim_play(skin(), null, 0.0, null, 0.0, 0.0))