hide method

  1. @override
Future hide(
  1. ThermionEntity entity,
  2. String? meshName
)
override

If meshName is provided, hide the node meshName under entity, otherwise hide the root node for entity. The entity still exists in memory, but is no longer being rendered into the scene. Call reveal to re-commence rendering.

Implementation

@override
Future hide(ThermionEntity entity, String? meshName) async {
  if (meshName != null) {
    final result = _module.ccall(
        "hide_mesh",
        "int",
        ["void*".toJS, "int".toJS, "string".toJS].toJS,
        [_sceneManager!, entity.toJS, meshName.toJS].toJS,
        null) as JSNumber;
    if (result.toDartInt == -1) {
      throw Exception(
          "Failed to hide mesh ${meshName} on entity ${entity.toJS}");
    }
  } else {
    throw Exception(
        "Cannot hide mesh, meshName must be specified when invoking this method");
  }
}