@needle-tools/engine 4.2.3 → 4.2.5
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 +18 -0
- package/components.needle.json +1 -1
- package/dist/needle-engine.bundle.js +6857 -6847
- package/dist/needle-engine.bundle.light.js +6850 -6840
- package/dist/needle-engine.bundle.light.min.js +123 -123
- package/dist/needle-engine.bundle.light.umd.cjs +133 -133
- package/dist/needle-engine.bundle.min.js +124 -124
- package/dist/needle-engine.bundle.umd.cjs +133 -133
- package/dist/needle-engine.js +471 -472
- package/dist/needle-engine.light.js +471 -472
- package/dist/needle-engine.light.min.js +1 -1
- package/dist/needle-engine.light.umd.cjs +1 -1
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine/codegen/register_types.js +0 -2
- package/lib/engine/codegen/register_types.js.map +1 -1
- package/lib/engine/engine_input.d.ts +3 -3
- package/lib/engine/engine_input.js.map +1 -1
- package/lib/engine/engine_three_utils.d.ts +1 -1
- package/lib/engine/engine_three_utils.js +4 -1
- package/lib/engine/engine_three_utils.js.map +1 -1
- package/lib/engine/engine_utils_screenshot.js +2 -0
- package/lib/engine/engine_utils_screenshot.js.map +1 -1
- package/lib/engine-components/Collider.d.ts +9 -2
- package/lib/engine-components/Collider.js +36 -7
- package/lib/engine-components/Collider.js.map +1 -1
- package/lib/engine-components/ContactShadows.js +4 -2
- package/lib/engine-components/ContactShadows.js.map +1 -1
- package/lib/engine-components/DropListener.d.ts +4 -9
- package/lib/engine-components/DropListener.js +3 -3
- package/lib/engine-components/DropListener.js.map +1 -1
- package/lib/engine-components/OrbitControls.js +13 -1
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/lib/engine-components/api.d.ts +1 -1
- package/lib/engine-components/codegen/components.d.ts +0 -1
- package/lib/engine-components/codegen/components.js +0 -1
- package/lib/engine-components/codegen/components.js.map +1 -1
- package/lib/engine-components/export/usdz/ThreeUSDZExporter.js +6 -2
- package/lib/engine-components/export/usdz/ThreeUSDZExporter.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/Animation.js +10 -6
- package/lib/engine-components/export/usdz/extensions/Animation.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/behavior/Behaviour.js +1 -1
- package/lib/engine-components/export/usdz/extensions/behavior/Behaviour.js.map +1 -1
- package/lib/engine-components/ui/InputField.js +6 -5
- package/lib/engine-components/ui/InputField.js.map +1 -1
- package/package.json +2 -2
- package/src/engine/codegen/register_types.ts +2 -4
- package/src/engine/engine_input.ts +3 -3
- package/src/engine/engine_three_utils.ts +7 -2
- package/src/engine/engine_utils_screenshot.ts +2 -0
- package/src/engine-components/Collider.ts +41 -10
- package/src/engine-components/ContactShadows.ts +4 -2
- package/src/engine-components/DropListener.ts +5 -5
- package/src/engine-components/OrbitControls.ts +11 -1
- package/src/engine-components/api.ts +1 -1
- package/src/engine-components/codegen/components.ts +0 -1
- package/src/engine-components/export/usdz/ThreeUSDZExporter.ts +9 -5
- package/src/engine-components/export/usdz/extensions/Animation.ts +12 -8
- package/src/engine-components/export/usdz/extensions/behavior/Behaviour.ts +1 -1
- package/src/engine-components/ui/InputField.ts +7 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputField.js","sourceRoot":"","sources":["../../../src/engine-components/ui/InputField.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,Y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gBAAgB,EAAE,CAAC;IAChC,CAAC;;AAhPD;IADC,YAAY,CAAC,IAAI,CAAC;iDACU;AAG7B;IADC,YAAY,CAAC,IAAI,CAAC;+CACQ;AAG3B;IADC,YAAY,CAAC,SAAS,CAAC;kDACQ;AAGhC;IADC,YAAY,CAAC,SAAS,CAAC;6CACG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/engine",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.5",
|
|
4
4
|
"description": "Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in",
|
|
5
5
|
"main": "dist/needle-engine.min.js",
|
|
6
6
|
"exports": {
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"postprocessing": "^6.36.6",
|
|
96
96
|
"simplex-noise": "^4.0.1",
|
|
97
97
|
"stats.js": "^0.17.0",
|
|
98
|
-
"three": "npm:@needle-tools/three@^0.169.
|
|
98
|
+
"three": "npm:@needle-tools/three@^0.169.5",
|
|
99
99
|
"three-mesh-bvh": "^0.8.3",
|
|
100
100
|
"three-mesh-ui": "npm:@needle-tools/three-mesh-ui@^7.1.5-alpha.5",
|
|
101
101
|
"three.quarks": "0.15.6",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import { TypeStore } from "./../engine_typestore.js"
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
// Import types
|
|
5
5
|
import { AlignmentConstraint } from "../../engine-components/AlignmentConstraint.js";
|
|
6
6
|
import { Animation } from "../../engine-components/Animation.js";
|
|
@@ -36,7 +36,6 @@ import { DeleteBox } from "../../engine-components/DeleteBox.js";
|
|
|
36
36
|
import { Deletable } from "../../engine-components/DeleteBox.js";
|
|
37
37
|
import { DeviceFlag } from "../../engine-components/DeviceFlag.js";
|
|
38
38
|
import { DragControls } from "../../engine-components/DragControls.js";
|
|
39
|
-
import { DropListenerAddedEvent } from "../../engine-components/DropListener.js";
|
|
40
39
|
import { DropListener } from "../../engine-components/DropListener.js";
|
|
41
40
|
import { Duplicatable } from "../../engine-components/Duplicatable.js";
|
|
42
41
|
import { CallInfo } from "../../engine-components/EventList.js";
|
|
@@ -220,7 +219,7 @@ import { XRFlag } from "../../engine-components/webxr/XRFlag.js";
|
|
|
220
219
|
import { PlayerSync } from "../../engine-components-experimental/networking/PlayerSync.js";
|
|
221
220
|
import { PlayerState } from "../../engine-components-experimental/networking/PlayerSync.js";
|
|
222
221
|
import { PresentationMode } from "../../engine-components-experimental/Presentation.js";
|
|
223
|
-
|
|
222
|
+
|
|
224
223
|
// Register types
|
|
225
224
|
TypeStore.add("AlignmentConstraint", AlignmentConstraint);
|
|
226
225
|
TypeStore.add("Animation", Animation);
|
|
@@ -256,7 +255,6 @@ TypeStore.add("DeleteBox", DeleteBox);
|
|
|
256
255
|
TypeStore.add("Deletable", Deletable);
|
|
257
256
|
TypeStore.add("DeviceFlag", DeviceFlag);
|
|
258
257
|
TypeStore.add("DragControls", DragControls);
|
|
259
|
-
TypeStore.add("DropListenerAddedEvent", DropListenerAddedEvent);
|
|
260
258
|
TypeStore.add("DropListener", DropListener);
|
|
261
259
|
TypeStore.add("Duplicatable", Duplicatable);
|
|
262
260
|
TypeStore.add("CallInfo", CallInfo);
|
|
@@ -655,7 +655,7 @@ export class Input implements IInput {
|
|
|
655
655
|
}
|
|
656
656
|
return null;
|
|
657
657
|
}
|
|
658
|
-
isKeyDown(keyCode: KeyCode | string) {
|
|
658
|
+
isKeyDown(keyCode: KeyCode | ({} & string)) {
|
|
659
659
|
if (!this.context.application.isVisible || !this.context.application.hasFocus) return false;
|
|
660
660
|
const codes = this.getCodeForCommonKeyName(keyCode);
|
|
661
661
|
if (codes !== null) {
|
|
@@ -664,7 +664,7 @@ export class Input implements IInput {
|
|
|
664
664
|
}
|
|
665
665
|
return this.keysPressed[keyCode]?.startFrame === this.context.time.frameCount && this.keysPressed[keyCode].pressed;
|
|
666
666
|
}
|
|
667
|
-
isKeyUp(keyCode: KeyCode | string) {
|
|
667
|
+
isKeyUp(keyCode: KeyCode | ({} & string)) {
|
|
668
668
|
if (!this.context.application.isVisible || !this.context.application.hasFocus) return false;
|
|
669
669
|
const codes = this.getCodeForCommonKeyName(keyCode);
|
|
670
670
|
if (codes !== null) {
|
|
@@ -673,7 +673,7 @@ export class Input implements IInput {
|
|
|
673
673
|
}
|
|
674
674
|
return this.keysPressed[keyCode]?.frame === this.context.time.frameCount && !this.keysPressed[keyCode].pressed;
|
|
675
675
|
}
|
|
676
|
-
isKeyPressed(keyCode: KeyCode | string) {
|
|
676
|
+
isKeyPressed(keyCode: KeyCode | ({} & string)) {
|
|
677
677
|
if (!this.context.application.isVisible || !this.context.application.hasFocus) return false;
|
|
678
678
|
const codes = this.getCodeForCommonKeyName(keyCode);
|
|
679
679
|
if (codes !== null) {
|
|
@@ -554,7 +554,7 @@ export function getVisibleInCustomShadowRendering(obj: Object3D): boolean {
|
|
|
554
554
|
* @param layers The layers to include. Typically the main camera's layers.
|
|
555
555
|
* @param result The result box to store the bounding box in. Returns a new box if not passed in.
|
|
556
556
|
*/
|
|
557
|
-
export function getBoundingBox(objects: Object3D[], ignore: ((obj: Object3D) => void | boolean) | Array<Object3D | null | undefined> | undefined = undefined, layers: Layers | undefined | null = undefined, result: Box3 | undefined = undefined): Box3 {
|
|
557
|
+
export function getBoundingBox(objects: Object3D | Object3D[], ignore: ((obj: Object3D) => void | boolean) | Array<Object3D | null | undefined> | undefined = undefined, layers: Layers | undefined | null = undefined, result: Box3 | undefined = undefined): Box3 {
|
|
558
558
|
const box = result || new Box3();
|
|
559
559
|
box.makeEmpty();
|
|
560
560
|
|
|
@@ -607,6 +607,10 @@ export function getBoundingBox(objects: Object3D[], ignore: ((obj: Object3D) =>
|
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
609
|
let hasAnyObject = false;
|
|
610
|
+
|
|
611
|
+
if (!Array.isArray(objects))
|
|
612
|
+
objects = [objects];
|
|
613
|
+
|
|
610
614
|
for (const object of objects) {
|
|
611
615
|
if (!object) continue;
|
|
612
616
|
hasAnyObject = true;
|
|
@@ -728,7 +732,7 @@ export function postprocessFBXMaterials(obj: Mesh, material: Material | Material
|
|
|
728
732
|
}
|
|
729
733
|
|
|
730
734
|
// ignore if the material is already a MeshStandardMaterial
|
|
731
|
-
if (material.type === "MeshStandardMaterial") {
|
|
735
|
+
if (material.type === "MeshStandardMaterial" || material.type === "MeshBasicMaterial") {
|
|
732
736
|
return false;
|
|
733
737
|
}
|
|
734
738
|
// check if the material was already processed
|
|
@@ -764,6 +768,7 @@ export function postprocessFBXMaterials(obj: Mesh, material: Material | Material
|
|
|
764
768
|
newMaterial.envMap = oldMaterial.envMap;
|
|
765
769
|
newMaterial.alphaMap = oldMaterial.alphaMap;
|
|
766
770
|
newMaterial.metalness = oldMaterial.reflectivity;
|
|
771
|
+
newMaterial.vertexColors = oldMaterial.vertexColors;
|
|
767
772
|
if (oldMaterial.shininess) {
|
|
768
773
|
// from blender source code
|
|
769
774
|
// https://github.com/blender/blender-addons/blob/5e66092bcbe0df6855b3fa814b4826add8b01360/io_scene_fbx/import_fbx.py#L1442
|
|
@@ -3,6 +3,7 @@ import { Camera, Color, ColorRepresentation, FrontSide, Mesh, MirroredRepeatWrap
|
|
|
3
3
|
import { GameObject } from "../engine-components/Component.js";
|
|
4
4
|
import { Renderer } from "../engine-components/Renderer.js";
|
|
5
5
|
import { WebARCameraBackground } from "../engine-components/webxr/WebARCameraBackground.js";
|
|
6
|
+
import { setAutoFitEnabled } from "./engine_camera.js";
|
|
6
7
|
import { getComponentsInChildren } from "./engine_components.js";
|
|
7
8
|
import { ContextRegistry } from "./engine_context_registry.js";
|
|
8
9
|
import { onAfterRender } from "./engine_lifecycle_api.js";
|
|
@@ -669,6 +670,7 @@ void main() {
|
|
|
669
670
|
});
|
|
670
671
|
|
|
671
672
|
const planeMesh = new Mesh(new PlaneGeometry(2, 2), planeMaterial,) as unknown as FullscreenPlane;
|
|
673
|
+
setAutoFitEnabled(planeMesh, false);
|
|
672
674
|
planeMesh.geometry.deleteAttribute('normal');
|
|
673
675
|
// Option 1: add the planeMesh to our scene for rendering.
|
|
674
676
|
// This is useful for applying custom shader effects on the background (instead of using the system composite)
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BufferGeometry, Group, Mesh, Object3D, Vector3 } from "three"
|
|
2
2
|
|
|
3
3
|
import { addComponent } from "../engine/engine_components.js";
|
|
4
|
+
import { Gizmos } from "../engine/engine_gizmos.js";
|
|
4
5
|
import type { PhysicsMaterial } from "../engine/engine_physics.types.js";
|
|
5
6
|
import { serializable } from "../engine/engine_serialization_decorator.js";
|
|
6
|
-
import { getWorldScale } from "../engine/engine_three_utils.js";
|
|
7
|
+
import { getBoundingBox, getWorldScale } from "../engine/engine_three_utils.js";
|
|
7
8
|
// import { IColliderProvider, registerColliderProvider } from "../engine/engine_physics.js";
|
|
8
9
|
import type { IBoxCollider, ICollider, ISphereCollider } from "../engine/engine_types.js";
|
|
9
10
|
import { validate } from "../engine/engine_util_decorator.js";
|
|
@@ -92,7 +93,7 @@ export class Collider extends Behaviour implements ICollider {
|
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
/** Requests an update of the physics material in the physics engine */
|
|
95
|
-
updatePhysicsMaterial(){
|
|
96
|
+
updatePhysicsMaterial() {
|
|
96
97
|
this.context.physics.engine?.updatePhysicsMaterial(this);
|
|
97
98
|
|
|
98
99
|
}
|
|
@@ -135,14 +136,9 @@ export class SphereCollider extends Collider implements ISphereCollider {
|
|
|
135
136
|
*/
|
|
136
137
|
export class BoxCollider extends Collider implements IBoxCollider {
|
|
137
138
|
|
|
138
|
-
static add(obj: Mesh, opts?: { rigidbody: boolean }) {
|
|
139
|
-
const collider =
|
|
140
|
-
|
|
141
|
-
if (!obj.geometry.boundingBox) obj.geometry.computeBoundingBox();
|
|
142
|
-
const bb = obj.geometry.boundingBox!;
|
|
143
|
-
collider.size = bb!.getSize(new Vector3()) || new Vector3(1, 1, 1);
|
|
144
|
-
collider.center = bb!.getCenter(new Vector3()) || new Vector3(0, 0, 0);
|
|
145
|
-
addComponent(obj, collider);
|
|
139
|
+
static add(obj: Mesh | Object3D, opts?: { rigidbody: boolean, debug?: boolean }) {
|
|
140
|
+
const collider = addComponent(obj, BoxCollider);
|
|
141
|
+
collider.autoFit();
|
|
146
142
|
|
|
147
143
|
if (opts?.rigidbody === true) {
|
|
148
144
|
addComponent(obj, Rigidbody, { isKinematic: false });
|
|
@@ -157,20 +153,55 @@ export class BoxCollider extends Collider implements IBoxCollider {
|
|
|
157
153
|
@serializable(Vector3)
|
|
158
154
|
center: Vector3 = new Vector3(0, 0, 0);
|
|
159
155
|
|
|
156
|
+
/** @internal */
|
|
160
157
|
onEnable() {
|
|
161
158
|
super.onEnable();
|
|
162
159
|
this.context.physics.engine?.addBoxCollider(this, this.size);
|
|
163
160
|
watchWrite(this.gameObject.scale, this.updateProperties);
|
|
164
161
|
}
|
|
165
162
|
|
|
163
|
+
/** @internal */
|
|
166
164
|
onDisable(): void {
|
|
167
165
|
super.onDisable();
|
|
168
166
|
unwatchWrite(this.gameObject.scale, this.updateProperties);
|
|
169
167
|
}
|
|
170
168
|
|
|
169
|
+
/** @internal */
|
|
171
170
|
onValidate(): void {
|
|
172
171
|
this.updateProperties();
|
|
173
172
|
}
|
|
173
|
+
|
|
174
|
+
autoFit(opts?: { debug?: boolean }) {
|
|
175
|
+
const obj = this.gameObject;
|
|
176
|
+
|
|
177
|
+
// we need to transform the object into identity
|
|
178
|
+
// because the physics collider will correctly apple the object's transform again
|
|
179
|
+
// if we don't do it here we will have the transform applied twice
|
|
180
|
+
const originalPosition = obj.position.clone();
|
|
181
|
+
const originalQuaternion = obj.quaternion.clone();
|
|
182
|
+
const originalScale = obj.scale.clone();
|
|
183
|
+
const originalParent = obj.parent;
|
|
184
|
+
obj.position.set(0, 0, 0);
|
|
185
|
+
obj.quaternion.set(0, 0, 0, 1);
|
|
186
|
+
obj.scale.set(1, 1, 1);
|
|
187
|
+
obj.parent = null;
|
|
188
|
+
obj.updateMatrix();
|
|
189
|
+
const bb = getBoundingBox([obj]);
|
|
190
|
+
obj.position.copy(originalPosition);
|
|
191
|
+
obj.quaternion.copy(originalQuaternion);
|
|
192
|
+
obj.scale.copy(originalScale);
|
|
193
|
+
obj.parent = originalParent;
|
|
194
|
+
|
|
195
|
+
if (opts?.debug === true) Gizmos.DrawWireBox3(bb, 0xffdd00, 20);
|
|
196
|
+
|
|
197
|
+
// if (!obj.geometry.boundingBox) obj.geometry.computeBoundingBox();
|
|
198
|
+
// const bb = obj.geometry.boundingBox!;
|
|
199
|
+
this.size = bb!.getSize(new Vector3()) || new Vector3(1, 1, 1);
|
|
200
|
+
this.center = bb!.getCenter(new Vector3()) || new Vector3(0, 0, 0);
|
|
201
|
+
if (this.size.length() <= 0) {
|
|
202
|
+
this.size.set(0.01, 0.01, 0.01);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
174
205
|
}
|
|
175
206
|
|
|
176
207
|
/**
|
|
@@ -371,9 +371,11 @@ export class ContactShadows extends Behaviour {
|
|
|
371
371
|
// Ignore objects that don't render color
|
|
372
372
|
let hide = entry.material.colorWrite == false || mat.wireframe === true || getVisibleInCustomShadowRendering(entry.object) === false;
|
|
373
373
|
// Ignore line materials (e.g. GridHelper)
|
|
374
|
-
if (!hide && (entry.material
|
|
374
|
+
if (!hide && (entry.material["isLineMaterial"]))
|
|
375
|
+
hide = true;
|
|
376
|
+
// Ignore point materials
|
|
377
|
+
if (!hide && (entry.material["isPointsMaterial"]))
|
|
375
378
|
hide = true;
|
|
376
|
-
}
|
|
377
379
|
if (hide) {
|
|
378
380
|
objects_hidden.push(entry.object);
|
|
379
381
|
entry.object["needle:visible"] = entry.object.visible;
|
|
@@ -53,7 +53,7 @@ export declare type DropListenerNetworkEventArguments = {
|
|
|
53
53
|
contentMD5: string;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
declare type
|
|
56
|
+
export declare type DropListenerOnDropArguments = {
|
|
57
57
|
sender: DropListener,
|
|
58
58
|
/** the root object added to the scene */
|
|
59
59
|
object: Object3D,
|
|
@@ -64,7 +64,7 @@ declare type AddedEventArguments = {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/** Dispatched when an object is dropped/changed */
|
|
67
|
-
|
|
67
|
+
class DropListenerAddedEvent<T extends DropListenerOnDropArguments> extends CustomEvent<T> {
|
|
68
68
|
constructor(detail: T) {
|
|
69
69
|
super(DropListenerEvents.ObjectAdded, { detail });
|
|
70
70
|
}
|
|
@@ -136,9 +136,9 @@ export class DropListener extends Behaviour {
|
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
138
|
* Invoked after a file has been **added** to the scene.
|
|
139
|
-
* Arguments are {@link
|
|
139
|
+
* Arguments are {@link DropListenerOnDropArguments}
|
|
140
140
|
* @event object-added
|
|
141
|
-
* @param {
|
|
141
|
+
* @param {DropListenerOnDropArguments} evt
|
|
142
142
|
* @example
|
|
143
143
|
* ```typescript
|
|
144
144
|
* dropListener.onDropped.addEventListener((evt) => {
|
|
@@ -146,7 +146,7 @@ export class DropListener extends Behaviour {
|
|
|
146
146
|
* });
|
|
147
147
|
*/
|
|
148
148
|
@serializable(EventList)
|
|
149
|
-
onDropped: EventList<
|
|
149
|
+
onDropped: EventList<DropListenerOnDropArguments> = new EventList();
|
|
150
150
|
|
|
151
151
|
/** @internal */
|
|
152
152
|
onEnable(): void {
|
|
@@ -404,6 +404,16 @@ export class OrbitControls extends Behaviour implements ICameraController {
|
|
|
404
404
|
if (this.doubleClickToFocus && evt.isDoubleClick && !evt.used) {
|
|
405
405
|
this.setTargetFromRaycast();
|
|
406
406
|
}
|
|
407
|
+
// Automatically update the camera focus
|
|
408
|
+
else if (!evt.used && this.autoTarget) {
|
|
409
|
+
const ray = new Ray(this._cameraObject?.worldPosition, this._cameraObject?.worldForward.multiplyScalar(-1));
|
|
410
|
+
const hits = this.context.physics.raycastFromRay(ray);
|
|
411
|
+
const hit = hits.length > 0 ? hits[0] : undefined;
|
|
412
|
+
if(hit && hit.distance > this.minZoom && hit.distance < this.maxZoom) {
|
|
413
|
+
if(debug) Gizmos.DrawWireSphere(hit.point, 0.1, 0xff0000, 2);
|
|
414
|
+
this._controls?.target.copy(hits[0].point);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
407
417
|
};
|
|
408
418
|
|
|
409
419
|
private onControlsChangeStarted = () => {
|
|
@@ -783,6 +793,7 @@ export class OrbitControls extends Behaviour implements ICameraController {
|
|
|
783
793
|
*/
|
|
784
794
|
private setLookTargetFromConstraint(index: number = 0, t: number = 1): boolean {
|
|
785
795
|
if (!this._controls) return false;
|
|
796
|
+
if (this.lookAtConstraint?.enabled === false) return false;
|
|
786
797
|
const sources = this.lookAtConstraint?.sources;
|
|
787
798
|
if (sources && sources.length > 0) {
|
|
788
799
|
const target = sources[index];
|
|
@@ -930,7 +941,6 @@ export class OrbitControls extends Behaviour implements ICameraController {
|
|
|
930
941
|
lookAt.y -= size.y * verticalOffset;
|
|
931
942
|
this.setLookTargetPosition(lookAt, immediate);
|
|
932
943
|
this.setFieldOfView(options.fov, immediate);
|
|
933
|
-
this.autoTarget = false;
|
|
934
944
|
|
|
935
945
|
if (cameraNearFar == undefined || cameraNearFar == "auto") {
|
|
936
946
|
// Check if the scene has a GroundProjectedEnv and include the scale to the far plane so that it doesnt cut off
|
|
@@ -52,7 +52,7 @@ import "./AnimationUtils.js"
|
|
|
52
52
|
import "./AnimationUtilsAutoplay.js"
|
|
53
53
|
|
|
54
54
|
export { DragMode } from "./DragControls.js"
|
|
55
|
-
export type { DropListenerNetworkEventArguments } from "./DropListener.js";
|
|
55
|
+
export type { DropListenerNetworkEventArguments, DropListenerOnDropArguments } from "./DropListener.js";
|
|
56
56
|
export * from "./particlesystem/api.js"
|
|
57
57
|
|
|
58
58
|
// for correct type resolution in JSDoc
|
|
@@ -34,7 +34,6 @@ export { DeleteBox } from "../DeleteBox.js";
|
|
|
34
34
|
export { Deletable } from "../DeleteBox.js";
|
|
35
35
|
export { DeviceFlag } from "../DeviceFlag.js";
|
|
36
36
|
export { DragControls } from "../DragControls.js";
|
|
37
|
-
export { DropListenerAddedEvent } from "../DropListener.js";
|
|
38
37
|
export { DropListener } from "../DropListener.js";
|
|
39
38
|
export { Duplicatable } from "../Duplicatable.js";
|
|
40
39
|
export { CallInfo } from "../EventList.js";
|
|
@@ -1659,15 +1659,17 @@ function buildMesh( geometry: BufferGeometry, bones: Bone[] = [], quickLookCompa
|
|
|
1659
1659
|
let bonesArray = "";
|
|
1660
1660
|
if (hasBones) {
|
|
1661
1661
|
const uuidsFound:string[] = [];
|
|
1662
|
-
for(const bone of bones ){
|
|
1663
|
-
if (bone.parent!.type !== 'Bone')
|
|
1662
|
+
for (const bone of bones ) {
|
|
1663
|
+
// if (bone.parent!.type !== 'Bone')
|
|
1664
|
+
{
|
|
1664
1665
|
sortedBones.push({bone: bone, index: bones.indexOf(bone)});
|
|
1665
1666
|
uuidsFound.push(bone.uuid);
|
|
1666
1667
|
}
|
|
1667
1668
|
}
|
|
1668
1669
|
|
|
1669
|
-
|
|
1670
|
-
|
|
1670
|
+
let maxSteps = 10_000;
|
|
1671
|
+
while (uuidsFound.length < bones.length && maxSteps-- > 0) {
|
|
1672
|
+
for (const sortedBone of sortedBones) {
|
|
1671
1673
|
const children = sortedBone.bone.children as Bone[];
|
|
1672
1674
|
for (const childBone of children){
|
|
1673
1675
|
if (uuidsFound.indexOf(childBone.uuid) === -1 && bones.indexOf(childBone) !== -1){
|
|
@@ -1678,8 +1680,10 @@ function buildMesh( geometry: BufferGeometry, bones: Bone[] = [], quickLookCompa
|
|
|
1678
1680
|
}
|
|
1679
1681
|
}
|
|
1680
1682
|
|
|
1683
|
+
if (maxSteps <= 0) console.error("Failed to sort bones in skinned mesh", sortedBones, bones, uuidsFound);
|
|
1684
|
+
|
|
1681
1685
|
// add structural nodes to the list of bones
|
|
1682
|
-
for (
|
|
1686
|
+
for (const structuralNode of findStructuralNodesInBoneHierarchy(bones) ) {
|
|
1683
1687
|
sortedBones.push( { bone: structuralNode, index: sortedBones.length } );
|
|
1684
1688
|
}
|
|
1685
1689
|
|
|
@@ -662,31 +662,35 @@ class SerializeAnimation {
|
|
|
662
662
|
|
|
663
663
|
const sortedBones:Bone[] = [];
|
|
664
664
|
const uuidsFound:string[] = [];
|
|
665
|
-
for(const bone of skeleton.bones ){
|
|
666
|
-
if (bone.parent!.type !== 'Bone')
|
|
665
|
+
for(const bone of skeleton.bones ) {
|
|
666
|
+
// if (bone.parent!.type !== 'Bone')
|
|
667
|
+
{
|
|
667
668
|
sortedBones.push(bone);
|
|
669
|
+
uuidsFound.push(bone.uuid);
|
|
668
670
|
const inverse = skeleton.boneInverses[skeleton.bones.indexOf(bone)];
|
|
669
671
|
boneAndInverse.push({bone, inverse});
|
|
670
|
-
uuidsFound.push(bone.uuid);
|
|
671
672
|
}
|
|
672
673
|
}
|
|
673
674
|
|
|
674
|
-
|
|
675
|
-
|
|
675
|
+
let maxSteps = 10_000;
|
|
676
|
+
while (uuidsFound.length < skeleton.bones.length && maxSteps-- > 0) {
|
|
677
|
+
for (const sortedBone of sortedBones){
|
|
676
678
|
const children = sortedBone.children as Bone[];
|
|
677
679
|
for (const childBone of children){
|
|
678
680
|
if (uuidsFound.indexOf(childBone.uuid) === -1 && skeleton.bones.indexOf(childBone) !== -1){
|
|
679
681
|
sortedBones.push(childBone);
|
|
682
|
+
uuidsFound.push(childBone.uuid);
|
|
680
683
|
const childInverse = skeleton.boneInverses[skeleton.bones.indexOf(childBone)];
|
|
681
684
|
boneAndInverse.push({bone: childBone, inverse: childInverse});
|
|
682
|
-
uuidsFound.push(childBone.uuid);
|
|
683
685
|
}
|
|
684
686
|
}
|
|
685
687
|
}
|
|
686
688
|
}
|
|
687
689
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
+
if (maxSteps <= 0) console.error("Failed to sort bones in skinned mesh", model.skinnedMesh, skeleton.bones, uuidsFound);
|
|
691
|
+
|
|
692
|
+
for (const structuralNode of findStructuralNodesInBoneHierarchy(skeleton.bones)) {
|
|
693
|
+
boneAndInverse.push({bone: structuralNode, inverse: structuralNode.matrixWorld.clone().invert()});
|
|
690
694
|
}
|
|
691
695
|
|
|
692
696
|
// sort bones by path – need to be sorted in the same order as during mesh export
|
|
@@ -111,7 +111,7 @@ export class BehaviorExtension implements IUSDExporterExtension {
|
|
|
111
111
|
if (actionModel instanceof GroupActionModel) {
|
|
112
112
|
if (createMermaidGraphForDebugging) mermaidGraph += `subgraph Group_${actionModel.id}\n`;
|
|
113
113
|
for (const action of actionModel.actions) {
|
|
114
|
-
if (createMermaidGraphForDebugging) mermaidGraph += `${actionModel.id}[${actionModel.id}] -- ${actionModel.type} --> ${action.id}[${action.id}]\n`;
|
|
114
|
+
if (createMermaidGraphForDebugging) mermaidGraph += `${actionModel.id}[${actionModel.id}] -- ${actionModel.type},loops:${actionModel.loops} --> ${action.id}[${action.id}]\n`;
|
|
115
115
|
collectAction(action);
|
|
116
116
|
}
|
|
117
117
|
if (createMermaidGraphForDebugging) mermaidGraph += `end\n`;
|
|
@@ -238,14 +238,15 @@ export class InputField extends Behaviour implements IPointerEventHandler {
|
|
|
238
238
|
|
|
239
239
|
private setTextFromInputField() {
|
|
240
240
|
if (this.textComponent && InputField.htmlField) {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
241
|
+
const oldValue = this.textComponent.text;
|
|
242
|
+
const newValue = InputField.htmlField.value;
|
|
243
|
+
const changed = this.textComponent.text !== InputField.htmlField.value;
|
|
244
|
+
this.textComponent.text = InputField.htmlField.value;
|
|
245
|
+
|
|
246
|
+
if (changed) {
|
|
247
|
+
if (debug) console.log("[InputField] value changed:", newValue, oldValue);
|
|
246
248
|
this.onValueChanged?.invoke(newValue, oldValue);
|
|
247
249
|
}
|
|
248
|
-
this.textComponent.text = InputField.htmlField.value;
|
|
249
250
|
}
|
|
250
251
|
}
|
|
251
252
|
|