@needle-tools/engine 4.8.8-next.857d744 → 4.8.8-next.8add297
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/CHANGELOG.md +4 -5
- package/README.md +31 -23
- package/components.needle.json +1 -1
- package/dist/{needle-engine.bundle-gnU2UVys.umd.cjs → needle-engine.bundle-DwiJRlay.umd.cjs} +108 -108
- package/dist/{needle-engine.bundle-BATGweff.js → needle-engine.bundle-DwigPmVZ.js} +2656 -2629
- package/dist/{needle-engine.bundle-C0MpXHGe.min.js → needle-engine.bundle-WO60MbmU.min.js} +109 -109
- package/dist/needle-engine.d.ts +7 -0
- package/dist/needle-engine.js +2 -2
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine/engine_addressables.js +2 -0
- package/lib/engine/engine_addressables.js.map +1 -1
- package/lib/engine/engine_animation.js +4 -4
- package/lib/engine/engine_animation.js.map +1 -1
- package/lib/engine/engine_assetdatabase.js +6 -6
- package/lib/engine/engine_assetdatabase.js.map +1 -1
- package/lib/engine/engine_camera.d.ts +3 -0
- package/lib/engine/engine_camera.js +3 -3
- package/lib/engine/engine_camera.js.map +1 -1
- package/lib/engine/engine_context.d.ts +8 -2
- package/lib/engine/engine_context.js +22 -4
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_create_objects.d.ts +3 -3
- package/lib/engine/engine_create_objects.js +5 -4
- package/lib/engine/engine_create_objects.js.map +1 -1
- package/lib/engine/engine_gameobject.js +2 -2
- package/lib/engine/engine_gameobject.js.map +1 -1
- package/lib/engine/engine_gltf_builtin_components.js +11 -11
- package/lib/engine/engine_gltf_builtin_components.js.map +1 -1
- package/lib/engine/engine_loaders.callbacks.d.ts +1 -0
- package/lib/engine/engine_loaders.callbacks.js +1 -0
- package/lib/engine/engine_loaders.callbacks.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_lighting_settings.js +5 -2
- package/lib/engine/extensions/NEEDLE_lighting_settings.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_lightmaps.js +1 -1
- package/lib/engine/extensions/NEEDLE_lightmaps.js.map +1 -1
- package/lib/engine/js-extensions/Object3D.d.ts +1 -1
- package/lib/engine/js-extensions/Vector.d.ts +5 -0
- package/lib/engine/js-extensions/Vector.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.d.ts +2 -2
- package/lib/engine/webcomponents/needle-engine.js +11 -18
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine-components/Camera.d.ts +2 -0
- package/lib/engine-components/Camera.js +5 -1
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/ContactShadows.d.ts +12 -2
- package/lib/engine-components/ContactShadows.js +24 -4
- package/lib/engine-components/ContactShadows.js.map +1 -1
- package/lib/engine-components/DropListener.d.ts +4 -3
- package/lib/engine-components/DropListener.js +4 -3
- package/lib/engine-components/DropListener.js.map +1 -1
- package/lib/engine-components/NestedGltf.d.ts +9 -4
- package/lib/engine-components/NestedGltf.js +32 -26
- package/lib/engine-components/NestedGltf.js.map +1 -1
- package/lib/engine-components/OrbitControls.d.ts +29 -6
- package/lib/engine-components/OrbitControls.js +43 -7
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/lib/engine-components/Renderer.js +2 -1
- package/lib/engine-components/Renderer.js.map +1 -1
- package/lib/engine-components/Skybox.js +8 -9
- package/lib/engine-components/Skybox.js.map +1 -1
- package/lib/engine-components/api.d.ts +1 -0
- package/lib/engine-components/api.js.map +1 -1
- package/lib/engine-components/export/usdz/USDZExporter.d.ts +1 -1
- package/lib/engine-components/export/usdz/USDZExporter.js +1 -1
- package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
- package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
- package/package.json +1 -1
- package/plugins/common/files.js +6 -3
- package/plugins/vite/editor-connection.js +4 -4
- package/src/engine/engine_addressables.ts +2 -0
- package/src/engine/engine_animation.ts +4 -4
- package/src/engine/engine_assetdatabase.ts +7 -7
- package/src/engine/engine_camera.ts +7 -5
- package/src/engine/engine_context.ts +22 -4
- package/src/engine/engine_create_objects.ts +8 -7
- package/src/engine/engine_gameobject.ts +2 -2
- package/src/engine/engine_gltf_builtin_components.ts +12 -11
- package/src/engine/engine_loaders.callbacks.ts +1 -0
- package/src/engine/extensions/NEEDLE_lighting_settings.ts +5 -2
- package/src/engine/extensions/NEEDLE_lightmaps.ts +1 -1
- package/src/engine/js-extensions/Vector.ts +6 -0
- package/src/engine/webcomponents/needle-engine.ts +10 -17
- package/src/engine-components/Camera.ts +7 -1
- package/src/engine-components/ContactShadows.ts +27 -6
- package/src/engine-components/DropListener.ts +4 -3
- package/src/engine-components/NestedGltf.ts +33 -24
- package/src/engine-components/OrbitControls.ts +65 -16
- package/src/engine-components/Renderer.ts +2 -1
- package/src/engine-components/Skybox.ts +9 -10
- package/src/engine-components/api.ts +2 -1
- package/src/engine-components/export/usdz/USDZExporter.ts +1 -1
- package/src/engine-components/webxr/WebXRImageTracking.ts +1 -1
|
@@ -399,10 +399,11 @@ export class DropListener extends Behaviour {
|
|
|
399
399
|
private _abort: AbortController | null = null;
|
|
400
400
|
|
|
401
401
|
/**
|
|
402
|
-
* Processes dropped files
|
|
403
|
-
*
|
|
402
|
+
* Processes dropped files and loads them as 3D models.
|
|
403
|
+
* When enabled, it also handles network drops (sending files between clients).
|
|
404
|
+
* Automatically handles cancelling previous uploads if new files are dropped.
|
|
404
405
|
* @param fileList Array of dropped files
|
|
405
|
-
* @param ctx Context information about where the drop occurred
|
|
406
|
+
* @param ctx Context information about where on the screen or in 3D space the drop occurred
|
|
406
407
|
*/
|
|
407
408
|
private async addFromFiles(fileList: Array<File>, ctx: DropContext) {
|
|
408
409
|
if (debug) console.log("Add files", fileList)
|
|
@@ -4,6 +4,7 @@ import { InstantiateIdProvider } from "../engine/engine_networking_instantiate.j
|
|
|
4
4
|
import { serializable } from "../engine/engine_serialization_decorator.js";
|
|
5
5
|
import { getParam } from "../engine/engine_utils.js";
|
|
6
6
|
import { Behaviour } from "../engine-components/Component.js";
|
|
7
|
+
import { EventList } from "./EventList.js";
|
|
7
8
|
|
|
8
9
|
const debug = getParam("debugnestedgltf");
|
|
9
10
|
|
|
@@ -11,17 +12,21 @@ const debug = getParam("debugnestedgltf");
|
|
|
11
12
|
* It will load the gltf file and instantiate it as a child of the parent of the GameObject that has this component
|
|
12
13
|
*/
|
|
13
14
|
export class NestedGltf extends Behaviour {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
15
|
+
|
|
16
|
+
/** A reference to the gltf file that should be loaded */
|
|
17
17
|
@serializable(AssetReference)
|
|
18
18
|
filePath?: AssetReference;
|
|
19
19
|
|
|
20
|
+
/** Invoked when the nested glTF file has been instantiated */
|
|
21
|
+
@serializable(EventList)
|
|
22
|
+
loaded: EventList<{ component: NestedGltf, instance: any, asset: AssetReference }> = new EventList();
|
|
23
|
+
|
|
20
24
|
/**
|
|
21
25
|
* EXPERIMENTAL for cloud asset loading
|
|
22
26
|
*/
|
|
23
27
|
loadAssetInParent = true;
|
|
24
28
|
|
|
29
|
+
|
|
25
30
|
private _isLoadingOrDoneLoading: boolean = false;
|
|
26
31
|
|
|
27
32
|
/** Register a callback that will be called when the progress of the loading changes */
|
|
@@ -31,7 +36,7 @@ export class NestedGltf extends Behaviour {
|
|
|
31
36
|
|
|
32
37
|
/** Begin loading the referenced gltf file in filePath */
|
|
33
38
|
preload() {
|
|
34
|
-
this.filePath?.preload();
|
|
39
|
+
return this.filePath?.preload() || null;
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
/** @internal */
|
|
@@ -41,27 +46,31 @@ export class NestedGltf extends Behaviour {
|
|
|
41
46
|
|
|
42
47
|
const parent = this.gameObject.parent;
|
|
43
48
|
if (parent) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
res
|
|
56
|
-
|
|
57
|
-
res.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
49
|
+
|
|
50
|
+
if (this.filePath) {
|
|
51
|
+
|
|
52
|
+
this._isLoadingOrDoneLoading = true;
|
|
53
|
+
const opts = new InstantiateOptions();
|
|
54
|
+
// we need to provide stable guids for creating nested gltfs
|
|
55
|
+
opts.idProvider = new InstantiateIdProvider(this.hash(this.guid));
|
|
56
|
+
opts.parent = this.loadAssetInParent !== false ? parent : this.gameObject;
|
|
57
|
+
this.gameObject.updateMatrix();
|
|
58
|
+
const matrix = this.gameObject.matrix;
|
|
59
|
+
if (debug) console.log("Load nested:", this.filePath?.url ?? this.filePath, this.gameObject.position);
|
|
60
|
+
const res = await this.filePath?.instantiate?.call(this.filePath, opts);
|
|
61
|
+
if (debug) console.log("Nested loaded:", this.filePath?.url ?? this.filePath, res);
|
|
62
|
+
if (res && this.loadAssetInParent !== false) {
|
|
63
|
+
res.matrixAutoUpdate = false;
|
|
64
|
+
res.matrix.identity();
|
|
65
|
+
res.applyMatrix4(matrix);
|
|
66
|
+
res.matrixAutoUpdate = true;
|
|
67
|
+
res.layers.disableAll();
|
|
68
|
+
res.layers.set(this.layer);
|
|
69
|
+
this.loaded.invoke({ component: this, instance: res, asset: this.filePath });
|
|
70
|
+
}
|
|
71
|
+
if (debug) console.log("Nested loading done:", this.filePath?.url ?? this.filePath, res);
|
|
63
72
|
}
|
|
64
|
-
|
|
73
|
+
|
|
65
74
|
}
|
|
66
75
|
}
|
|
67
76
|
|
|
@@ -889,6 +889,8 @@ export class OrbitControls extends Behaviour implements ICameraController {
|
|
|
889
889
|
}
|
|
890
890
|
else this._fovLerpDuration = this.targetLerpDuration;
|
|
891
891
|
}
|
|
892
|
+
|
|
893
|
+
// if (this.context.mainCameraComponent) this.context.mainCameraComponent.fieldOfView = fov;
|
|
892
894
|
}
|
|
893
895
|
|
|
894
896
|
/** Moves the camera look-at target to a position smoothly.
|
|
@@ -984,10 +986,11 @@ export class OrbitControls extends Behaviour implements ICameraController {
|
|
|
984
986
|
*/
|
|
985
987
|
fitCamera(options?: FitCameraOptions);
|
|
986
988
|
fitCamera(objects?: Object3D | Array<Object3D>, options?: Omit<FitCameraOptions, "objects">);
|
|
987
|
-
fitCamera(objectsOrOptions?: Object3D | Array<Object3D> | FitCameraOptions, options?: FitCameraOptions) {
|
|
989
|
+
fitCamera(objectsOrOptions?: Object3D | Array<Object3D> | FitCameraOptions, options?: FitCameraOptions): void {
|
|
988
990
|
|
|
989
991
|
if (this.context.isInXR) {
|
|
990
992
|
// camera fitting in XR is not supported
|
|
993
|
+
console.warn('[OrbitControls] Can not fit camera while XR session is active');
|
|
991
994
|
return;
|
|
992
995
|
}
|
|
993
996
|
|
|
@@ -1032,7 +1035,7 @@ export class OrbitControls extends Behaviour implements ICameraController {
|
|
|
1032
1035
|
return;
|
|
1033
1036
|
}
|
|
1034
1037
|
if (!options) options = {}
|
|
1035
|
-
const { immediate = false, centerCamera
|
|
1038
|
+
const { immediate = false, centerCamera, cameraNearFar = "auto", fitOffset = 1.1, fov = camera?.fov } = options;
|
|
1036
1039
|
const size = new Vector3();
|
|
1037
1040
|
const center = new Vector3();
|
|
1038
1041
|
// TODO would be much better to calculate the bounds in camera space instead of world space -
|
|
@@ -1041,15 +1044,13 @@ export class OrbitControls extends Behaviour implements ICameraController {
|
|
|
1041
1044
|
// and thus we're just getting some maximum that will work for sure.
|
|
1042
1045
|
const box = getBoundingBox(objects, undefined, this._camera?.threeCamera?.layers);
|
|
1043
1046
|
const boxCopy = box.clone();
|
|
1044
|
-
|
|
1045
|
-
camera.updateMatrixWorld();
|
|
1046
|
-
camera.updateProjectionMatrix();
|
|
1047
1047
|
box.getCenter(center);
|
|
1048
1048
|
|
|
1049
1049
|
const box_size = new Vector3();
|
|
1050
1050
|
box.getSize(box_size);
|
|
1051
1051
|
|
|
1052
1052
|
// project this box into camera space
|
|
1053
|
+
camera.updateMatrixWorld();
|
|
1053
1054
|
box.applyMatrix4(camera.matrixWorldInverse);
|
|
1054
1055
|
|
|
1055
1056
|
box.getSize(size);
|
|
@@ -1078,9 +1079,18 @@ export class OrbitControls extends Behaviour implements ICameraController {
|
|
|
1078
1079
|
this.minZoom = distance * 0.01;
|
|
1079
1080
|
|
|
1080
1081
|
const verticalOffset = 0.05;
|
|
1081
|
-
|
|
1082
1082
|
const lookAt = center.clone();
|
|
1083
1083
|
lookAt.y -= size.y * verticalOffset;
|
|
1084
|
+
if (options.targetOffset) {
|
|
1085
|
+
if (options.targetOffset.x !== undefined) lookAt.x += options.targetOffset.x;
|
|
1086
|
+
if (options.targetOffset.y !== undefined) lookAt.y += options.targetOffset.y;
|
|
1087
|
+
if (options.targetOffset.z !== undefined) lookAt.z += options.targetOffset.z;
|
|
1088
|
+
}
|
|
1089
|
+
if (options.relativeTargetOffset) {
|
|
1090
|
+
if (options.relativeTargetOffset.x !== undefined) lookAt.x += options.relativeTargetOffset.x * size.x;
|
|
1091
|
+
if (options.relativeTargetOffset.y !== undefined) lookAt.y += options.relativeTargetOffset.y * size.y;
|
|
1092
|
+
if (options.relativeTargetOffset.z !== undefined) lookAt.z += options.relativeTargetOffset.z * size.z;
|
|
1093
|
+
}
|
|
1084
1094
|
this.setLookTargetPosition(lookAt, immediate);
|
|
1085
1095
|
this.setFieldOfView(options.fov, immediate);
|
|
1086
1096
|
|
|
@@ -1092,6 +1102,7 @@ export class OrbitControls extends Behaviour implements ICameraController {
|
|
|
1092
1102
|
// TODO: this doesnt take the Camera component nearClipPlane into account
|
|
1093
1103
|
camera.near = (distance / 100);
|
|
1094
1104
|
camera.far = boundsMax + distance * 10;
|
|
1105
|
+
camera.updateProjectionMatrix();
|
|
1095
1106
|
|
|
1096
1107
|
// adjust maxZoom so that the ground projection radius is always inside
|
|
1097
1108
|
if (groundprojection) {
|
|
@@ -1104,12 +1115,13 @@ export class OrbitControls extends Behaviour implements ICameraController {
|
|
|
1104
1115
|
if (currentZoom < this.minZoom) this.minZoom = currentZoom * 0.9;
|
|
1105
1116
|
if (currentZoom > this.maxZoom) this.maxZoom = currentZoom * 1.1;
|
|
1106
1117
|
|
|
1107
|
-
camera.updateMatrixWorld();
|
|
1108
|
-
camera.updateProjectionMatrix();
|
|
1109
|
-
|
|
1110
|
-
const cameraWp = getWorldPosition(camera);
|
|
1111
1118
|
const direction = center.clone();
|
|
1112
|
-
|
|
1119
|
+
if (options.fitDirection) {
|
|
1120
|
+
direction.sub(new Vector3().copy(options.fitDirection).multiplyScalar(1_000_000));
|
|
1121
|
+
}
|
|
1122
|
+
else {
|
|
1123
|
+
direction.sub(camera.worldPosition);
|
|
1124
|
+
}
|
|
1113
1125
|
if (centerCamera === "y")
|
|
1114
1126
|
direction.y = 0;
|
|
1115
1127
|
direction.normalize();
|
|
@@ -1118,6 +1130,16 @@ export class OrbitControls extends Behaviour implements ICameraController {
|
|
|
1118
1130
|
direction.y += -verticalOffset * 4 * distance;
|
|
1119
1131
|
|
|
1120
1132
|
let cameraLocalPosition = center.clone().sub(direction);
|
|
1133
|
+
if (options.cameraOffset) {
|
|
1134
|
+
if (options.cameraOffset.x !== undefined) cameraLocalPosition.x += options.cameraOffset.x;
|
|
1135
|
+
if (options.cameraOffset.y !== undefined) cameraLocalPosition.y += options.cameraOffset.y;
|
|
1136
|
+
if (options.cameraOffset.z !== undefined) cameraLocalPosition.z += options.cameraOffset.z;
|
|
1137
|
+
}
|
|
1138
|
+
if (options.relativeCameraOffset) {
|
|
1139
|
+
if (options.relativeCameraOffset.x !== undefined) cameraLocalPosition.x += options.relativeCameraOffset.x * size.x;
|
|
1140
|
+
if (options.relativeCameraOffset.y !== undefined) cameraLocalPosition.y += options.relativeCameraOffset.y * size.y;
|
|
1141
|
+
if (options.relativeCameraOffset.z !== undefined) cameraLocalPosition.z += options.relativeCameraOffset.z * size.z;
|
|
1142
|
+
}
|
|
1121
1143
|
if (camera.parent) {
|
|
1122
1144
|
cameraLocalPosition = camera.parent.worldToLocal(cameraLocalPosition);
|
|
1123
1145
|
}
|
|
@@ -1154,7 +1176,7 @@ export class OrbitControls extends Behaviour implements ICameraController {
|
|
|
1154
1176
|
/**
|
|
1155
1177
|
* Options for fitting the camera to the scene. Used in {@link OrbitControls.fitCamera}
|
|
1156
1178
|
*/
|
|
1157
|
-
|
|
1179
|
+
export type FitCameraOptions = {
|
|
1158
1180
|
/** When enabled debug rendering will be shown */
|
|
1159
1181
|
debug?: boolean,
|
|
1160
1182
|
/**
|
|
@@ -1166,14 +1188,41 @@ declare type FitCameraOptions = {
|
|
|
1166
1188
|
*/
|
|
1167
1189
|
immediate?: boolean,
|
|
1168
1190
|
|
|
1191
|
+
/** Fit offset: A factor to multiply the distance to the objects by
|
|
1192
|
+
* @default 1.1
|
|
1193
|
+
*/
|
|
1194
|
+
fitOffset?: number,
|
|
1195
|
+
|
|
1196
|
+
/** The direction from which the camera should be fitted in worldspace. If not defined the current camera's position will be used */
|
|
1197
|
+
fitDirection?: Vector3Like,
|
|
1198
|
+
|
|
1169
1199
|
/** If set to "y" the camera will be centered in the y axis */
|
|
1170
1200
|
centerCamera?: "none" | "y",
|
|
1201
|
+
/** Set to 'auto' to update the camera near or far plane based on the fitted-objects bounds */
|
|
1171
1202
|
cameraNearFar?: "keep" | "auto",
|
|
1172
1203
|
|
|
1173
|
-
|
|
1204
|
+
/**
|
|
1205
|
+
* Offset the camera position in world space
|
|
1206
|
+
*/
|
|
1207
|
+
cameraOffset?: Partial<Vector3Like>,
|
|
1208
|
+
/**
|
|
1209
|
+
* Offset the camera position relative to the size of the objects being focused on (e.g. x: 0.5).
|
|
1210
|
+
* Value range: -1 to 1
|
|
1211
|
+
*/
|
|
1212
|
+
relativeCameraOffset?: Partial<Vector3Like>,
|
|
1174
1213
|
|
|
1175
|
-
/**
|
|
1176
|
-
*
|
|
1214
|
+
/**
|
|
1215
|
+
* Offset the camera target position in world space
|
|
1177
1216
|
*/
|
|
1178
|
-
|
|
1217
|
+
targetOffset?: Partial<Vector3Like>,
|
|
1218
|
+
/**
|
|
1219
|
+
* Offset the camera target position relative to the size of the objects being focused on.
|
|
1220
|
+
* Value range: -1 to 1
|
|
1221
|
+
*/
|
|
1222
|
+
relativeTargetOffset?: Partial<Vector3Like>,
|
|
1223
|
+
|
|
1224
|
+
/**
|
|
1225
|
+
* Field of view (FOV) for the camera
|
|
1226
|
+
*/
|
|
1227
|
+
fov?: number,
|
|
1179
1228
|
}
|
|
@@ -706,7 +706,8 @@ export class Renderer extends Behaviour implements IRenderer {
|
|
|
706
706
|
}
|
|
707
707
|
|
|
708
708
|
if (this.reflectionProbeUsage !== ReflectionProbeUsage.Off && this._reflectionProbe) {
|
|
709
|
-
this.
|
|
709
|
+
if (!this._lightmaps?.length) // Currently reflectionprobes cant be used with lightmaps
|
|
710
|
+
this._reflectionProbe.onSet(this);
|
|
710
711
|
}
|
|
711
712
|
// since three 163 we need to set the envMap to the scene envMap if it is not set
|
|
712
713
|
// otherwise the envmapIntensity has no effect: https://github.com/mrdoob/three.js/pull/27903
|
|
@@ -48,21 +48,20 @@ function createRemoteSkyboxComponent(context: IContext, url: string, skybox: boo
|
|
|
48
48
|
const promises = new Array<Promise<any>>();
|
|
49
49
|
ContextRegistry.registerCallback(ContextEvent.ContextCreationStart, (args) => {
|
|
50
50
|
const context = args.context;
|
|
51
|
-
const
|
|
51
|
+
const backgroundImage = context.domElement.getAttribute("background-image");
|
|
52
52
|
const environmentImage = context.domElement.getAttribute("environment-image");
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (debug) console.log("Creating remote skybox to load " + skyboxImage);
|
|
53
|
+
|
|
54
|
+
if (backgroundImage) {
|
|
55
|
+
if (debug) console.log("Creating RemoteSkybox to load background " + backgroundImage);
|
|
57
56
|
// if the user is loading a GLB without a camera then the CameraUtils (which creates the default camera)
|
|
58
57
|
// checks if we have this attribute set and then sets the skybox clearflags accordingly
|
|
59
58
|
// if the user has a GLB with a camera but set to solid color then the skybox image is not visible -> we will just warn then and not override the camera settings
|
|
60
|
-
const promise = createRemoteSkyboxComponent(context,
|
|
59
|
+
const promise = createRemoteSkyboxComponent(context, backgroundImage, true, false, "background-image");
|
|
61
60
|
if (promise) promises.push(promise);
|
|
62
61
|
}
|
|
63
62
|
if (environmentImage) {
|
|
64
|
-
if (debug) console.log("Creating
|
|
65
|
-
const promise = createRemoteSkyboxComponent(context, environmentImage,
|
|
63
|
+
if (debug) console.log("Creating RemoteSkybox to load environment " + environmentImage);
|
|
64
|
+
const promise = createRemoteSkyboxComponent(context, environmentImage, false, true, "environment-image");
|
|
66
65
|
if (promise) promises.push(promise);
|
|
67
66
|
}
|
|
68
67
|
});
|
|
@@ -200,7 +199,7 @@ export class RemoteSkybox extends Behaviour {
|
|
|
200
199
|
console.warn("Potentially invalid skybox URL: \"" + name + "\" on " + (this.name || this.gameObject?.name || "context"));
|
|
201
200
|
}
|
|
202
201
|
|
|
203
|
-
if (debug) console.log("Set
|
|
202
|
+
if (debug) console.log("Set RemoteSkybox url: " + url);
|
|
204
203
|
|
|
205
204
|
if (this._prevUrl === url && this._prevLoadedEnvironment) {
|
|
206
205
|
this.apply();
|
|
@@ -258,7 +257,7 @@ export class RemoteSkybox extends Behaviour {
|
|
|
258
257
|
this._prevBackground = this.context.scene.background;
|
|
259
258
|
if (this.context.scene.environment !== envMap)
|
|
260
259
|
this._prevEnvironment = this.context.scene.environment;
|
|
261
|
-
if (debug) console.log("Set
|
|
260
|
+
if (debug) console.log("Set RemoteSkybox (" + ((this.environment && this.background) ? "environment and background" : this.environment ? "environment" : this.background ? "background" : "none") + ")", this.url, !Camera.backgroundShouldBeTransparent(this.context));
|
|
262
261
|
if (this.environment)
|
|
263
262
|
this.context.scene.environment = envMap;
|
|
264
263
|
if (this.background && !Camera.backgroundShouldBeTransparent(this.context))
|
|
@@ -51,7 +51,8 @@ import "./CameraUtils.js"
|
|
|
51
51
|
import "./AnimationUtils.js"
|
|
52
52
|
import "./AnimationUtilsAutoplay.js"
|
|
53
53
|
|
|
54
|
-
export { DragMode } from "./DragControls.js"
|
|
54
|
+
export { DragMode } from "./DragControls.js";
|
|
55
|
+
export { type FitCameraOptions } from "./OrbitControls.js";
|
|
55
56
|
export type { DropListenerNetworkEventArguments, DropListenerOnDropArguments } from "./DropListener.js";
|
|
56
57
|
export * from "./particlesystem/api.js"
|
|
57
58
|
|
|
@@ -12,6 +12,7 @@ import { InstancingHandler } from "../../../engine-components/RendererInstancing
|
|
|
12
12
|
import { Collider } from "../../Collider.js";
|
|
13
13
|
import { Behaviour, GameObject } from "../../Component.js";
|
|
14
14
|
import { ContactShadows } from "../../ContactShadows.js";
|
|
15
|
+
import { EventList } from "../../EventList.js";
|
|
15
16
|
import { GroundProjectedEnv } from "../../GroundProjection.js";
|
|
16
17
|
import { Renderer } from "../../Renderer.js"
|
|
17
18
|
import { Rigidbody } from "../../RigidBody.js";
|
|
@@ -29,7 +30,6 @@ import { USDZUIExtension } from "./extensions/USDZUI.js";
|
|
|
29
30
|
import { USDZExporter as ThreeUSDZExporter } from "./ThreeUSDZExporter.js";
|
|
30
31
|
import { disableObjectsAtStart, registerAnimatorsImplictly, registerAudioSourcesImplictly } from "./utils/animationutils.js";
|
|
31
32
|
import { ensureQuicklookLinkIsCreated } from "./utils/quicklook.js";
|
|
32
|
-
import { EventList } from "../../EventList.js";
|
|
33
33
|
|
|
34
34
|
const debug = getParam("debugusdz");
|
|
35
35
|
const debugUsdzPruning = getParam("debugusdzpruning");
|
|
@@ -3,6 +3,7 @@ import { Object3DEventMap } from "three";
|
|
|
3
3
|
|
|
4
4
|
import { isDevEnvironment, showBalloonWarning } from "../../engine/debug/index.js";
|
|
5
5
|
import { AssetReference } from "../../engine/engine_addressables.js";
|
|
6
|
+
import { Context } from "../../engine/engine_context.js";
|
|
6
7
|
import { serializable } from "../../engine/engine_serialization.js";
|
|
7
8
|
import { IGameObject } from "../../engine/engine_types.js";
|
|
8
9
|
import { CircularBuffer, delay, DeviceUtilities, getParam } from "../../engine/engine_utils.js";
|
|
@@ -12,7 +13,6 @@ import { imageToCanvas, USDObject, USDWriter, USDZExporterContext } from "../../
|
|
|
12
13
|
import { USDZExporter } from "../../engine-components/export/usdz/USDZExporter.js";
|
|
13
14
|
import { Behaviour, GameObject } from "../Component.js";
|
|
14
15
|
import { Renderer } from "../Renderer.js";
|
|
15
|
-
import { Context } from "../../engine/engine_context.js";
|
|
16
16
|
|
|
17
17
|
// https://github.com/immersive-web/marker-tracking/blob/main/explainer.md
|
|
18
18
|
|