@needle-tools/engine 4.10.1-next.ffb3f90 → 4.10.2

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.
@@ -8,7 +8,6 @@ var ViewBox_1;
8
8
  import { Matrix4, PerspectiveCamera } from "three";
9
9
  import { isDevEnvironment } from "../../engine/debug/debug.js";
10
10
  import { Gizmos } from "../../engine/engine_gizmos.js";
11
- import { Mathf } from "../../engine/engine_math.js";
12
11
  import { serializable } from "../../engine/engine_serialization_decorator.js";
13
12
  import { getTempVector } from "../../engine/engine_three_utils.js";
14
13
  import { registerType } from "../../engine/engine_typestore.js";
@@ -16,8 +15,7 @@ import { getParam } from "../../engine/engine_utils.js";
16
15
  import { RGBAColor } from "../../engine/js-extensions/RGBAColor.js";
17
16
  import { Behaviour } from "../Component.js";
18
17
  const debugParam = getParam("debugviewbox");
19
- const disabledGizmoColor = new RGBAColor(.5, .5, .5, .3);
20
- const enabledGizmoColor = new RGBAColor(.5, .5, 0, 1);
18
+ const disabledGizmoColor = new RGBAColor(.5, .5, .5, .5);
21
19
  /**
22
20
  * This component can be used to automatically fit a certain box area into the camera view - no matter your screen size or aspect ratio.
23
21
  *
@@ -40,22 +38,7 @@ const enabledGizmoColor = new RGBAColor(.5, .5, 0, 1);
40
38
  * @component
41
39
  */
42
40
  let ViewBox = ViewBox_1 = class ViewBox extends Behaviour {
43
- /** All known viewbox instances */
44
41
  static instances = [];
45
- /**
46
- * The currently active viewbox (the last one that was set active). If you have multiple viewboxes in your scene, only the active one will be used.
47
- * Note that the last viewbox may be inactive if its component is disabled or disabled in the hierarchy.
48
- * @returns The active viewbox or null if none is active
49
- */
50
- static get activeInstance() {
51
- if (ViewBox_1.instances.length === 0)
52
- return null;
53
- return ViewBox_1.instances[ViewBox_1.instances.length - 1];
54
- }
55
- /**
56
- * A runner instance is used per context to update the viewbox
57
- */
58
- static runners = new WeakMap();
59
42
  /**
60
43
  * The reference field of view is used to calculate the box size. This should usually be the same as your camera's fov.
61
44
  * @default -1 (meaning it will use the camera fov on the first frame)
@@ -65,19 +48,6 @@ let ViewBox = ViewBox_1 = class ViewBox extends Behaviour {
65
48
  * Enable debug logs and rendering for this component instance
66
49
  */
67
50
  debug = false;
68
- /**
69
- * Set this ViewBox as the active one (if you have multiple in your scene). The last active one will be used.
70
- * @returns self for chaining
71
- */
72
- setActive() {
73
- this.enabled = true;
74
- const idx = ViewBox_1.instances.indexOf(this);
75
- if (idx !== -1)
76
- ViewBox_1.instances.splice(idx, 1);
77
- ViewBox_1.instances.push(this);
78
- return this;
79
- }
80
- /** @internal */
81
51
  onEnable() {
82
52
  if (debugParam || this.debug || isDevEnvironment())
83
53
  console.debug("[ViewBox] Using camera fov:", this.referenceFieldOfView);
@@ -86,7 +56,6 @@ let ViewBox = ViewBox_1 = class ViewBox extends Behaviour {
86
56
  this.removeUpdateCallback();
87
57
  this.context.pre_render_callbacks.push(this.internalUpdate);
88
58
  }
89
- /** @internal */
90
59
  onDisable() {
91
60
  if (debugParam || this.debug)
92
61
  console.debug("[ViewBox] Disabled");
@@ -94,6 +63,7 @@ let ViewBox = ViewBox_1 = class ViewBox extends Behaviour {
94
63
  const idx = ViewBox_1.instances.indexOf(this);
95
64
  if (idx !== -1)
96
65
  ViewBox_1.instances.splice(idx, 1);
66
+ this._projectedBoxElement?.remove();
97
67
  this.removeUpdateCallback();
98
68
  }
99
69
  removeUpdateCallback() {
@@ -102,6 +72,8 @@ let ViewBox = ViewBox_1 = class ViewBox extends Behaviour {
102
72
  if (cbIdx !== -1)
103
73
  this.context.pre_render_callbacks.splice(cbIdx, 1);
104
74
  }
75
+ static _tempProjectionMatrix = new Matrix4();
76
+ static _tempProjectionMatrixInverse = new Matrix4();
105
77
  internalUpdate = () => {
106
78
  if (this.context.isInXR)
107
79
  return;
@@ -115,17 +87,13 @@ let ViewBox = ViewBox_1 = class ViewBox extends Behaviour {
115
87
  return;
116
88
  }
117
89
  if (debugParam || this.debug)
118
- Gizmos.DrawWireBox(this.gameObject.worldPosition, this.gameObject.worldScale, enabledGizmoColor, 0, true, this.gameObject.worldQuaternion);
90
+ Gizmos.DrawWireBox(this.gameObject.worldPosition, this.gameObject.worldScale, 0xdddd00, 0, true, this.gameObject.worldQuaternion);
119
91
  // calculate box size to fit the camera frustrum size at the current position (just scale)
120
92
  const camera = this.context.mainCamera;
121
93
  if (!camera)
122
94
  return;
123
95
  if (!(camera instanceof PerspectiveCamera)) {
124
96
  // TODO: support orthographic camera
125
- if (!this["__warnedOrthographic"]) {
126
- console.warn("[ViewBox] Only perspective cameras are supported.");
127
- this["__warnedOrthographic"] = true;
128
- }
129
97
  return;
130
98
  }
131
99
  if (this.referenceFieldOfView === undefined || this.referenceFieldOfView === -1) {
@@ -137,58 +105,14 @@ let ViewBox = ViewBox_1 = class ViewBox extends Behaviour {
137
105
  console.warn("[ViewBox] No valid referenceFieldOfView set, cannot adjust box size:", this.referenceFieldOfView);
138
106
  return;
139
107
  }
140
- let runner = ViewBox_1.runners.get(this.context);
141
- if (!runner) {
142
- runner = new Runner();
143
- ViewBox_1.runners.set(this.context, runner);
144
- }
145
- runner.update(this);
146
- // BACKLOG: some code for box scale of an object (different component)
147
- // this.gameObject.worldScale = getTempVector(width, height, worldscale.z);
148
- // this.gameObject.scale.multiplyScalar(.98)
149
- // const minscale = Math.min(width, height);
150
- // console.log(width, height);
151
- // this.gameObject.worldScale = getTempVector(scale, scale, scale);
152
- };
153
- };
154
- __decorate([
155
- serializable()
156
- ], ViewBox.prototype, "referenceFieldOfView", void 0);
157
- __decorate([
158
- serializable()
159
- ], ViewBox.prototype, "debug", void 0);
160
- ViewBox = ViewBox_1 = __decorate([
161
- registerType
162
- ], ViewBox);
163
- export { ViewBox };
164
- const projectionMatrixCopy = new Matrix4();
165
- const projectionMatrixInverseCopy = new Matrix4();
166
- class Runner {
167
- lastActiveViewBox = null;
168
- lastViewBoxChangeTime = -1;
169
- currentX = 0;
170
- currentY = 0;
171
- currentZoom = 1;
172
- update(viewBox) {
173
- const context = viewBox.context;
174
- const camera = viewBox.context.mainCamera;
175
- if (!(camera instanceof PerspectiveCamera))
176
- return;
177
- if (this.lastActiveViewBox !== viewBox) {
178
- if (this.lastActiveViewBox === null)
179
- this.lastViewBoxChangeTime = -100; // long ago
180
- else
181
- this.lastViewBoxChangeTime = context.time.time;
182
- this.lastActiveViewBox = viewBox;
183
- }
184
- const domWidth = context.domWidth;
185
- const domHeight = context.domHeight;
108
+ const domWidth = this.context.domWidth;
109
+ const domHeight = this.context.domHeight;
186
110
  let rectWidth = domWidth;
187
111
  let rectHeight = domHeight;
188
112
  let diffWidth = 1;
189
113
  let diffHeight = 1;
190
114
  // use focus rect if available
191
- const focusRectSize = context.focusRectSize;
115
+ const focusRectSize = this.context.focusRectSize;
192
116
  if (focusRectSize) {
193
117
  rectWidth = focusRectSize.width;
194
118
  rectHeight = focusRectSize.height;
@@ -196,8 +120,8 @@ class Runner {
196
120
  diffHeight = domHeight / rectHeight;
197
121
  }
198
122
  // Copy the projection matrix and restore values so we can reset it later
199
- projectionMatrixCopy.copy(camera.projectionMatrix);
200
- projectionMatrixInverseCopy.copy(camera.projectionMatrixInverse);
123
+ ViewBox_1._tempProjectionMatrix.copy(camera.projectionMatrix);
124
+ ViewBox_1._tempProjectionMatrixInverse.copy(camera.projectionMatrixInverse);
201
125
  const view = camera.view;
202
126
  const zoom = camera.zoom;
203
127
  const aspect = camera.aspect;
@@ -205,28 +129,26 @@ class Runner {
205
129
  // Set values to default so we can calculate the box size correctly
206
130
  camera.view = null;
207
131
  camera.zoom = 1;
208
- camera.fov = viewBox.referenceFieldOfView;
132
+ camera.fov = this.referenceFieldOfView;
209
133
  camera.updateProjectionMatrix();
210
- const boxPosition = viewBox.gameObject.worldPosition;
211
- const boxScale = viewBox.gameObject.worldScale;
134
+ const boxPosition = this.gameObject.worldPosition;
135
+ const boxScale = this.gameObject.worldScale;
212
136
  const cameraPosition = camera.worldPosition;
213
137
  const distance = cameraPosition.distanceTo(boxPosition);
214
- const timeSinceViewBoxChanged = context.time.time - this.lastViewBoxChangeTime;
215
- const interpolationDelta = timeSinceViewBoxChanged < 1 ? (context.time.deltaTime / .1) : 1;
216
138
  // #region camera fixes
217
139
  // If the camera is inside the box, move it out
218
140
  const boxSizeMax = Math.max(boxScale.x, boxScale.y, boxScale.z);
219
141
  const direction = getTempVector(cameraPosition).sub(boxPosition);
220
142
  if (distance < boxSizeMax) {
221
143
  // move camera out of bounds
222
- if (viewBox.debug || debugParam)
144
+ if (this.debug || debugParam)
223
145
  console.warn("[ViewBox] Moving camera out of bounds", distance, "<", boxSizeMax);
224
146
  const positionDirection = getTempVector(direction);
225
147
  positionDirection.y *= .00000001; // stay on horizontal plane mostly
226
148
  positionDirection.normalize();
227
149
  const lengthToMove = (boxSizeMax - distance);
228
150
  const newPosition = cameraPosition.add(positionDirection.multiplyScalar(lengthToMove));
229
- camera.worldPosition = newPosition.lerp(cameraPosition, 1 - context.time.deltaTime);
151
+ camera.worldPosition = newPosition.lerp(cameraPosition, 1 - this.context.time.deltaTime);
230
152
  }
231
153
  // Ensure the camera looks at the ViewBox
232
154
  // TOOD: smooth lookat over multiple frames if we have multiple viewboxes
@@ -239,57 +161,45 @@ class Runner {
239
161
  // camera.worldQuaternion = rotation;
240
162
  // camera.updateMatrixWorld();
241
163
  // }
242
- // const boxPositionInCameraSpace = getTempVector(boxPosition);
243
- // Ensure the camera looks at the box position
244
- // camera.worldToLocal(boxPositionInCameraSpace);
245
- // if (interpolationDelta < 1) {
246
- // const startRotation = interpolationDelta < 1 ? getTempQuaternion(camera.quaternion) : null;
247
- // camera.lookAt(boxPosition);
248
- // if (startRotation !== null) {
249
- // camera.quaternion.slerpQuaternions(startRotation, camera.quaternion, interpolationDelta);
250
- // }
251
- // camera.updateMatrixWorld();
252
- // }
164
+ const boxPositionInCameraSpace = getTempVector(boxPosition);
165
+ camera.worldToLocal(boxPositionInCameraSpace);
166
+ camera.lookAt(boxPosition);
167
+ camera.updateMatrixWorld();
253
168
  // #region calculate fit
254
- const vFOV = viewBox.referenceFieldOfView * Math.PI / 180; // convert vertical fov to radians
169
+ const vFOV = this.referenceFieldOfView * Math.PI / 180; // convert vertical fov to radians
255
170
  const height = 2 * Math.tan(vFOV / 2) * distance; // visible height
256
171
  const width = height * camera.aspect; // visible width
257
- const projectedBox = this.projectBoxIntoCamera(viewBox, camera, 1);
172
+ const projectedBox = this.projectBoxIntoCamera(camera, 1);
258
173
  // return
259
174
  const boxWidth = (projectedBox.maxX - projectedBox.minX);
260
175
  const boxHeight = (projectedBox.maxY - projectedBox.minY);
261
176
  const scale = this.fit(boxWidth * camera.aspect, boxHeight, width / diffWidth, height / diffHeight);
262
- const rectZoom = scale / (height * .5);
263
177
  // console.log({ scale, width, height, boxWidth: boxWidth * camera.aspect, boxHeight, diffWidth, diffHeight, aspect: camera.aspect, distance })
264
178
  // this.context.focusRectSettings.zoom = 1.39;
265
179
  // if (!this.context.focusRect) this.context.setCameraFocusRect(this.context.domElement);
266
180
  // return
267
181
  const vec = getTempVector(boxPosition);
268
182
  vec.project(camera);
269
- if (interpolationDelta < 1) {
270
- this.currentX = Mathf.lerp(this.currentX, vec.x, interpolationDelta);
271
- this.currentY = Mathf.lerp(this.currentY, vec.y, interpolationDelta);
272
- this.currentZoom = Mathf.lerp(this.currentZoom, rectZoom, interpolationDelta);
273
- }
274
- else {
275
- this.currentX = vec.x;
276
- this.currentY = vec.y;
277
- this.currentZoom = rectZoom;
278
- }
279
- // Apply new values
280
- context.focusRectSettings.offsetX = this.currentX;
281
- context.focusRectSettings.offsetY = this.currentY;
282
- context.focusRectSettings.zoom = this.currentZoom;
283
- if (!context.focusRect)
284
- context.setCameraFocusRect(context.domElement); // if we don't have a focus rect yet, set it to the dom element
183
+ this.context.focusRectSettings.offsetX = vec.x;
184
+ this.context.focusRectSettings.offsetY = vec.y;
185
+ this.context.focusRectSettings.zoom = scale / (height * .5);
186
+ // if we don't have a focus rect yet, set it to the dom element
187
+ if (!this.context.focusRect)
188
+ this.context.setCameraFocusRect(this.context.domElement);
285
189
  // Reset values
286
190
  camera.view = view;
287
191
  camera.zoom = zoom;
288
192
  camera.aspect = aspect;
289
193
  camera.fov = fov;
290
- camera.projectionMatrix.copy(projectionMatrixCopy);
291
- camera.projectionMatrixInverse.copy(projectionMatrixInverseCopy);
292
- }
194
+ camera.projectionMatrix.copy(ViewBox_1._tempProjectionMatrix);
195
+ camera.projectionMatrixInverse.copy(ViewBox_1._tempProjectionMatrixInverse);
196
+ // BACKLOG: some code for box scale of an object (different component)
197
+ // this.gameObject.worldScale = getTempVector(width, height, worldscale.z);
198
+ // this.gameObject.scale.multiplyScalar(.98)
199
+ // const minscale = Math.min(width, height);
200
+ // console.log(width, height);
201
+ // this.gameObject.worldScale = getTempVector(scale, scale, scale);
202
+ };
293
203
  /**
294
204
  * Cover fit
295
205
  */
@@ -298,7 +208,7 @@ class Runner {
298
208
  const scaleY = height2 / height1;
299
209
  return Math.min(scaleX, scaleY);
300
210
  }
301
- projectBoxIntoCamera(comp, camera, _factor) {
211
+ projectBoxIntoCamera(camera, _factor) {
302
212
  const factor = .5 * _factor;
303
213
  const corners = [
304
214
  getTempVector(-factor, -factor, -factor),
@@ -316,7 +226,7 @@ class Runner {
316
226
  let maxY = Number.NEGATIVE_INFINITY;
317
227
  for (let i = 0; i < corners.length; i++) {
318
228
  const c = corners[i];
319
- c.applyMatrix4(comp.gameObject.matrixWorld);
229
+ c.applyMatrix4(this.gameObject.matrixWorld);
320
230
  c.project(camera);
321
231
  if (c.x < minX)
322
232
  minX = c.x;
@@ -331,20 +241,30 @@ class Runner {
331
241
  if (!this._projectedBoxElement) {
332
242
  this._projectedBoxElement = document.createElement("div");
333
243
  }
334
- if (this._projectedBoxElement.parentElement !== comp.context.domElement)
335
- comp.context.domElement.appendChild(this._projectedBoxElement);
244
+ if (this._projectedBoxElement.parentElement !== this.context.domElement)
245
+ this.context.domElement.appendChild(this._projectedBoxElement);
336
246
  this._projectedBoxElement.style.position = "fixed";
337
247
  // dotted but with larger gaps
338
248
  this._projectedBoxElement.style.outline = "2px dashed rgba(255,0,0,.5)";
339
- this._projectedBoxElement.style.left = ((minX * .5 + .5) * comp.context.domWidth) + "px";
340
- this._projectedBoxElement.style.top = ((-maxY * .5 + .5) * comp.context.domHeight) + "px";
341
- this._projectedBoxElement.style.width = ((maxX - minX) * .5 * comp.context.domWidth) + "px";
342
- this._projectedBoxElement.style.height = ((maxY - minY) * .5 * comp.context.domHeight) + "px";
249
+ this._projectedBoxElement.style.left = ((minX * .5 + .5) * this.context.domWidth) + "px";
250
+ this._projectedBoxElement.style.top = ((-maxY * .5 + .5) * this.context.domHeight) + "px";
251
+ this._projectedBoxElement.style.width = ((maxX - minX) * .5 * this.context.domWidth) + "px";
252
+ this._projectedBoxElement.style.height = ((maxY - minY) * .5 * this.context.domHeight) + "px";
343
253
  this._projectedBoxElement.style.pointerEvents = "none";
344
254
  this._projectedBoxElement.style.zIndex = "1000";
345
255
  }
346
256
  return { minX, maxX, minY, maxY };
347
257
  }
348
258
  _projectedBoxElement = null;
349
- }
259
+ };
260
+ __decorate([
261
+ serializable()
262
+ ], ViewBox.prototype, "referenceFieldOfView", void 0);
263
+ __decorate([
264
+ serializable()
265
+ ], ViewBox.prototype, "debug", void 0);
266
+ ViewBox = ViewBox_1 = __decorate([
267
+ registerType
268
+ ], ViewBox);
269
+ export { ViewBox };
350
270
  //# sourceMappingURL=ViewBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ViewBox.js","sourceRoot":"","sources":["../../../src/engine-components/web/ViewBox.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAU,OAAO,EAAE,iBAAiB,EAAuC,MAAM,OAAO,CAAC;AAEhG,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,YA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,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;YACzF,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;YAC1F,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;YAC5F,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;YAC9F,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC;YACvD,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;SACnD;QAGD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAEtC,CAAC;IACO,oBAAoB,GAAuB,IAAI,CAAC;;AAhPxD;IADC,YAAY,EAAE;qDACmB;AAMlC;IADC,YAAY,EAAE;sCACQ;AAfd,OAAO;IADnB,YAAY;GACA,OAAO,CA8PnB;SA9PY,OAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/engine",
3
- "version": "4.10.1-next.ffb3f90",
3
+ "version": "4.10.2",
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": {
@@ -169,4 +169,4 @@
169
169
  "module": "lib/needle-engine.js",
170
170
  "typings": "lib/needle-engine.d.ts",
171
171
  "types": "lib/needle-engine.d.ts"
172
- }
172
+ }
@@ -9,6 +9,10 @@ import { Behaviour } from "../Component.js";
9
9
 
10
10
 
11
11
  /**
12
+ * Plays a hover animation on the object this component was added to when the mouse pointer (or touch) is over the object or any of it's children.
13
+ *
14
+ * By default, a simple scale-up animation is used. You can customize the hover and idle animations by providing your own animation clips.
15
+ *
12
16
  * @category Web
13
17
  * @group Components
14
18
  * @component
@@ -58,7 +62,7 @@ export class HoverAnimation extends Behaviour {
58
62
  start() {
59
63
  if (!this.idle) this.idle = AnimationUtils.emptyClip();
60
64
 
61
- if (!this.hovered) {
65
+ if (!this.hovered || !(this.hovered instanceof AnimationClip)) {
62
66
  this.hovered = AnimationUtils.createScaleClip({
63
67
  type: "linear",
64
68
  duration: this.duration || 0.1,