ludic.anim: a transition may name a via one-shot - a request from from (the state last asked, or "*") to to goes by it when the rig carries its clip, and the one-shot's next hands on. The game's hiker picked sit_down / stand_up / board_boat / leave_boat in code; the set says it now. A via edge is not an edge for a request's own fade. animset_test holds it, with a via the rig has and one it has not.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
986fba3586
commit
96798c0fbb
5 changed files with 45 additions and 4 deletions
|
|
@ -124,4 +124,22 @@ program AnimSetTest {
|
|||
expect(not animset_can(pl, "bow"))
|
||||
expect(not animset_can(pl, "nope"))
|
||||
}
|
||||
|
||||
test "a request goes by its via one-shot when the rig carries it, which hands on; else straight there" (anim_st: mut AnimState, render3d_st: mut Render3dState) {
|
||||
let sk = skin(render3d_st)
|
||||
let pl = rig(anim_st)
|
||||
animset_request(pl, "seat")
|
||||
animset_tick(anim_st, pl, sk, 0.1)
|
||||
expect(playing(pl) == "rig_wave")
|
||||
animset_tick(anim_st, pl, sk, 0.3)
|
||||
animset_tick(anim_st, pl, sk, 0.3)
|
||||
animset_tick(anim_st, pl, sk, 0.016)
|
||||
expect(playing(pl) == "rig_hop")
|
||||
animset_request(pl, "seat")
|
||||
animset_tick(anim_st, pl, sk, 0.016)
|
||||
expect(playing(pl) == "rig_hop")
|
||||
animset_request(pl, "perch")
|
||||
animset_tick(anim_st, pl, sk, 0.016)
|
||||
expect(playing(pl) == "rig_walk")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
# sets.lres - the test's one set: a ground state picking by speed bands, a one-shot that hands back,
|
||||
# a hop the code never asks for, taken when toy_hops says so, and a bow no rig carries
|
||||
# a hop the code never asks for, taken when toy_hops says so, a bow no rig carries, and a seat and a
|
||||
# perch the code asks for by way of a one-shot (settle, which the rig has; bow, which it has not)
|
||||
toy {
|
||||
entry: "ground"
|
||||
params: ["speed"]
|
||||
|
|
@ -15,7 +16,14 @@ toy {
|
|||
},
|
||||
{ key: "wave", loop: false, next: "ground", choices: [{ clip: "wave" }] },
|
||||
{ key: "hop", choices: [{ clip: "hop" }] },
|
||||
{ key: "bow", loop: false, next: "ground", choices: [{ clip: "bow" }] }
|
||||
{ key: "bow", loop: false, next: "ground", choices: [{ clip: "bow" }] },
|
||||
{ key: "settle", loop: false, next: "seat", choices: [{ clip: "wave" }] },
|
||||
{ key: "seat", choices: [{ clip: "hop" }] },
|
||||
{ key: "perch", choices: [{ clip: "walk" }] }
|
||||
]
|
||||
transitions: [
|
||||
{ from: "ground", to: "hop", blend: 0.1, when: fn toy_hops },
|
||||
{ from: "*", to: "seat", via: "settle" },
|
||||
{ from: "*", to: "perch", via: "bow" }
|
||||
]
|
||||
transitions: [{ from: "ground", to: "hop", blend: 0.1, when: fn toy_hops }]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue