formatting

This commit is contained in:
Nick Fisher
2025-06-17 11:51:37 +08:00
parent 71bae61015
commit a91aaae131

View File

@@ -18,7 +18,6 @@ import 'dart:async';
/// using the methods directly via FilamentApp.instance; /// using the methods directly via FilamentApp.instance;
/// ///
abstract class ThermionViewer { abstract class ThermionViewer {
/// ///
/// ///
/// ///
@@ -138,33 +137,33 @@ abstract class ThermionViewer {
/// ///
/// Load the glTF asset at the given path (.glb or .gltf) /// Load the glTF asset at the given path (.glb or .gltf)
/// ///
/// If the file is a .gltf and [resourceUri] is not specified, /// If the file is a .gltf and [resourceUri] is not specified,
/// all resources will be loaded relative to the URI of the file (so if /// all resources will be loaded relative to the URI of the file (so if
/// [uri] is asset://assets/scene.gltf, the loader will attempt to load /// [uri] is asset://assets/scene.gltf, the loader will attempt to load
/// asset://assets/scene.bin, asset://assets/texture.png, and so on). /// asset://assets/scene.bin, asset://assets/texture.png, and so on).
/// ///
/// If [resourceUri] is specified, resources will be loaded relative to /// If [resourceUri] is specified, resources will be loaded relative to
/// that path. /// that path.
/// ///
/// If [addToScene] is [true], all renderable entities (including lights) /// If [addToScene] is [true], all renderable entities (including lights)
/// in the asset will be added to the scene. /// in the asset will be added to the scene.
/// ///
/// If you want to dynamically create instances of this asset after it is /// If you want to dynamically create instances of this asset after it is
/// instantiated, pass [kee] /// instantiated, pass [kee]
/// Alternatively, specifying [numInstances] will pre-allocate the specified /// Alternatively, specifying [numInstances] will pre-allocate the specified
/// number of instances. This is more efficient than dynamically instantating at a later time. /// number of instances. This is more efficient than dynamically instantating at a later time.
/// You can then retrieve the created instances with [getInstances]. /// You can then retrieve the created instances with [getInstances].
/// ///
/// If [keepData] is false and [numInstances] is 1, /// If [keepData] is false and [numInstances] is 1,
/// the source glTF data will be released and [createInstance] /// the source glTF data will be released and [createInstance]
/// will throw an exception. /// will throw an exception.
/// ///
/// ///
Future<ThermionAsset> loadGltf(String uri, Future<ThermionAsset> loadGltf(String uri,
{ bool addToScene = true, {bool addToScene = true,
int numInstances = 1, int numInstances = 1,
bool keepData = false, bool keepData = false,
String? resourceUri, String? resourceUri,
bool loadAsync = false}); bool loadAsync = false});
@@ -178,15 +177,15 @@ abstract class ThermionViewer {
/// be loaded asynchronously (so expect some material/texture pop-in); /// be loaded asynchronously (so expect some material/texture pop-in);
/// ///
/// ///
Future<ThermionAsset> loadGltfFromBuffer(Uint8List data, Future<ThermionAsset> loadGltfFromBuffer(
{ Uint8List data, {
String? resourceUri, String? resourceUri,
int numInstances = 1, int numInstances = 1,
bool keepData = false, bool keepData = false,
int priority = 4, int priority = 4,
int layer = 0, int layer = 0,
bool loadResourcesAsync = false, bool loadResourcesAsync = false,
}); });
/// ///
/// Destroys [asset] and all underlying resources /// Destroys [asset] and all underlying resources
@@ -216,14 +215,14 @@ abstract class ThermionViewer {
Future setViewFrustumCulling(bool enabled); Future setViewFrustumCulling(bool enabled);
/// ///
/// Sets the viewport sizes and updates all cameras to use the new aspect ratio. /// Sets the viewport sizes and updates all cameras to use the new aspect ratio.
/// ///
Future setViewport(int width, int height); Future setViewport(int width, int height);
/// ///
/// ///
/// ///
Future setLayerVisibility(VisibilityLayers layer, bool visible); Future setLayerVisibility(VisibilityLayers layer, bool visible);
/// ///
/// Set the world space position for [lightEntity] to the given coordinates. /// Set the world space position for [lightEntity] to the given coordinates.
@@ -270,7 +269,9 @@ abstract class ThermionViewer {
/// ///
/// ///
Future<ThermionAsset> createGeometry(Geometry geometry, Future<ThermionAsset> createGeometry(Geometry geometry,
{List<MaterialInstance>? materialInstances, bool keepData = false, bool addToScene=true}); {List<MaterialInstance>? materialInstances,
bool keepData = false,
bool addToScene = true});
/// ///
/// Returns a gizmo for translating/rotating objects. /// Returns a gizmo for translating/rotating objects.
@@ -325,9 +326,9 @@ abstract class ThermionViewer {
/// ///
/// Adds the asset to the scene, meaning the asset will be rendered/visible. /// Adds the asset to the scene, meaning the asset will be rendered/visible.
/// ///
Future addToScene(covariant ThermionAsset asset); Future addToScene(covariant ThermionAsset asset);
/// ///
/// Removes the asset from the scene, meaning the asset will not be rendered/visible. /// Removes the asset from the scene, meaning the asset will not be rendered/visible.
/// The asset itself will remain valid. /// The asset itself will remain valid.