@onerjs/loaders 8.23.1 → 8.23.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/OBJ/mtlFileLoader.d.ts +4 -4
- package/OBJ/mtlFileLoader.js +3 -3
- package/OBJ/mtlFileLoader.js.map +1 -1
- package/OBJ/objFileLoader.d.ts +5 -5
- package/OBJ/objFileLoader.js +5 -5
- package/OBJ/objFileLoader.js.map +1 -1
- package/OBJ/objLoadingOptions.d.ts +1 -1
- package/OBJ/solidParser.d.ts +4 -4
- package/OBJ/solidParser.js +8 -8
- package/OBJ/solidParser.js.map +1 -1
- package/SPLAT/splatFileLoader.d.ts +4 -4
- package/SPLAT/splatFileLoader.js +10 -10
- package/SPLAT/splatFileLoader.js.map +1 -1
- package/STL/stlFileLoader.d.ts +7 -7
- package/STL/stlFileLoader.js +6 -6
- package/STL/stlFileLoader.js.map +1 -1
- package/bvh/bvhFileLoader.d.ts +4 -4
- package/bvh/bvhFileLoader.js +3 -3
- package/bvh/bvhFileLoader.js.map +1 -1
- package/bvh/bvhLoader.d.ts +4 -4
- package/bvh/bvhLoader.js +5 -5
- package/bvh/bvhLoader.js.map +1 -1
- package/dynamic.js +1 -1
- package/dynamic.js.map +1 -1
- package/glTF/1.0/glTFBinaryExtension.d.ts +1 -1
- package/glTF/1.0/glTFLoader.d.ts +6 -6
- package/glTF/1.0/glTFLoader.js +25 -25
- package/glTF/1.0/glTFLoader.js.map +1 -1
- package/glTF/1.0/glTFLoaderInterfaces.d.ts +7 -7
- package/glTF/1.0/glTFLoaderUtils.d.ts +4 -4
- package/glTF/1.0/glTFLoaderUtils.js +5 -5
- package/glTF/1.0/glTFLoaderUtils.js.map +1 -1
- package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +1 -1
- package/glTF/1.0/glTFMaterialsCommonExtension.js +9 -9
- package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_lights_ies.d.ts +2 -2
- package/glTF/2.0/Extensions/EXT_lights_ies.js +5 -5
- package/glTF/2.0/Extensions/EXT_lights_ies.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +2 -2
- package/glTF/2.0/Extensions/EXT_lights_image_based.js +3 -3
- package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_materials_diffuse_roughness.d.ts +2 -2
- package/glTF/2.0/Extensions/EXT_materials_diffuse_roughness.js +2 -2
- package/glTF/2.0/Extensions/EXT_materials_diffuse_roughness.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +3 -3
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +2 -2
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +1 -1
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js +1 -1
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_texture_avif.d.ts +2 -2
- package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +2 -2
- package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_animation_pointer.d.ts +3 -3
- package/glTF/2.0/Extensions/KHR_animation_pointer.data.js +2 -2
- package/glTF/2.0/Extensions/KHR_animation_pointer.data.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_animation_pointer.js +1 -1
- package/glTF/2.0/Extensions/KHR_animation_pointer.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +4 -4
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +2 -2
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js +2 -2
- package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.d.ts +5 -5
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.js +2 -2
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js +2 -2
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity.d.ts +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity.js +4 -4
- package/glTF/2.0/Extensions/KHR_interactivity.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_lights_punctual.js +6 -6
- package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_anisotropy.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_materials_anisotropy.js +1 -1
- package/glTF/2.0/Extensions/KHR_materials_anisotropy.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +1 -1
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.js +2 -2
- package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_dispersion.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_materials_dispersion.js +1 -1
- package/glTF/2.0/Extensions/KHR_materials_dispersion.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +1 -1
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_materials_ior.js +1 -1
- package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_iridescence.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_materials_iridescence.js +1 -1
- package/glTF/2.0/Extensions/KHR_materials_iridescence.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +2 -2
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_materials_sheen.js +2 -2
- package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_materials_specular.js +3 -3
- package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_materials_transmission.js +5 -5
- package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_materials_unlit.js +2 -2
- package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +3 -3
- package/glTF/2.0/Extensions/KHR_materials_variants.js +1 -1
- package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_materials_volume.js +1 -1
- package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_texture_transform.js +1 -1
- package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +4 -4
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js +6 -6
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_lod.d.ts +5 -5
- package/glTF/2.0/Extensions/MSFT_lod.js +2 -2
- package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +2 -2
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +1 -1
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +2 -2
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +1 -1
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
- package/glTF/2.0/Extensions/gltfPathToObjectConverter.d.ts +2 -2
- package/glTF/2.0/Extensions/objectModelMapping.d.ts +12 -12
- package/glTF/2.0/Extensions/objectModelMapping.js +4 -4
- package/glTF/2.0/Extensions/objectModelMapping.js.map +1 -1
- package/glTF/2.0/glTFLoader.d.ts +19 -19
- package/glTF/2.0/glTFLoader.js +24 -24
- package/glTF/2.0/glTFLoader.js.map +1 -1
- package/glTF/2.0/glTFLoaderAnimation.d.ts +3 -3
- package/glTF/2.0/glTFLoaderAnimation.js +2 -2
- package/glTF/2.0/glTFLoaderAnimation.js.map +1 -1
- package/glTF/2.0/glTFLoaderExtension.d.ts +12 -12
- package/glTF/2.0/glTFLoaderExtensionRegistry.js +1 -1
- package/glTF/2.0/glTFLoaderExtensionRegistry.js.map +1 -1
- package/glTF/2.0/glTFLoaderInterfaces.d.ts +9 -9
- package/glTF/glTFFileLoader.d.ts +15 -15
- package/glTF/glTFFileLoader.js +8 -8
- package/glTF/glTFFileLoader.js.map +1 -1
- package/glTF/glTFValidation.js +1 -1
- package/glTF/glTFValidation.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Animation } from "@
|
|
2
|
-
import { Quaternion, Vector3 } from "@
|
|
1
|
+
import { Animation } from "@onerjs/core/Animations/animation.js";
|
|
2
|
+
import { Quaternion, Vector3 } from "@onerjs/core/Maths/math.vector.js";
|
|
3
3
|
import type { INode } from "./glTFLoaderInterfaces.js";
|
|
4
|
-
import type { IAnimatable } from "@
|
|
4
|
+
import type { IAnimatable } from "@onerjs/core/Animations/animatable.interface.js";
|
|
5
5
|
/** @internal */
|
|
6
6
|
export type GetValueFn = (target: any, source: Float32Array, offset: number, scale: number) => any;
|
|
7
7
|
/** @internal */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Animation } from "@
|
|
2
|
-
import { Quaternion, Vector3 } from "@
|
|
1
|
+
import { Animation } from "@onerjs/core/Animations/animation.js";
|
|
2
|
+
import { Quaternion, Vector3 } from "@onerjs/core/Maths/math.vector.js";
|
|
3
3
|
import { SetInterpolationForKey } from "./Extensions/objectModelMapping.js";
|
|
4
4
|
/** @internal */
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glTFLoaderAnimation.js","sourceRoot":"","sources":["../../../../../dev/loaders/src/glTF/2.0/glTFLoaderAnimation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"glTFLoaderAnimation.js","sourceRoot":"","sources":["../../../../../dev/loaders/src/glTF/2.0/glTFLoaderAnimation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,6CAAkC;AACtD,OAAO,EAAE,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EAAE,CAAC,IAAI,kCAAkC,CAAC,SAAS,CAAC,qBAAqB,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrJ,sBAAsB,CAAC,mBAAmB,EAAE,CAAC,IAAI,2BAA2B,CAAC,SAAS,CAAC,mBAAmB,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAiB,CAAC,CAAC,CAAC,CAAC","sourcesContent":["import { Animation } from \"core/Animations/animation\";\r\nimport { Quaternion, Vector3 } from \"core/Maths/math.vector\";\r\nimport type { INode } from \"./glTFLoaderInterfaces\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport { SetInterpolationForKey } from \"./Extensions/objectModelMapping\";\r\n\r\n/** @internal */\r\nexport type GetValueFn = (target: any, source: Float32Array, offset: number, scale: number) => any;\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function getVector3(_target: any, source: Float32Array, offset: number, scale: number): Vector3 {\r\n return Vector3.FromArray(source, offset).scaleInPlace(scale);\r\n}\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function getQuaternion(_target: any, source: Float32Array, offset: number, scale: number): Quaternion {\r\n return Quaternion.FromArray(source, offset).scaleInPlace(scale);\r\n}\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function getWeights(target: INode, source: Float32Array, offset: number, scale: number): Array<number> {\r\n const value = new Array<number>(target._numMorphTargets!);\r\n for (let i = 0; i < value.length; i++) {\r\n value[i] = source[offset++] * scale;\r\n }\r\n\r\n return value;\r\n}\r\n\r\n/** @internal */\r\nexport abstract class AnimationPropertyInfo {\r\n /** @internal */\r\n public constructor(\r\n public readonly type: number,\r\n public readonly name: string,\r\n public readonly getValue: GetValueFn,\r\n public readonly getStride: (target: any) => number\r\n ) {}\r\n\r\n protected _buildAnimation(name: string, fps: number, keys: any[]): Animation {\r\n const babylonAnimation = new Animation(name, this.name, fps, this.type);\r\n babylonAnimation.setKeys(keys);\r\n return babylonAnimation;\r\n }\r\n\r\n /** @internal */\r\n public abstract buildAnimations(target: any, name: string, fps: number, keys: any[]): { babylonAnimatable: IAnimatable; babylonAnimation: Animation }[];\r\n}\r\n\r\n/** @internal */\r\nexport class TransformNodeAnimationPropertyInfo extends AnimationPropertyInfo {\r\n /** @internal */\r\n public buildAnimations(target: INode, name: string, fps: number, keys: any[]) {\r\n const babylonAnimations: { babylonAnimatable: IAnimatable; babylonAnimation: Animation }[] = [];\r\n babylonAnimations.push({ babylonAnimatable: target._babylonTransformNode!, babylonAnimation: this._buildAnimation(name, fps, keys) });\r\n return babylonAnimations;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class WeightAnimationPropertyInfo extends AnimationPropertyInfo {\r\n public buildAnimations(target: INode, name: string, fps: number, keys: any[]) {\r\n const babylonAnimations: { babylonAnimatable: IAnimatable; babylonAnimation: Animation }[] = [];\r\n if (target._numMorphTargets) {\r\n for (let targetIndex = 0; targetIndex < target._numMorphTargets; targetIndex++) {\r\n const babylonAnimation = new Animation(`${name}_${targetIndex}`, this.name, fps, this.type);\r\n babylonAnimation.setKeys(\r\n keys.map((key) => ({\r\n frame: key.frame,\r\n inTangent: key.inTangent ? key.inTangent[targetIndex] : undefined,\r\n value: key.value[targetIndex],\r\n outTangent: key.outTangent ? key.outTangent[targetIndex] : undefined,\r\n interpolation: key.interpolation,\r\n }))\r\n );\r\n\r\n if (target._primitiveBabylonMeshes) {\r\n for (const babylonMesh of target._primitiveBabylonMeshes) {\r\n if (babylonMesh.morphTargetManager) {\r\n const morphTarget = babylonMesh.morphTargetManager.getTarget(targetIndex);\r\n const babylonAnimationClone = babylonAnimation.clone();\r\n morphTarget.animations.push(babylonAnimationClone);\r\n babylonAnimations.push({ babylonAnimatable: morphTarget, babylonAnimation: babylonAnimationClone });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return babylonAnimations;\r\n }\r\n}\r\n\r\nSetInterpolationForKey(\"/nodes/{}/translation\", [new TransformNodeAnimationPropertyInfo(Animation.ANIMATIONTYPE_VECTOR3, \"position\", getVector3, () => 3)]);\r\nSetInterpolationForKey(\"/nodes/{}/rotation\", [new TransformNodeAnimationPropertyInfo(Animation.ANIMATIONTYPE_QUATERNION, \"rotationQuaternion\", getQuaternion, () => 4)]);\r\nSetInterpolationForKey(\"/nodes/{}/scale\", [new TransformNodeAnimationPropertyInfo(Animation.ANIMATIONTYPE_VECTOR3, \"scaling\", getVector3, () => 3)]);\r\nSetInterpolationForKey(\"/nodes/{}/weights\", [new WeightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"influence\", getWeights, (target) => target._numMorphTargets!)]);\r\n"]}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { Nullable } from "@
|
|
2
|
-
import type { Animation } from "@
|
|
3
|
-
import type { AnimationGroup } from "@
|
|
4
|
-
import type { Material } from "@
|
|
5
|
-
import type { Camera } from "@
|
|
6
|
-
import type { Geometry } from "@
|
|
7
|
-
import type { TransformNode } from "@
|
|
8
|
-
import type { BaseTexture } from "@
|
|
9
|
-
import type { Mesh } from "@
|
|
10
|
-
import type { AbstractMesh } from "@
|
|
11
|
-
import type { IDisposable } from "@
|
|
1
|
+
import type { Nullable } from "@onerjs/core/types.js";
|
|
2
|
+
import type { Animation } from "@onerjs/core/Animations/animation.js";
|
|
3
|
+
import type { AnimationGroup } from "@onerjs/core/Animations/animationGroup.js";
|
|
4
|
+
import type { Material } from "@onerjs/core/Materials/material.js";
|
|
5
|
+
import type { Camera } from "@onerjs/core/Cameras/camera.js";
|
|
6
|
+
import type { Geometry } from "@onerjs/core/Meshes/geometry.js";
|
|
7
|
+
import type { TransformNode } from "@onerjs/core/Meshes/transformNode.js";
|
|
8
|
+
import type { BaseTexture } from "@onerjs/core/Materials/Textures/baseTexture.js";
|
|
9
|
+
import type { Mesh } from "@onerjs/core/Meshes/mesh.js";
|
|
10
|
+
import type { AbstractMesh } from "@onerjs/core/Meshes/abstractMesh.js";
|
|
11
|
+
import type { IDisposable } from "@onerjs/core/scene.js";
|
|
12
12
|
import type { IScene, INode, IMesh, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation, ITexture, IBufferView, IBuffer, IAnimationChannel } from "./glTFLoaderInterfaces.js";
|
|
13
13
|
import type { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from "../glTFFileLoader.js";
|
|
14
14
|
import type { IProperty } from "babylonjs-gltf2interface";
|
|
15
|
-
import type { IAnimatable } from "@
|
|
15
|
+
import type { IAnimatable } from "@onerjs/core/Animations/animatable.interface.js";
|
|
16
16
|
/**
|
|
17
17
|
* Interface for a glTF loader extension.
|
|
18
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glTFLoaderExtensionRegistry.js","sourceRoot":"","sources":["../../../../../dev/loaders/src/glTF/2.0/glTFLoaderExtensionRegistry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"glTFLoaderExtensionRegistry.js","sourceRoot":"","sources":["../../../../../dev/loaders/src/glTF/2.0/glTFLoaderExtensionRegistry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,oCAAyB;AAS1C,MAAM,wBAAwB,GAAG,IAAI,GAAG,EAAoC,CAAC;AAE7E;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,wBAAwB,GAA4D,wBAAwB,CAAC;AAE1H;;;;;GAKG;AACH,gEAAgE;AAChE,MAAM,UAAU,qBAAqB,CAAC,IAAY,EAAE,eAAwB,EAAE,OAA6B;IACvG,IAAI,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC;QAChC,MAAM,CAAC,IAAI,CAAC,4BAA4B,IAAI,kBAAkB,CAAC,CAAC;IACpE,CAAC;IAED,wBAAwB,CAAC,GAAG,CAAC,IAAI,EAAE;QAC/B,eAAe;QACf,OAAO;KACV,CAAC,CAAC;AACP,CAAC;AAED;;;;GAIG;AACH,gEAAgE;AAChE,MAAM,UAAU,uBAAuB,CAAC,IAAY;IAChD,OAAO,wBAAwB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import type { GLTFLoader } from \"./glTFLoader\";\r\nimport type { IGLTFLoaderExtension } from \"./glTFLoaderExtension\";\r\n\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\ninterface IRegisteredGLTFExtension {\r\n isGLTFExtension: boolean;\r\n factory: GLTFExtensionFactory;\r\n}\r\n\r\nexport type GLTFExtensionFactory = (loader: GLTFLoader) => IGLTFLoaderExtension | Promise<IGLTFLoaderExtension>;\r\n\r\nconst RegisteredGLTFExtensions = new Map<string, IRegisteredGLTFExtension>();\r\n\r\n/**\r\n * All currently registered glTF 2.0 loader extensions.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const registeredGLTFExtensions: ReadonlyMap<string, Readonly<IRegisteredGLTFExtension>> = RegisteredGLTFExtensions;\r\n\r\n/**\r\n * Registers a loader extension.\r\n * @param name The name of the loader extension.\r\n * @param isGLTFExtension If the loader extension is a glTF extension, then it will only be used for glTF files that use the corresponding glTF extension. Otherwise, it will be used for all loaded glTF files.\r\n * @param factory The factory function that creates the loader extension.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function registerGLTFExtension(name: string, isGLTFExtension: boolean, factory: GLTFExtensionFactory): void {\r\n if (unregisterGLTFExtension(name)) {\r\n Logger.Warn(`Extension with the name '${name}' already exists`);\r\n }\r\n\r\n RegisteredGLTFExtensions.set(name, {\r\n isGLTFExtension,\r\n factory,\r\n });\r\n}\r\n\r\n/**\r\n * Unregisters a loader extension.\r\n * @param name The name of the loader extension.\r\n * @returns A boolean indicating whether the extension has been unregistered\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function unregisterGLTFExtension(name: string): boolean {\r\n return RegisteredGLTFExtensions.delete(name);\r\n}\r\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { AnimationGroup } from "@
|
|
2
|
-
import type { Skeleton } from "@
|
|
3
|
-
import type { Material } from "@
|
|
4
|
-
import type { TransformNode } from "@
|
|
5
|
-
import type { Buffer, VertexBuffer } from "@
|
|
6
|
-
import type { AbstractMesh } from "@
|
|
7
|
-
import type { Mesh } from "@
|
|
8
|
-
import type { Camera } from "@
|
|
9
|
-
import type { Light } from "@
|
|
1
|
+
import type { AnimationGroup } from "@onerjs/core/Animations/animationGroup.js";
|
|
2
|
+
import type { Skeleton } from "@onerjs/core/Bones/skeleton.js";
|
|
3
|
+
import type { Material } from "@onerjs/core/Materials/material.js";
|
|
4
|
+
import type { TransformNode } from "@onerjs/core/Meshes/transformNode.js";
|
|
5
|
+
import type { Buffer, VertexBuffer } from "@onerjs/core/Buffers/buffer.js";
|
|
6
|
+
import type { AbstractMesh } from "@onerjs/core/Meshes/abstractMesh.js";
|
|
7
|
+
import type { Mesh } from "@onerjs/core/Meshes/mesh.js";
|
|
8
|
+
import type { Camera } from "@onerjs/core/Cameras/camera.js";
|
|
9
|
+
import type { Light } from "@onerjs/core/Lights/light.js";
|
|
10
10
|
import type * as GLTF2 from "babylonjs-gltf2interface";
|
|
11
11
|
/**
|
|
12
12
|
* Loader interface with an index field.
|
package/glTF/glTFFileLoader.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import type * as GLTF2 from "babylonjs-gltf2interface";
|
|
2
|
-
import type { Nullable } from "@
|
|
3
|
-
import { Observable } from "@
|
|
4
|
-
import type { Camera } from "@
|
|
5
|
-
import type { BaseTexture } from "@
|
|
6
|
-
import type { Material } from "@
|
|
7
|
-
import type { AbstractMesh } from "@
|
|
8
|
-
import type { ISceneLoaderPluginFactory, ISceneLoaderPluginAsync, ISceneLoaderProgressEvent, ISceneLoaderAsyncResult, SceneLoaderPluginOptions } from "@
|
|
9
|
-
import { AssetContainer } from "@
|
|
10
|
-
import type { Scene, IDisposable } from "@
|
|
11
|
-
import type { WebRequest } from "@
|
|
12
|
-
import type { IFileRequest } from "@
|
|
13
|
-
import type { IDataBuffer } from "@
|
|
2
|
+
import type { Nullable } from "@onerjs/core/types.js";
|
|
3
|
+
import { Observable } from "@onerjs/core/Misc/observable.js";
|
|
4
|
+
import type { Camera } from "@onerjs/core/Cameras/camera.js";
|
|
5
|
+
import type { BaseTexture } from "@onerjs/core/Materials/Textures/baseTexture.js";
|
|
6
|
+
import type { Material } from "@onerjs/core/Materials/material.js";
|
|
7
|
+
import type { AbstractMesh } from "@onerjs/core/Meshes/abstractMesh.js";
|
|
8
|
+
import type { ISceneLoaderPluginFactory, ISceneLoaderPluginAsync, ISceneLoaderProgressEvent, ISceneLoaderAsyncResult, SceneLoaderPluginOptions } from "@onerjs/core/Loading/sceneLoader.js";
|
|
9
|
+
import { AssetContainer } from "@onerjs/core/assetContainer.js";
|
|
10
|
+
import type { Scene, IDisposable } from "@onerjs/core/scene.js";
|
|
11
|
+
import type { WebRequest } from "@onerjs/core/Misc/webRequest.js";
|
|
12
|
+
import type { IFileRequest } from "@onerjs/core/Misc/fileRequest.js";
|
|
13
|
+
import type { IDataBuffer } from "@onerjs/core/Misc/dataReader.js";
|
|
14
14
|
import { GLTFFileLoaderMetadata } from "./glTFFileLoader.metadata.js";
|
|
15
|
-
import type { LoadFileError } from "@
|
|
16
|
-
import type { TransformNode } from "@
|
|
15
|
+
import type { LoadFileError } from "@onerjs/core/Misc/fileTools.js";
|
|
16
|
+
import type { TransformNode } from "@onerjs/core/Meshes/transformNode.js";
|
|
17
17
|
/**
|
|
18
18
|
* Defines options for glTF loader extensions. This interface is extended by specific extensions.
|
|
19
19
|
*/
|
|
20
20
|
export interface GLTFLoaderExtensionOptions extends Record<string, Record<string, unknown> | undefined> {
|
|
21
21
|
}
|
|
22
|
-
declare module "@
|
|
22
|
+
declare module "@onerjs/core/Loading/sceneLoader.js" {
|
|
23
23
|
interface SceneLoaderPluginOptions {
|
|
24
24
|
/**
|
|
25
25
|
* Defines options for the glTF loader.
|
package/glTF/glTFFileLoader.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Observable } from "@
|
|
2
|
-
import { Tools } from "@
|
|
3
|
-
import { RegisterSceneLoaderPlugin } from "@
|
|
4
|
-
import { AssetContainer } from "@
|
|
5
|
-
import { Logger } from "@
|
|
6
|
-
import { DataReader } from "@
|
|
1
|
+
import { Observable } from "@onerjs/core/Misc/observable.js";
|
|
2
|
+
import { Tools } from "@onerjs/core/Misc/tools.js";
|
|
3
|
+
import { RegisterSceneLoaderPlugin } from "@onerjs/core/Loading/sceneLoader.js";
|
|
4
|
+
import { AssetContainer } from "@onerjs/core/assetContainer.js";
|
|
5
|
+
import { Logger } from "@onerjs/core/Misc/logger.js";
|
|
6
|
+
import { DataReader } from "@onerjs/core/Misc/dataReader.js";
|
|
7
7
|
import { GLTFValidation } from "./glTFValidation.js";
|
|
8
8
|
import { GLTFFileLoaderMetadata, GLTFMagicBase64Encoded } from "./glTFFileLoader.metadata.js";
|
|
9
|
-
import { DecodeBase64UrlToBinary } from "@
|
|
10
|
-
import { RuntimeError, ErrorCodes } from "@
|
|
9
|
+
import { DecodeBase64UrlToBinary } from "@onerjs/core/Misc/fileTools.js";
|
|
10
|
+
import { RuntimeError, ErrorCodes } from "@onerjs/core/Misc/error.js";
|
|
11
11
|
function readAsync(arrayBuffer, byteOffset, byteLength) {
|
|
12
12
|
try {
|
|
13
13
|
return Promise.resolve(new Uint8Array(arrayBuffer, byteOffset, byteLength));
|