Skip to content

Animation

David Komer edited this page May 27, 2018 · 8 revisions

1. Nodes point at animations (not the other way around)

This is required because nodes are ephemeral. If the animations pointed at nodes, the way it's setup in the loaded gltf file, there would be missing references as nodes get modified immutably or removed.

Additionally, a node cannot be found by searching (since it would only be search by value).

2. Animation updates are by the caller

Animations don't do anything other than update scene data. Since the overall concept is that the caller will likely be able to optimize scene updates better than the lib (e.g. culling invisible nodes, using webassembly, etc.)

However, there are two mechanisms that make working with animations a breeze:

  1. Animation Data is parsed on the data side, into simple interfaces that can be serialised for passing alongside the scene
  2. There are provided helpers if the caller on the js side wants to create simple functions. It can also be used as inspiration or copied out.
Clone this wiki locally