From dff3cc21faf083f54d0018f39c307c39d2033a12 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Wed, 11 Sep 2024 18:04:36 +0800 Subject: [PATCH] add loadGlbFromBuffer method and normals param to ThermionViewer --- thermion_dart/lib/thermion_dart/thermion_viewer.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/thermion_dart/lib/thermion_dart/thermion_viewer.dart b/thermion_dart/lib/thermion_dart/thermion_viewer.dart index 2bb61c00..d1e2c225 100644 --- a/thermion_dart/lib/thermion_dart/thermion_viewer.dart +++ b/thermion_dart/lib/thermion_dart/thermion_viewer.dart @@ -206,6 +206,15 @@ abstract class ThermionViewer { Future loadGlb(String path, {int numInstances = 1, bool keepData = false}); + /// + /// Load the .glb asset from the specified buffer and insert into the scene. + /// Specify [numInstances] to create multiple instances (this is more efficient than dynamically instantating at a later time). You can then retrieve the created instances with [getInstances]. + /// If you want to be able to call [createInstance] at a later time, you must pass true for [keepData]. + /// If [keepData] is false, the source glTF data will be released and [createInstance] will throw an exception. + /// + Future loadGlbFromBuffer(Uint8List data, + {int numInstances = 1, bool keepData = false}); + /// /// Create a new instance of [entity]. /// @@ -770,6 +779,7 @@ abstract class ThermionViewer { /// Future createGeometry(List vertices, List indices, {String? materialPath, + List? normals, PrimitiveType primitiveType = PrimitiveType.TRIANGLES}); ///