@needle-tools/engine 4.8.6-next.7fdd4fa → 4.8.6-next.9f367ef
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/dist/{gltf-progressive-DXRy9EQz.js → gltf-progressive-BcHT3Nyo.js} +1 -1
- package/dist/{gltf-progressive-C-U_onhf.umd.cjs → gltf-progressive-CH3Q4H06.umd.cjs} +1 -1
- package/dist/{gltf-progressive-DViD_J_l.min.js → gltf-progressive-DR6HqF_h.min.js} +1 -1
- package/dist/{needle-engine.bundle-D6OHYyGz.min.js → needle-engine.bundle-BxavRmW9.min.js} +121 -121
- package/dist/{needle-engine.bundle-B1l8PaE0.umd.cjs → needle-engine.bundle-CTl1Bov3.umd.cjs} +113 -113
- package/dist/{needle-engine.bundle-C6TN-zhq.js → needle-engine.bundle-DhzKEPso.js} +3319 -3285
- package/dist/needle-engine.js +394 -393
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-61aXdqNz.umd.cjs → postprocessing-CVb_x9YY.umd.cjs} +1 -1
- package/dist/{postprocessing-D9jDHD0U.js → postprocessing-ORx-0eCx.js} +1 -1
- package/dist/{postprocessing-Be9Ds4NK.min.js → postprocessing-Ywv5oKkX.min.js} +1 -1
- package/dist/three-examples-BX_Sktc9.min.js +501 -0
- package/dist/{three-examples-BihZ_R96.js → three-examples-CNexix3E.js} +2436 -2781
- package/dist/{three-examples-Ce6Th3bv.umd.cjs → three-examples-DWxXVnws.umd.cjs} +21 -21
- package/dist/{vendor-BRpzuoJE.min.js → vendor-C43vobGc.min.js} +37 -37
- package/dist/{vendor-p_xp9KuJ.js → vendor-Z4SPrTcP.js} +2402 -2047
- package/dist/vendor-xfQ8tKF3.umd.cjs +1121 -0
- package/lib/engine/api.d.ts +1 -0
- package/lib/engine/api.js +1 -0
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/engine_feature_flags.d.ts +3 -0
- package/lib/engine/engine_feature_flags.js +6 -0
- package/lib/engine/engine_feature_flags.js.map +1 -0
- package/lib/engine/engine_gameobject.js +0 -4
- package/lib/engine/engine_gameobject.js.map +1 -1
- package/lib/engine/engine_mainloop_utils.d.ts +2 -1
- package/lib/engine/engine_mainloop_utils.js +18 -6
- package/lib/engine/engine_mainloop_utils.js.map +1 -1
- package/lib/engine/extensions/extensions.js +2 -2
- package/lib/engine/extensions/extensions.js.map +1 -1
- package/lib/engine/js-extensions/Object3D.js +19 -0
- package/lib/engine/js-extensions/Object3D.js.map +1 -1
- package/lib/engine-components/Skybox.js +9 -3
- package/lib/engine-components/Skybox.js.map +1 -1
- package/package.json +2 -1
- package/src/engine/api.ts +2 -1
- package/src/engine/engine_feature_flags.ts +8 -0
- package/src/engine/engine_gameobject.ts +0 -4
- package/src/engine/engine_mainloop_utils.ts +24 -8
- package/src/engine/extensions/extensions.ts +2 -2
- package/src/engine/js-extensions/Object3D.ts +25 -2
- package/src/engine-components/Skybox.ts +8 -4
- package/dist/three-examples-DKY9Nfge.min.js +0 -501
- package/dist/vendor-Ja-vKV-a.umd.cjs +0 -1121
|
@@ -22,11 +22,11 @@ const debug = getParam("debugextensions");
|
|
|
22
22
|
|
|
23
23
|
// lazily import the GLTFAnimationPointerExtension in case it doesnt exist (e.g. using vanilla three)
|
|
24
24
|
let GLTFAnimationPointerExtension: any;
|
|
25
|
-
const KHR_ANIMATIONPOINTER_IMPORT = import("three
|
|
25
|
+
const KHR_ANIMATIONPOINTER_IMPORT = import("@needle-tools/three-animation-pointer").then(async mod => {
|
|
26
26
|
GLTFAnimationPointerExtension = mod.GLTFAnimationPointerExtension;
|
|
27
27
|
return GLTFAnimationPointerExtension;
|
|
28
28
|
}).catch(e => {
|
|
29
|
-
console.warn("Failed to import GLTFLoaderAnimationPointer. Please use @needle-tools/three for full KHR_animation support", e);
|
|
29
|
+
console.warn("Failed to import GLTFLoaderAnimationPointer. Please use @needle-tools/three-animationpointer for full KHR_animation support", e);
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Object3D, Quaternion, Vector3 } from "three";
|
|
2
2
|
import { TransformControlsGizmo } from "three/examples/jsm/controls/TransformControls.js";
|
|
3
3
|
|
|
4
|
-
import { addComponent,
|
|
4
|
+
import { addComponent, getComponent, getComponentInChildren, getComponentInParent, getComponents, getComponentsInChildren, getComponentsInParent, getOrAddComponent, removeComponent } from "../../engine/engine_components.js";
|
|
5
5
|
import { destroy, isActiveSelf, setActive } from "../../engine/engine_gameobject.js";
|
|
6
6
|
import {
|
|
7
7
|
getTempVector,
|
|
@@ -15,7 +15,9 @@ import {
|
|
|
15
15
|
setWorldScale
|
|
16
16
|
}
|
|
17
17
|
from "../../engine/engine_three_utils.js";
|
|
18
|
-
import type { ComponentInit, Constructor, ConstructorConcrete, HideFlags,IComponent as Component, IComponent } from "../../engine/engine_types.js";
|
|
18
|
+
import type { ComponentInit, Constructor, ConstructorConcrete, HideFlags, IComponent as Component, IComponent } from "../../engine/engine_types.js";
|
|
19
|
+
import { NEEDLE_ENGINE_FEATURE_FLAGS } from "../engine_feature_flags.js";
|
|
20
|
+
import { markHierarchyDirty } from "../engine_mainloop_utils.js";
|
|
19
21
|
import { applyPrototypeExtensions, registerPrototypeExtensions } from "./ExtensionUtils.js";
|
|
20
22
|
|
|
21
23
|
|
|
@@ -150,6 +152,27 @@ export function apply(object: Object3D) {
|
|
|
150
152
|
}
|
|
151
153
|
}
|
|
152
154
|
|
|
155
|
+
if (NEEDLE_ENGINE_FEATURE_FLAGS.experimentalSmartHierarchyUpdate) {
|
|
156
|
+
|
|
157
|
+
const addFn = Object3D.prototype.add;
|
|
158
|
+
Object3D.prototype.add = function (...args: any) {
|
|
159
|
+
markHierarchyDirty();
|
|
160
|
+
return addFn.apply(this, args);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const attachFn = Object3D.prototype.attach;
|
|
164
|
+
Object3D.prototype.attach = function (...args: any) {
|
|
165
|
+
markHierarchyDirty();
|
|
166
|
+
return attachFn.apply(this, args);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const removeFn = Object3D.prototype.remove;
|
|
170
|
+
Object3D.prototype.remove = function (...args: any) {
|
|
171
|
+
markHierarchyDirty();
|
|
172
|
+
return removeFn.apply(this, args);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
153
176
|
|
|
154
177
|
Object3D.prototype["SetActive"] = function (active: boolean) {
|
|
155
178
|
this.visible = active;
|
|
@@ -217,9 +217,9 @@ export class RemoteSkybox extends Behaviour {
|
|
|
217
217
|
if (debug) console.warn("RemoteSkybox: Failed to load texture from url", url);
|
|
218
218
|
return false;
|
|
219
219
|
}
|
|
220
|
-
// Check if we're
|
|
221
|
-
if (!this.enabled) {
|
|
222
|
-
if (debug) console.warn("RemoteSkybox: Component is
|
|
220
|
+
// Check if we're not disabled or destroyed
|
|
221
|
+
if (!this.enabled || this.destroyed) {
|
|
222
|
+
if (debug) console.warn("RemoteSkybox: Component is disabled or destroyed");
|
|
223
223
|
return false;
|
|
224
224
|
}
|
|
225
225
|
// Check if the url has changed while loading
|
|
@@ -239,7 +239,6 @@ export class RemoteSkybox extends Behaviour {
|
|
|
239
239
|
const envMap = this._prevLoadedEnvironment;
|
|
240
240
|
if (!envMap) return;
|
|
241
241
|
|
|
242
|
-
|
|
243
242
|
if ((envMap instanceof CubeTexture || envMap instanceof CompressedCubeTexture) || envMap.mapping == CubeUVReflectionMapping) {
|
|
244
243
|
// Nothing to do
|
|
245
244
|
}
|
|
@@ -248,6 +247,11 @@ export class RemoteSkybox extends Behaviour {
|
|
|
248
247
|
envMap.needsUpdate = true;
|
|
249
248
|
}
|
|
250
249
|
|
|
250
|
+
if(this.destroyed) return;
|
|
251
|
+
if(!this.context) {
|
|
252
|
+
console.warn("RemoteSkybox: Context is not available - can not apply skybox.");
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
251
255
|
|
|
252
256
|
// capture state
|
|
253
257
|
if (this.context.scene.background !== envMap)
|