fromGlbAsset static method

Future<Node> fromGlbAsset(
  1. String assetPath, {
  2. GltfWarningCallback? onWarning,
})

Convenience wrapper for fromGlbBytes that loads from the asset bundle.

Implementation

static Future<Node> fromGlbAsset(
  String assetPath, {
  GltfWarningCallback? onWarning,
}) async {
  final byteData = await rootBundle.load(assetPath);
  return importGlb(
    byteData.buffer.asUint8List(
      byteData.offsetInBytes,
      byteData.lengthInBytes,
    ),
    onWarning: onWarning,
  );
}