setTransform method

void setTransform(
  1. int entity,
  2. Flix3DTransform transform
)

Implementation

void setTransform(int entity, Flix3DTransform transform) {
  _ensureNotDisposed();
  final position = transform.position;
  final rotation = transform.rotationEuler;
  final scale = transform.scale;
  if (_api.setTransform(
        _handle,
        entity,
        position.x,
        position.y,
        position.z,
        rotation.x,
        rotation.y,
        rotation.z,
        scale.x,
        scale.y,
        scale.z,
      ) ==
      0) {
    throw ArgumentError(
      'The native scene rejected entity $entity or its transform.',
    );
  }
}