writeTransforms method

void writeTransforms(
  1. Pointer<Uint64> ids,
  2. int count,
  3. Pointer<Float> transforms
)

Sets the transforms of count objects, by their GameObject.ids at ids, from transforms: ten 32-bit floats each, as readWorldTransforms writes them, but each relative to its object's parent, as GameObject.transform is. For a package that works out many poses natively (an animator, particles): one call however many there are, each sent with the frame's other moves. Throws an ArgumentError if an id isn't a live object or a transform isn't valid; those before it are set.

Implementation

void writeTransforms(Pointer<Uint64> ids, int count, Pointer<Float> transforms) {
  pointer;
  for (var i = 0; i < count; i++) {
    final id = ids[i];
    final object = _objects[id];
    if (object == null || object._destroyed) {
      throw ArgumentError.value(id, 'ids[$i]', 'not a live object of this world');
    }
    final f = transforms + i * 10;
    object.transform = Transform._(Vec3(f[0], f[1], f[2]), Quat(f[3], f[4], f[5], f[6]), Vec3(f[7], f[8], f[9]));
  }
}