Files
sanspie 515f4ca1b3 Stage 11a: animation (D333–D340, D344, D354–D357)
Clips (.aeanim) and controllers (.aectrl) with importers, AnimationPlayer and Animator with crossfades, root motion and events on fixed steps, rewind support. Editor: Animation panel (dope sheet, curves, record, preview, trajectory), Animator panel, sprite sheet slicer and flipbooks, Programming workspace, export panel redesign. Motion 2D ledge climb. 11c: the component and Create palette.
2026-10-25 15:31:22 +03:00

47 lines
1.1 KiB
Go

package animation_test
import (
"slices"
"testing"
"aego/app/assembly"
"aego/app/assembly/builtin"
"aego/engine"
"aego/modules/animation"
"aego/modules/gameplay"
"aego/scene/frame"
"aego/script/bind"
)
func TestFixedOrder(t *testing.T) {
types, err := assembly.NewTypes()
if err != nil {
t.Fatal(err)
}
man, err := builtin.Default().Load(types, bind.New(), assembly.Options{})
if err != nil {
t.Fatal(err)
}
b := engine.NewBuilder(engine.Config{Headless: true})
if err := frame.Register(b.Registry()); err != nil {
t.Fatal(err)
}
b.Use(man.Engine())
reg := b.Registry()
if err := reg.Freeze(); err != nil {
t.Fatal(err)
}
order := reg.Systems().Order(engine.PhasePrePhysics)
at := func(id string) int {
i := slices.Index(order, id)
if i < 0 {
t.Fatalf("%s is not in PrePhysics: %v", id, order)
}
return i
}
fsm, intents, anim, motion, move := at(gameplay.SystemFSMFixed), at(engine.AnchorIntents), at(animation.SystemFixed), at(engine.AnchorMotion), at(gameplay.SystemMotion)
if !(fsm < intents && intents < anim && anim < motion && motion < move) {
t.Fatalf("PrePhysics order %v", order)
}
}