setCamera method

  1. @override
Future setCamera(
  1. ThermionEntity entity,
  2. String? name
)
override

Sets the current scene camera to the glTF camera under name in entity.

Implementation

@override
Future setCamera(ThermionEntity entity, String? name) async {
  final result = _module.ccall(
      "set_camera",
      "bool",
      ["void*".toJS, "int".toJS, "string".toJS].toJS,
      [_viewer!, entity.toJS, (name ?? "").toJS].toJS,
      null) as JSBoolean;
  if (!result.toDart) {
    throw Exception("Failed to set camera to entity ${entity}");
  }
}