@needle-tools/engine 4.3.2-beta.1 → 4.3.2-beta.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.
- package/CHANGELOG.md +3 -0
- package/dist/needle-engine.bundle.js +92 -11
- package/dist/needle-engine.bundle.light.js +92 -11
- package/dist/needle-engine.bundle.light.min.js +2 -2
- package/dist/needle-engine.bundle.light.umd.cjs +2 -2
- package/dist/needle-engine.bundle.min.js +2 -2
- package/dist/needle-engine.bundle.umd.cjs +2 -2
- package/lib/engine/engine_gizmos.d.ts +84 -3
- package/lib/engine/engine_gizmos.js +88 -7
- package/lib/engine/engine_gizmos.js.map +1 -1
- package/package.json +1 -1
- package/src/engine/engine_gizmos.ts +89 -8
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,9 @@ All notable changes to this package will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [4.3.2-beta.2] - 2025-03-18
|
|
8
|
+
- Add: Documentation for `Gizmos` API
|
|
9
|
+
|
|
7
10
|
## [4.3.2-beta.1] - 2025-03-17
|
|
8
11
|
- Fix: Bug when loading glTF files without any components where a reference to the loaded glTF structre was kept in memory causing the memory to not be freed
|
|
9
12
|
|
|
@@ -1787,15 +1787,15 @@ function LC() {
|
|
|
1787
1787
|
return n || null;
|
|
1788
1788
|
}
|
|
1789
1789
|
const q0 = S("debugdefines");
|
|
1790
|
-
To('if(!globalThis[""4.3.2-beta.
|
|
1790
|
+
To('if(!globalThis[""4.3.2-beta.2""]) globalThis[""4.3.2-beta.2""] = "0.0.0";');
|
|
1791
1791
|
To('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');
|
|
1792
|
-
To('if(!globalThis[""
|
|
1792
|
+
To('if(!globalThis[""Tue Mar 18 2025 14:34:47 GMT+0100 (Central European Standard Time)""]) globalThis[""Tue Mar 18 2025 14:34:47 GMT+0100 (Central European Standard Time)""] = "unknown";');
|
|
1793
1793
|
To('if(!globalThis[""npk_0b7230d0d7c94c5ef23003726b2e2ccfc5ec0f20d26de8f0bda29e63698f9006""]) globalThis[""npk_0b7230d0d7c94c5ef23003726b2e2ccfc5ec0f20d26de8f0bda29e63698f9006""] = "unknown";');
|
|
1794
|
-
To('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.3.2-beta.
|
|
1794
|
+
To('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.3.2-beta.2";');
|
|
1795
1795
|
To('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
|
|
1796
|
-
To('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "
|
|
1796
|
+
To('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Tue Mar 18 2025 14:34:47 GMT+0100 (Central European Standard Time)";');
|
|
1797
1797
|
To('globalThis["__NEEDLE_PUBLIC_KEY__"] = "npk_0b7230d0d7c94c5ef23003726b2e2ccfc5ec0f20d26de8f0bda29e63698f9006";');
|
|
1798
|
-
const $s = "4.3.2-beta.
|
|
1798
|
+
const $s = "4.3.2-beta.2", xg = "undefined", X0 = "Tue Mar 18 2025 14:34:47 GMT+0100 (Central European Standard Time)";
|
|
1799
1799
|
q0 && console.log(`Engine version: ${$s} (generator: ${xg})
|
|
1800
1800
|
Project built at ${X0}`);
|
|
1801
1801
|
const md = "npk_0b7230d0d7c94c5ef23003726b2e2ccfc5ec0f20d26de8f0bda29e63698f9006", wo = "needle_isActiveInHierarchy", fa = "builtin_components", gd = "needle_editor_guid";
|
|
@@ -5392,9 +5392,21 @@ const Et = new v(), ky = new v(), Ty = new W(), wP = S("debuggizmos"), hs = 8947
|
|
|
5392
5392
|
static isGizmo(t) {
|
|
5393
5393
|
return t[bm] !== void 0;
|
|
5394
5394
|
}
|
|
5395
|
+
/** Set visibility of all currently rendered gizmos */
|
|
5396
|
+
static setVisible(t) {
|
|
5397
|
+
for (const e of Ee.timedObjectsBuffer)
|
|
5398
|
+
e.visible = t;
|
|
5399
|
+
}
|
|
5395
5400
|
/**
|
|
5396
5401
|
* Draw a label in the scene or attached to an object (if a parent is provided)
|
|
5397
|
-
* @
|
|
5402
|
+
* @param position the position of the label in world space
|
|
5403
|
+
* @param text the text of the label
|
|
5404
|
+
* @param size the size of the label in world space
|
|
5405
|
+
* @param duration the duration in seconds the label will be rendered. If 0 it will be rendered for one frame
|
|
5406
|
+
* @param color the color of the label
|
|
5407
|
+
* @param backgroundColor the background color of the label
|
|
5408
|
+
* @param parent the parent object to attach the label to. If no parent is provided the label will be attached to the scene
|
|
5409
|
+
* @returns a handle to the label that can be used to update the text
|
|
5398
5410
|
*/
|
|
5399
5411
|
static DrawLabel(t, e, i = 0.05, s = 0, o, a, l) {
|
|
5400
5412
|
var d;
|
|
@@ -5404,54 +5416,128 @@ const Et = new v(), ky = new v(), Ty = new W(), wP = S("debuggizmos"), hs = 8947
|
|
|
5404
5416
|
const c = ((d = J.active) == null ? void 0 : d.rigScale) ?? 1, h = Ee.getTextLabel(s, e, i * c, o, a);
|
|
5405
5417
|
return l instanceof D && l.add(h), h.position.x = t.x, h.position.y = t.y, h.position.z = t.z, h;
|
|
5406
5418
|
}
|
|
5419
|
+
/**
|
|
5420
|
+
* Draw a ray gizmo in the scene
|
|
5421
|
+
* @param origin the origin of the ray in world space
|
|
5422
|
+
* @param dir the direction of the ray in world space
|
|
5423
|
+
* @param color the color of the ray
|
|
5424
|
+
* @param duration the duration in seconds the ray will be rendered. If 0 it will be rendered for one frame
|
|
5425
|
+
* @param depthTest if true the ray will be rendered with depth test
|
|
5426
|
+
*/
|
|
5407
5427
|
static DrawRay(t, e, i = hs, s = 0, o = !0) {
|
|
5408
5428
|
if (!Vi.enabled)
|
|
5409
5429
|
return;
|
|
5410
5430
|
const a = Ee.getLine(s), l = a.geometry.getAttribute("position");
|
|
5411
5431
|
l.setXYZ(0, t.x, t.y, t.z), Et.set(e.x, e.y, e.z).multiplyScalar(999999999), l.setXYZ(1, t.x + Et.x, t.y + Et.y, t.z + Et.z), l.needsUpdate = !0, a.material.color.set(i), a.material.depthTest = o, a.material.depthWrite = !1;
|
|
5412
5432
|
}
|
|
5433
|
+
/**
|
|
5434
|
+
* Draw a line gizmo in the scene
|
|
5435
|
+
* @param pt0 the start point of the line in world space
|
|
5436
|
+
* @param pt1 the end point of the line in world space
|
|
5437
|
+
* @param color the color of the line
|
|
5438
|
+
* @param duration the duration in seconds the line will be rendered. If 0 it will be rendered for one frame
|
|
5439
|
+
* @param depthTest if true the line will be rendered with depth test
|
|
5440
|
+
* @param lengthFactor the length of the line. Default is 1
|
|
5441
|
+
*/
|
|
5413
5442
|
static DrawDirection(t, e, i = hs, s = 0, o = !0, a = 1) {
|
|
5414
5443
|
if (!Vi.enabled)
|
|
5415
5444
|
return;
|
|
5416
5445
|
const l = Ee.getLine(s), c = l.geometry.getAttribute("position");
|
|
5417
5446
|
c.setXYZ(0, t.x, t.y, t.z), e.w !== void 0 ? (Et.set(0, 0, -a), Ty.set(e.x, e.y, e.z, e.w), Et.applyQuaternion(Ty)) : (Et.set(e.x, e.y, e.z), Et.multiplyScalar(a)), c.setXYZ(1, t.x + Et.x, t.y + Et.y, t.z + Et.z), c.needsUpdate = !0, l.material.color.set(i), l.material.depthTest = o, l.material.depthWrite = !1;
|
|
5418
5447
|
}
|
|
5448
|
+
/**
|
|
5449
|
+
* Draw a line gizmo in the scene
|
|
5450
|
+
* @param pt0 the start point of the line in world space
|
|
5451
|
+
* @param pt1 the end point of the line in world space
|
|
5452
|
+
* @param color the color of the line
|
|
5453
|
+
* @param duration the duration in seconds the line will be rendered. If 0 it will be rendered for one frame
|
|
5454
|
+
* @param depthTest if true the line will be rendered with depth test
|
|
5455
|
+
*/
|
|
5419
5456
|
static DrawLine(t, e, i = hs, s = 0, o = !0) {
|
|
5420
5457
|
if (!Vi.enabled)
|
|
5421
5458
|
return;
|
|
5422
5459
|
const a = Ee.getLine(s), l = a.geometry.getAttribute("position");
|
|
5423
5460
|
l.setXYZ(0, t.x, t.y, t.z), l.setXYZ(1, e.x, e.y, e.z), l.needsUpdate = !0, a.material.color.set(i), a.material.depthTest = o, a.material.depthWrite = !1, a.material.fog = !1;
|
|
5424
5461
|
}
|
|
5462
|
+
/**
|
|
5463
|
+
* Draw a 2D circle gizmo in the scene
|
|
5464
|
+
* @param pt0 the center of the circle in world space
|
|
5465
|
+
* @param normal the normal of the circle in world space
|
|
5466
|
+
* @param radius the radius of the circle in world space
|
|
5467
|
+
* @param color the color of the circle
|
|
5468
|
+
* @param duration the duration in seconds the circle will be rendered. If 0 it will be rendered for one frame
|
|
5469
|
+
* @param depthTest if true the circle will be rendered with depth test
|
|
5470
|
+
*/
|
|
5425
5471
|
static DrawCircle(t, e, i, s = hs, o = 0, a = !0) {
|
|
5426
5472
|
if (!Vi.enabled)
|
|
5427
5473
|
return;
|
|
5428
5474
|
const l = Ee.getCircle(o);
|
|
5429
5475
|
l.position.set(t.x, t.y, t.z), l.scale.set(i, i, i), l.quaternion.setFromUnitVectors(this._up, Et.set(e.x, e.y, e.z).normalize()), l.material.color.set(s), l.material.depthTest = a, l.material.depthWrite = !1, l.material.fog = !1;
|
|
5430
5476
|
}
|
|
5477
|
+
/**
|
|
5478
|
+
* Draw a 3D wiremesh sphere gizmo in the scene
|
|
5479
|
+
* @param center the center of the sphere in world space
|
|
5480
|
+
* @param radius the radius of the sphere in world space
|
|
5481
|
+
* @param color the color of the sphere
|
|
5482
|
+
* @param duration the duration in seconds the sphere will be rendered. If 0 it will be rendered for one frame
|
|
5483
|
+
* @param depthTest if true the sphere will be rendered with depth test
|
|
5484
|
+
*/
|
|
5431
5485
|
static DrawWireSphere(t, e, i = hs, s = 0, o = !0) {
|
|
5432
5486
|
if (!Vi.enabled)
|
|
5433
5487
|
return;
|
|
5434
5488
|
const a = Ee.getSphere(e, s, !0);
|
|
5435
5489
|
Ha(a, t.x, t.y, t.z), a.material.color.set(i), a.material.depthTest = o, a.material.depthWrite = !1, a.material.fog = !1;
|
|
5436
5490
|
}
|
|
5491
|
+
/**
|
|
5492
|
+
* Draw a 3D sphere gizmo in the scene
|
|
5493
|
+
* @param center the center of the sphere in world space
|
|
5494
|
+
* @param radius the radius of the sphere in world space
|
|
5495
|
+
* @param color the color of the sphere
|
|
5496
|
+
* @param duration the duration in seconds the sphere will be rendered. If 0 it will be rendered for one frame
|
|
5497
|
+
* @param depthTest if true the sphere will be rendered with depth test
|
|
5498
|
+
*/
|
|
5437
5499
|
static DrawSphere(t, e, i = hs, s = 0, o = !0) {
|
|
5438
5500
|
if (!Vi.enabled)
|
|
5439
5501
|
return;
|
|
5440
5502
|
const a = Ee.getSphere(e, s, !1);
|
|
5441
5503
|
Ha(a, t.x, t.y, t.z), a.material.color.set(i), a.material.depthTest = o, a.material.depthWrite = !1;
|
|
5442
5504
|
}
|
|
5505
|
+
/**
|
|
5506
|
+
* Draw a 3D wiremesh box gizmo in the scene
|
|
5507
|
+
* @param center the center of the box in world space
|
|
5508
|
+
* @param size the size of the box in world space
|
|
5509
|
+
* @param color the color of the box
|
|
5510
|
+
* @param duration the duration in seconds the box will be rendered. If 0 it will be rendered for one frame
|
|
5511
|
+
* @param depthTest if true the box will be rendered with depth test
|
|
5512
|
+
*/
|
|
5443
5513
|
static DrawWireBox(t, e, i = hs, s = 0, o = !0) {
|
|
5444
5514
|
if (!Vi.enabled)
|
|
5445
5515
|
return;
|
|
5446
5516
|
const a = Ee.getBox(s);
|
|
5447
5517
|
a.position.set(t.x, t.y, t.z), a.scale.set(e.x, e.y, e.z), a.material.color.set(i), a.material.depthTest = o, a.material.wireframe = !0, a.material.depthWrite = !1, a.material.fog = !1;
|
|
5448
5518
|
}
|
|
5519
|
+
/**
|
|
5520
|
+
* Draw a 3D wiremesh box gizmo in the scene
|
|
5521
|
+
* @param box the box in world space
|
|
5522
|
+
* @param color the color of the box
|
|
5523
|
+
* @param duration the duration in seconds the box will be rendered. If 0 it will be rendered for one frame
|
|
5524
|
+
* @param depthTest if true the box will be rendered with depth test
|
|
5525
|
+
*/
|
|
5449
5526
|
static DrawWireBox3(t, e = hs, i = 0, s = !0) {
|
|
5450
5527
|
if (!Vi.enabled)
|
|
5451
5528
|
return;
|
|
5452
5529
|
const o = Ee.getBox(i);
|
|
5453
5530
|
o.position.copy(t.getCenter(Et)), o.scale.copy(t.getSize(Et)), o.material.color.set(e), o.material.depthTest = s, o.material.wireframe = !0, o.material.depthWrite = !1, o.material.fog = !1;
|
|
5454
5531
|
}
|
|
5532
|
+
/**
|
|
5533
|
+
* Draw an arrow gizmo in the scene
|
|
5534
|
+
* @param pt0 the start point of the arrow in world space
|
|
5535
|
+
* @param pt1 the end point of the arrow in world space
|
|
5536
|
+
* @param color the color of the arrow
|
|
5537
|
+
* @param duration the duration in seconds the arrow will be rendered. If 0 it will be rendered for one frame
|
|
5538
|
+
* @param depthTest if true the arrow will be rendered with depth test
|
|
5539
|
+
* @param wireframe if true the arrow will be rendered as wireframe
|
|
5540
|
+
*/
|
|
5455
5541
|
static DrawArrow(t, e, i = hs, s = 0, o = !0, a = !1) {
|
|
5456
5542
|
if (!Vi.enabled)
|
|
5457
5543
|
return;
|
|
@@ -5479,11 +5565,6 @@ const Et = new v(), ky = new v(), Ty = new W(), wP = S("debuggizmos"), hs = 8947
|
|
|
5479
5565
|
const e = Ee.getMesh(t.duration ?? 0);
|
|
5480
5566
|
"mesh" in t ? (e.geometry = t.mesh.geometry, e.matrix.copy(t.mesh.matrixWorld)) : (e.geometry = t.geometry, e.matrix.copy(t.matrix)), e.matrixAutoUpdate = !1, e.matrixWorldAutoUpdate = !1, e.material.color.set(t.color ?? hs), e.material.depthTest = t.depthTest ?? !0, e.material.wireframe = !0;
|
|
5481
5567
|
}
|
|
5482
|
-
/** Set visibility of all currently rendered gizmos */
|
|
5483
|
-
static setVisible(t) {
|
|
5484
|
-
for (const e of Ee.timedObjectsBuffer)
|
|
5485
|
-
e.visible = t;
|
|
5486
|
-
}
|
|
5487
5568
|
};
|
|
5488
5569
|
let V = Vi;
|
|
5489
5570
|
/**
|
|
@@ -1787,15 +1787,15 @@ function LC() {
|
|
|
1787
1787
|
return n || null;
|
|
1788
1788
|
}
|
|
1789
1789
|
const q0 = S("debugdefines");
|
|
1790
|
-
To('if(!globalThis[""4.3.2-beta.
|
|
1790
|
+
To('if(!globalThis[""4.3.2-beta.2""]) globalThis[""4.3.2-beta.2""] = "0.0.0";');
|
|
1791
1791
|
To('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');
|
|
1792
|
-
To('if(!globalThis[""
|
|
1792
|
+
To('if(!globalThis[""Tue Mar 18 2025 14:35:06 GMT+0100 (Central European Standard Time)""]) globalThis[""Tue Mar 18 2025 14:35:06 GMT+0100 (Central European Standard Time)""] = "unknown";');
|
|
1793
1793
|
To('if(!globalThis[""npk_0b7230d0d7c94c5ef23003726b2e2ccfc5ec0f20d26de8f0bda29e63698f9006""]) globalThis[""npk_0b7230d0d7c94c5ef23003726b2e2ccfc5ec0f20d26de8f0bda29e63698f9006""] = "unknown";');
|
|
1794
|
-
To('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.3.2-beta.
|
|
1794
|
+
To('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.3.2-beta.2";');
|
|
1795
1795
|
To('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
|
|
1796
|
-
To('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "
|
|
1796
|
+
To('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Tue Mar 18 2025 14:35:06 GMT+0100 (Central European Standard Time)";');
|
|
1797
1797
|
To('globalThis["__NEEDLE_PUBLIC_KEY__"] = "npk_0b7230d0d7c94c5ef23003726b2e2ccfc5ec0f20d26de8f0bda29e63698f9006";');
|
|
1798
|
-
const $s = "4.3.2-beta.
|
|
1798
|
+
const $s = "4.3.2-beta.2", xg = "undefined", X0 = "Tue Mar 18 2025 14:35:06 GMT+0100 (Central European Standard Time)";
|
|
1799
1799
|
q0 && console.log(`Engine version: ${$s} (generator: ${xg})
|
|
1800
1800
|
Project built at ${X0}`);
|
|
1801
1801
|
const md = "npk_0b7230d0d7c94c5ef23003726b2e2ccfc5ec0f20d26de8f0bda29e63698f9006", wo = "needle_isActiveInHierarchy", fa = "builtin_components", gd = "needle_editor_guid";
|
|
@@ -5392,9 +5392,21 @@ const Et = new v(), ky = new v(), Ty = new W(), wP = S("debuggizmos"), hs = 8947
|
|
|
5392
5392
|
static isGizmo(t) {
|
|
5393
5393
|
return t[bm] !== void 0;
|
|
5394
5394
|
}
|
|
5395
|
+
/** Set visibility of all currently rendered gizmos */
|
|
5396
|
+
static setVisible(t) {
|
|
5397
|
+
for (const e of Ee.timedObjectsBuffer)
|
|
5398
|
+
e.visible = t;
|
|
5399
|
+
}
|
|
5395
5400
|
/**
|
|
5396
5401
|
* Draw a label in the scene or attached to an object (if a parent is provided)
|
|
5397
|
-
* @
|
|
5402
|
+
* @param position the position of the label in world space
|
|
5403
|
+
* @param text the text of the label
|
|
5404
|
+
* @param size the size of the label in world space
|
|
5405
|
+
* @param duration the duration in seconds the label will be rendered. If 0 it will be rendered for one frame
|
|
5406
|
+
* @param color the color of the label
|
|
5407
|
+
* @param backgroundColor the background color of the label
|
|
5408
|
+
* @param parent the parent object to attach the label to. If no parent is provided the label will be attached to the scene
|
|
5409
|
+
* @returns a handle to the label that can be used to update the text
|
|
5398
5410
|
*/
|
|
5399
5411
|
static DrawLabel(t, e, i = 0.05, s = 0, o, a, l) {
|
|
5400
5412
|
var d;
|
|
@@ -5404,54 +5416,128 @@ const Et = new v(), ky = new v(), Ty = new W(), wP = S("debuggizmos"), hs = 8947
|
|
|
5404
5416
|
const c = ((d = J.active) == null ? void 0 : d.rigScale) ?? 1, h = Ee.getTextLabel(s, e, i * c, o, a);
|
|
5405
5417
|
return l instanceof D && l.add(h), h.position.x = t.x, h.position.y = t.y, h.position.z = t.z, h;
|
|
5406
5418
|
}
|
|
5419
|
+
/**
|
|
5420
|
+
* Draw a ray gizmo in the scene
|
|
5421
|
+
* @param origin the origin of the ray in world space
|
|
5422
|
+
* @param dir the direction of the ray in world space
|
|
5423
|
+
* @param color the color of the ray
|
|
5424
|
+
* @param duration the duration in seconds the ray will be rendered. If 0 it will be rendered for one frame
|
|
5425
|
+
* @param depthTest if true the ray will be rendered with depth test
|
|
5426
|
+
*/
|
|
5407
5427
|
static DrawRay(t, e, i = hs, s = 0, o = !0) {
|
|
5408
5428
|
if (!Vi.enabled)
|
|
5409
5429
|
return;
|
|
5410
5430
|
const a = Ee.getLine(s), l = a.geometry.getAttribute("position");
|
|
5411
5431
|
l.setXYZ(0, t.x, t.y, t.z), Et.set(e.x, e.y, e.z).multiplyScalar(999999999), l.setXYZ(1, t.x + Et.x, t.y + Et.y, t.z + Et.z), l.needsUpdate = !0, a.material.color.set(i), a.material.depthTest = o, a.material.depthWrite = !1;
|
|
5412
5432
|
}
|
|
5433
|
+
/**
|
|
5434
|
+
* Draw a line gizmo in the scene
|
|
5435
|
+
* @param pt0 the start point of the line in world space
|
|
5436
|
+
* @param pt1 the end point of the line in world space
|
|
5437
|
+
* @param color the color of the line
|
|
5438
|
+
* @param duration the duration in seconds the line will be rendered. If 0 it will be rendered for one frame
|
|
5439
|
+
* @param depthTest if true the line will be rendered with depth test
|
|
5440
|
+
* @param lengthFactor the length of the line. Default is 1
|
|
5441
|
+
*/
|
|
5413
5442
|
static DrawDirection(t, e, i = hs, s = 0, o = !0, a = 1) {
|
|
5414
5443
|
if (!Vi.enabled)
|
|
5415
5444
|
return;
|
|
5416
5445
|
const l = Ee.getLine(s), c = l.geometry.getAttribute("position");
|
|
5417
5446
|
c.setXYZ(0, t.x, t.y, t.z), e.w !== void 0 ? (Et.set(0, 0, -a), Ty.set(e.x, e.y, e.z, e.w), Et.applyQuaternion(Ty)) : (Et.set(e.x, e.y, e.z), Et.multiplyScalar(a)), c.setXYZ(1, t.x + Et.x, t.y + Et.y, t.z + Et.z), c.needsUpdate = !0, l.material.color.set(i), l.material.depthTest = o, l.material.depthWrite = !1;
|
|
5418
5447
|
}
|
|
5448
|
+
/**
|
|
5449
|
+
* Draw a line gizmo in the scene
|
|
5450
|
+
* @param pt0 the start point of the line in world space
|
|
5451
|
+
* @param pt1 the end point of the line in world space
|
|
5452
|
+
* @param color the color of the line
|
|
5453
|
+
* @param duration the duration in seconds the line will be rendered. If 0 it will be rendered for one frame
|
|
5454
|
+
* @param depthTest if true the line will be rendered with depth test
|
|
5455
|
+
*/
|
|
5419
5456
|
static DrawLine(t, e, i = hs, s = 0, o = !0) {
|
|
5420
5457
|
if (!Vi.enabled)
|
|
5421
5458
|
return;
|
|
5422
5459
|
const a = Ee.getLine(s), l = a.geometry.getAttribute("position");
|
|
5423
5460
|
l.setXYZ(0, t.x, t.y, t.z), l.setXYZ(1, e.x, e.y, e.z), l.needsUpdate = !0, a.material.color.set(i), a.material.depthTest = o, a.material.depthWrite = !1, a.material.fog = !1;
|
|
5424
5461
|
}
|
|
5462
|
+
/**
|
|
5463
|
+
* Draw a 2D circle gizmo in the scene
|
|
5464
|
+
* @param pt0 the center of the circle in world space
|
|
5465
|
+
* @param normal the normal of the circle in world space
|
|
5466
|
+
* @param radius the radius of the circle in world space
|
|
5467
|
+
* @param color the color of the circle
|
|
5468
|
+
* @param duration the duration in seconds the circle will be rendered. If 0 it will be rendered for one frame
|
|
5469
|
+
* @param depthTest if true the circle will be rendered with depth test
|
|
5470
|
+
*/
|
|
5425
5471
|
static DrawCircle(t, e, i, s = hs, o = 0, a = !0) {
|
|
5426
5472
|
if (!Vi.enabled)
|
|
5427
5473
|
return;
|
|
5428
5474
|
const l = Ee.getCircle(o);
|
|
5429
5475
|
l.position.set(t.x, t.y, t.z), l.scale.set(i, i, i), l.quaternion.setFromUnitVectors(this._up, Et.set(e.x, e.y, e.z).normalize()), l.material.color.set(s), l.material.depthTest = a, l.material.depthWrite = !1, l.material.fog = !1;
|
|
5430
5476
|
}
|
|
5477
|
+
/**
|
|
5478
|
+
* Draw a 3D wiremesh sphere gizmo in the scene
|
|
5479
|
+
* @param center the center of the sphere in world space
|
|
5480
|
+
* @param radius the radius of the sphere in world space
|
|
5481
|
+
* @param color the color of the sphere
|
|
5482
|
+
* @param duration the duration in seconds the sphere will be rendered. If 0 it will be rendered for one frame
|
|
5483
|
+
* @param depthTest if true the sphere will be rendered with depth test
|
|
5484
|
+
*/
|
|
5431
5485
|
static DrawWireSphere(t, e, i = hs, s = 0, o = !0) {
|
|
5432
5486
|
if (!Vi.enabled)
|
|
5433
5487
|
return;
|
|
5434
5488
|
const a = Ee.getSphere(e, s, !0);
|
|
5435
5489
|
Ha(a, t.x, t.y, t.z), a.material.color.set(i), a.material.depthTest = o, a.material.depthWrite = !1, a.material.fog = !1;
|
|
5436
5490
|
}
|
|
5491
|
+
/**
|
|
5492
|
+
* Draw a 3D sphere gizmo in the scene
|
|
5493
|
+
* @param center the center of the sphere in world space
|
|
5494
|
+
* @param radius the radius of the sphere in world space
|
|
5495
|
+
* @param color the color of the sphere
|
|
5496
|
+
* @param duration the duration in seconds the sphere will be rendered. If 0 it will be rendered for one frame
|
|
5497
|
+
* @param depthTest if true the sphere will be rendered with depth test
|
|
5498
|
+
*/
|
|
5437
5499
|
static DrawSphere(t, e, i = hs, s = 0, o = !0) {
|
|
5438
5500
|
if (!Vi.enabled)
|
|
5439
5501
|
return;
|
|
5440
5502
|
const a = Ee.getSphere(e, s, !1);
|
|
5441
5503
|
Ha(a, t.x, t.y, t.z), a.material.color.set(i), a.material.depthTest = o, a.material.depthWrite = !1;
|
|
5442
5504
|
}
|
|
5505
|
+
/**
|
|
5506
|
+
* Draw a 3D wiremesh box gizmo in the scene
|
|
5507
|
+
* @param center the center of the box in world space
|
|
5508
|
+
* @param size the size of the box in world space
|
|
5509
|
+
* @param color the color of the box
|
|
5510
|
+
* @param duration the duration in seconds the box will be rendered. If 0 it will be rendered for one frame
|
|
5511
|
+
* @param depthTest if true the box will be rendered with depth test
|
|
5512
|
+
*/
|
|
5443
5513
|
static DrawWireBox(t, e, i = hs, s = 0, o = !0) {
|
|
5444
5514
|
if (!Vi.enabled)
|
|
5445
5515
|
return;
|
|
5446
5516
|
const a = Ee.getBox(s);
|
|
5447
5517
|
a.position.set(t.x, t.y, t.z), a.scale.set(e.x, e.y, e.z), a.material.color.set(i), a.material.depthTest = o, a.material.wireframe = !0, a.material.depthWrite = !1, a.material.fog = !1;
|
|
5448
5518
|
}
|
|
5519
|
+
/**
|
|
5520
|
+
* Draw a 3D wiremesh box gizmo in the scene
|
|
5521
|
+
* @param box the box in world space
|
|
5522
|
+
* @param color the color of the box
|
|
5523
|
+
* @param duration the duration in seconds the box will be rendered. If 0 it will be rendered for one frame
|
|
5524
|
+
* @param depthTest if true the box will be rendered with depth test
|
|
5525
|
+
*/
|
|
5449
5526
|
static DrawWireBox3(t, e = hs, i = 0, s = !0) {
|
|
5450
5527
|
if (!Vi.enabled)
|
|
5451
5528
|
return;
|
|
5452
5529
|
const o = Ee.getBox(i);
|
|
5453
5530
|
o.position.copy(t.getCenter(Et)), o.scale.copy(t.getSize(Et)), o.material.color.set(e), o.material.depthTest = s, o.material.wireframe = !0, o.material.depthWrite = !1, o.material.fog = !1;
|
|
5454
5531
|
}
|
|
5532
|
+
/**
|
|
5533
|
+
* Draw an arrow gizmo in the scene
|
|
5534
|
+
* @param pt0 the start point of the arrow in world space
|
|
5535
|
+
* @param pt1 the end point of the arrow in world space
|
|
5536
|
+
* @param color the color of the arrow
|
|
5537
|
+
* @param duration the duration in seconds the arrow will be rendered. If 0 it will be rendered for one frame
|
|
5538
|
+
* @param depthTest if true the arrow will be rendered with depth test
|
|
5539
|
+
* @param wireframe if true the arrow will be rendered as wireframe
|
|
5540
|
+
*/
|
|
5455
5541
|
static DrawArrow(t, e, i = hs, s = 0, o = !0, a = !1) {
|
|
5456
5542
|
if (!Vi.enabled)
|
|
5457
5543
|
return;
|
|
@@ -5479,11 +5565,6 @@ const Et = new v(), ky = new v(), Ty = new W(), wP = S("debuggizmos"), hs = 8947
|
|
|
5479
5565
|
const e = Ee.getMesh(t.duration ?? 0);
|
|
5480
5566
|
"mesh" in t ? (e.geometry = t.mesh.geometry, e.matrix.copy(t.mesh.matrixWorld)) : (e.geometry = t.geometry, e.matrix.copy(t.matrix)), e.matrixAutoUpdate = !1, e.matrixWorldAutoUpdate = !1, e.material.color.set(t.color ?? hs), e.material.depthTest = t.depthTest ?? !0, e.material.wireframe = !0;
|
|
5481
5567
|
}
|
|
5482
|
-
/** Set visibility of all currently rendered gizmos */
|
|
5483
|
-
static setVisible(t) {
|
|
5484
|
-
for (const e of Ee.timedObjectsBuffer)
|
|
5485
|
-
e.visible = t;
|
|
5486
|
-
}
|
|
5487
5568
|
};
|
|
5488
5569
|
let V = Vi;
|
|
5489
5570
|
/**
|