Skip to content

Animation

David Komer edited this page Jun 3, 2018 · 8 revisions

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

This is required to avoid traversing the tree unnecessarily. If the animations pointed at nodes, the way it's setup in the loaded gltf file, they'd need to be found by a value on the node (such as originalId) rather than via a table lookup.

2. Animation updates are by the caller

Animations don't do anything other than update scene data. This is related to the overall architecture in 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