Game Engine Architecture

(Ben Green) #1

572 11. Animation Systems


:tree
(anim-node-lerp
(anim-node-additive
(anim-node-additive
(anim-node-clip "move-f")
(anim-node-clip "move-f-look-lr")
)
(anim-node-clip "move-f-look-ud")
)
(anim-node-additive
(anim-node-additive
(anim-node-clip "move-b")
(anim-node-clip "move-b-look-lr")
)
(anim-node-clip "move-b-look-ud")
)
)
)
This corresponds to the tree shown in Figure 11.56.

Custom Tree Syntax
Thanks to the powerful macro language in Scheme, custom blend trees can
also be defi ned by the user in terms of the basic clip, LERP, and additive blend
nodes. This allows us to defi ne multiple states, each of which has a nearly
identical tree structure but with diff erent input clips or any number of other
variations. For example, the complex blend tree used in the state “move-b-to-
f” shown above could be partially defi ned via a macro as follows:
(define-syntax look-tree
(syntax-rules ()

LERP

move-f
move-f-look-lr

+

move-f-look-ud

move-b
move-b-look-lr

+

move-b-look-ud

+

+

Figure 11.56. Blend tree corresponding to the example state “move-b-to-f.”
Free download pdf