|
@@ -1,4 +1,4 @@
|
|
|
-import { GLTFFileLoader, IGLTFLoaderExtension } from "babylonjs-loaders/glTF/index";
|
|
|
+import { GLTFFileLoader, IGLTFLoaderExtension, GLTFLoaderAnimationStartMode, GLTFLoaderCoordinateSystemMode } from "babylonjs-loaders/glTF/index";
|
|
|
import { IGLTFValidationResults } from "babylonjs-gltf2interface";
|
|
|
|
|
|
import { Nullable } from "babylonjs/types";
|
|
@@ -27,13 +27,48 @@ export class GlobalState {
|
|
|
public onValidationResultsUpdatedObservable = new Observable<Nullable<IGLTFValidationResults>>();
|
|
|
|
|
|
public onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
|
|
|
- public glTFLoaderExtensionDefaults: { [name: string]: { [key: string]: any } } = {};
|
|
|
- public glTFLoaderDefaults: { [key: string]: any } = { "validate": true };
|
|
|
- public glTFLoaderExtenstions: { [key: string]: IGLTFLoaderExtension } = { };
|
|
|
+
|
|
|
+ public glTFLoaderExtensionDefaults: { [name: string]: { [key: string]: any } } = {
|
|
|
+ "MSFT_lod": { enabled: true, maxLODsToLoad: 10 },
|
|
|
+ "MSFT_minecraftMesh": { enabled: true },
|
|
|
+ "MSFT_sRGBFactors": { enabled: true },
|
|
|
+ "MSFT_audio_emitter": { enabled: true },
|
|
|
+ "KHR_xmp": { enabled: true },
|
|
|
+ "KHR_draco_mesh_compression": { enabled: true },
|
|
|
+ "KHR_mesh_quantization": { enabled: true },
|
|
|
+ "KHR_materials_pbrSpecularGlossiness": { enabled: true },
|
|
|
+ "KHR_materials_clearcoat": { enabled: true },
|
|
|
+ "KHR_materials_ior": { enabled: true },
|
|
|
+ "KHR_materials_sheen": { enabled: true },
|
|
|
+ "KHR_materials_specular": { enabled: true },
|
|
|
+ "KHR_materials_unlit": { enabled: true },
|
|
|
+ "KHR_materials_variants": { enabled: true },
|
|
|
+ "KHR_materials_transmission": { enabled: true },
|
|
|
+ "KHR_lights_punctual": { enabled: true },
|
|
|
+ "KHR_texture_basisu": { enabled: true },
|
|
|
+ "KHR_texture_transform": { enabled: true },
|
|
|
+ "EXT_lights_image_based": { enabled: true },
|
|
|
+ "EXT_mesh_gpu_instancing": { enabled: true },
|
|
|
+ "EXT_texture_webp": { enabled: true },
|
|
|
+ };
|
|
|
+
|
|
|
+ public glTFLoaderDefaults: { [key: string]: any } = {
|
|
|
+ "animationStartMode": GLTFLoaderAnimationStartMode.FIRST,
|
|
|
+ "capturePerformanceCounters": false,
|
|
|
+ "compileMaterials": false,
|
|
|
+ "compileShadowGenerators": false,
|
|
|
+ "coordinateSystemMode": GLTFLoaderCoordinateSystemMode.AUTO,
|
|
|
+ "loggingEnabled": false,
|
|
|
+ "transparencyAsCoverage": false,
|
|
|
+ "useClipPlane": false,
|
|
|
+ "validate": true,
|
|
|
+ };
|
|
|
+
|
|
|
+ public glTFLoaderExtensions: { [key: string]: IGLTFLoaderExtension } = {};
|
|
|
|
|
|
public blockMutationUpdates = false;
|
|
|
- public selectedLineContainerTitles:Array<string> = [];
|
|
|
- public selectedLineContainerTitlesNoFocus:Array<string> = [];
|
|
|
+ public selectedLineContainerTitles: Array<string> = [];
|
|
|
+ public selectedLineContainerTitlesNoFocus: Array<string> = [];
|
|
|
|
|
|
public recorder = new ReplayRecorder();
|
|
|
|
|
@@ -78,7 +113,7 @@ export class GlobalState {
|
|
|
}
|
|
|
|
|
|
public prepareGLTFPlugin(loader: GLTFFileLoader) {
|
|
|
- this.glTFLoaderExtenstions = { };
|
|
|
+ this.glTFLoaderExtensions = {};
|
|
|
var loaderState = this.glTFLoaderDefaults;
|
|
|
if (loaderState !== undefined) {
|
|
|
for (const key in loaderState) {
|
|
@@ -94,7 +129,7 @@ export class GlobalState {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- this.glTFLoaderExtenstions[extension.name] = extension;
|
|
|
+ this.glTFLoaderExtensions[extension.name] = extension;
|
|
|
});
|
|
|
|
|
|
if (this.validationResults) {
|
|
@@ -124,7 +159,7 @@ export class GlobalState {
|
|
|
light.reservedDataStore.lightGizmo = new LightGizmo();
|
|
|
this.lightGizmos.push(light.reservedDataStore.lightGizmo)
|
|
|
light.reservedDataStore.lightGizmo.light = light;
|
|
|
- light.reservedDataStore.lightGizmo.material.reservedDataStore = {hidden: true};
|
|
|
+ light.reservedDataStore.lightGizmo.material.reservedDataStore = { hidden: true };
|
|
|
}
|
|
|
} else if (light.reservedDataStore && light.reservedDataStore.lightGizmo) {
|
|
|
this.lightGizmos.splice(this.lightGizmos.indexOf(light.reservedDataStore.lightGizmo), 1);
|
|
@@ -143,7 +178,7 @@ export class GlobalState {
|
|
|
camera.reservedDataStore.cameraGizmo = new CameraGizmo();
|
|
|
this.cameraGizmos.push(camera.reservedDataStore.cameraGizmo)
|
|
|
camera.reservedDataStore.cameraGizmo.camera = camera;
|
|
|
- camera.reservedDataStore.cameraGizmo.material.reservedDataStore = {hidden: true};
|
|
|
+ camera.reservedDataStore.cameraGizmo.material.reservedDataStore = { hidden: true };
|
|
|
}
|
|
|
} else if (camera.reservedDataStore && camera.reservedDataStore.cameraGizmo) {
|
|
|
this.cameraGizmos.splice(this.cameraGizmos.indexOf(camera.reservedDataStore.cameraGizmo), 1);
|