place method

void place(
  1. Matrix4 worldFromModelRoot
)

Moves instances for the model root at worldFromModelRoot (engine world from the model's own axes, so including gltfToEngine): rigid meshes to their nodes, skinned ones to the root (their joints place them).

Implementation

void place(Matrix4 worldFromModelRoot) {
  for (final instance in instances) {
    if (instance.skin != null ||
        instance.node < 0 ||
        _skinned(instance.node)) {
      instance.world.setFrom(worldFromModelRoot);
    } else {
      nodeMatrixInto(instance.node, _node);
      instance.world.setProduct(worldFromModelRoot, _node);
    }
    instance.markMoved();
  }
}