transformNode method

Future<void> transformNode(
  1. String id, {
  2. UArVector3? position,
  3. UArQuaternion? rotation,
  4. UArVector3? scale,
  5. bool world = false,
})

Lightweight transform change, cheap enough to call every frame.

Implementation

Future<void> transformNode(String id, {UArVector3? position, UArQuaternion? rotation, UArVector3? scale, bool world = false}) async {
  final UArNode? node = value.nodes[id];
  if (node != null && !world) {
    value = value.copyWith(
      nodes: <String, UArNode>{
        ...value.nodes,
        id: node.copyWith(position: position, rotation: rotation, scale: scale),
      },
    );
  }
  await _invoke<void>("transformNode", <String, Object?>{"id": id, "position": position?.toList(), "rotation": rotation?.toList(), "scale": scale?.toList(), "world": world});
}