transformNode method
Future<void>
transformNode(
- String id, {
- UArVector3? position,
- UArQuaternion? rotation,
- UArVector3? scale,
- 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});
}