UArNode.image constructor

UArNode.image({
  1. required String id,
  2. required UArSource source,
  3. double width = 0.3,
  4. String? anchorId,
  5. String? parentId,
  6. UArVector3 position = UArVector3.zero,
  7. UArQuaternion rotation = UArQuaternion.identity,
  8. UArBillboard billboard = UArBillboard.none,
  9. bool unlit = true,
  10. bool renderOnTop = false,
  11. double opacity = 1,
  12. Map<String, Object?> data = const <String, Object?>{},
})

An image on a quad; width in metres, height follows the image aspect.

Implementation

factory UArNode.image({
  required String id,
  required UArSource source,
  double width = 0.3,
  String? anchorId,
  String? parentId,
  UArVector3 position = UArVector3.zero,
  UArQuaternion rotation = UArQuaternion.identity,
  UArBillboard billboard = UArBillboard.none,
  bool unlit = true,
  bool renderOnTop = false,
  double opacity = 1,
  Map<String, Object?> data = const <String, Object?>{},
}) => UArNode(
  id: id,
  type: UArNodeType.image,
  source: source,
  width: width,
  height: 0,
  anchorId: anchorId,
  parentId: parentId,
  position: position,
  rotation: rotation,
  billboard: billboard,
  material: UArMaterial(unlit: unlit, doubleSided: true, renderOnTop: renderOnTop, opacity: opacity),
  castShadow: false,
  data: data,
);