@viamrobotics/motion-tools 1.12.3 → 1.13.1
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/FrameConfigUpdater.svelte.js +1 -1
- package/dist/WorldObject.svelte.js +26 -13
- package/dist/buf/draw/v1/service_connect.d.ts +14 -25
- package/dist/buf/draw/v1/service_connect.js +14 -25
- package/dist/buf/draw/v1/service_pb.d.ts +61 -76
- package/dist/buf/draw/v1/service_pb.js +58 -111
- package/dist/color.js +3 -3
- package/dist/components/App.svelte +5 -6
- package/dist/components/Camera.svelte +1 -7
- package/dist/components/Camera.svelte.d.ts +0 -1
- package/dist/components/CameraControls.svelte +2 -2
- package/dist/components/{Arrows → Entities/Arrows}/ArrowGroups.svelte +3 -3
- package/dist/components/{Arrows → Entities/Arrows}/Arrows.svelte +6 -6
- package/dist/components/{Arrows → Entities/Arrows}/Arrows.svelte.d.ts +1 -1
- package/dist/components/{Entities.svelte → Entities/Entities.svelte} +5 -1
- package/dist/components/{Frame.svelte → Entities/Frame.svelte} +8 -8
- package/dist/components/{GLTF.svelte → Entities/GLTF.svelte} +5 -5
- package/dist/components/{Geometry.svelte → Entities/Geometry.svelte} +48 -53
- package/dist/components/{Label.svelte → Entities/Label.svelte} +1 -1
- package/dist/components/{Line.svelte → Entities/Line.svelte} +2 -2
- package/dist/components/{Points.svelte → Entities/Points.svelte} +5 -5
- package/dist/components/{Pose.svelte → Entities/Pose.svelte} +3 -3
- package/dist/{hooks/useObjectEvents.svelte.d.ts → components/Entities/hooks/useEntityEvents.svelte.d.ts} +1 -1
- package/dist/{hooks/useObjectEvents.svelte.js → components/Entities/hooks/useEntityEvents.svelte.js} +6 -6
- package/dist/components/FileDrop/file-names.js +6 -3
- package/dist/components/FileDrop/snapshot-dropper.js +8 -4
- package/dist/components/FileDrop/useFileDrop.svelte.js +9 -6
- package/dist/components/Lasso/Lasso.svelte +4 -4
- package/dist/components/PCD.svelte +14 -6
- package/dist/components/PCD.svelte.d.ts +2 -0
- package/dist/components/Scene.svelte +1 -3
- package/dist/components/SceneProviders.svelte +2 -0
- package/dist/components/Selected.svelte +9 -9
- package/dist/components/StaticGeometries.svelte +6 -3
- package/dist/components/overlay/AddRelationship.svelte +1 -1
- package/dist/components/overlay/Details.svelte +3 -3
- package/dist/components/overlay/FloatingPanel.svelte +3 -0
- package/dist/components/overlay/FloatingPanel.svelte.d.ts +1 -0
- package/dist/components/overlay/LiveUpdatesBanner.svelte +4 -6
- package/dist/components/overlay/Logs.svelte +75 -0
- package/dist/components/overlay/left-pane/TreeContainer.svelte +0 -3
- package/dist/components/overlay/settings/Settings.svelte +11 -13
- package/dist/components/overlay/widgets/Camera.svelte +11 -9
- package/dist/components/xr/ArmTeleop.svelte +33 -33
- package/dist/components/xr/CameraFeed.svelte +21 -23
- package/dist/components/xr/JointLimitsWidget.svelte +19 -5
- package/dist/components/xr/XRConfigPanel.svelte +17 -16
- package/dist/components/xr/XRControllerSettings.svelte +5 -4
- package/dist/components/xr/XRToast.svelte +11 -6
- package/dist/ecs/relations.d.ts +1 -0
- package/dist/ecs/relations.js +1 -0
- package/dist/ecs/useQuery.svelte.js +3 -3
- package/dist/format.js +1 -1
- package/dist/hooks/use3DModels.svelte.js +35 -36
- package/dist/hooks/useConfigFrames.svelte.d.ts +9 -0
- package/dist/hooks/useConfigFrames.svelte.js +87 -0
- package/dist/hooks/useDrawAPI.svelte.js +1 -1
- package/dist/hooks/useFramelessComponents.svelte.js +1 -1
- package/dist/hooks/useFrames.svelte.d.ts +1 -6
- package/dist/hooks/useFrames.svelte.js +93 -192
- package/dist/hooks/useGeometries.svelte.js +1 -1
- package/dist/hooks/useLinked.svelte.js +5 -4
- package/dist/hooks/usePartConfig.svelte.js +17 -18
- package/dist/hooks/usePointcloudObjects.svelte.js +4 -4
- package/dist/hooks/usePointclouds.svelte.js +2 -4
- package/dist/hooks/usePose.svelte.js +3 -7
- package/dist/hooks/useResizable.svelte.js +4 -3
- package/dist/hooks/useSettings.svelte.js +2 -2
- package/dist/hooks/useVisibility.svelte.js +0 -12
- package/dist/hooks/useWeblabs.svelte.js +3 -2
- package/dist/hooks/useWorldState.svelte.js +6 -3
- package/dist/loaders/pcd/index.js +2 -1
- package/dist/loaders/pcd/worker.inline.d.ts +1 -1
- package/dist/loaders/pcd/worker.inline.js +1 -1
- package/dist/loaders/pcd/worker.js +1 -1
- package/dist/snapshot.js +7 -5
- package/dist/three/InstancedArrows/InstancedArrows.js +1 -1
- package/dist/three/InstancedArrows/box.js +1 -1
- package/dist/three/InstancedArrows/raycast.js +12 -12
- package/package.json +19 -11
- package/dist/components/overlay/left-pane/Logs.svelte +0 -52
- /package/dist/components/{Arrows → Entities/Arrows}/ArrowGroups.svelte.d.ts +0 -0
- /package/dist/components/{Entities.svelte.d.ts → Entities/Entities.svelte.d.ts} +0 -0
- /package/dist/components/{Frame.svelte.d.ts → Entities/Frame.svelte.d.ts} +0 -0
- /package/dist/components/{GLTF.svelte.d.ts → Entities/GLTF.svelte.d.ts} +0 -0
- /package/dist/components/{Geometry.svelte.d.ts → Entities/Geometry.svelte.d.ts} +0 -0
- /package/dist/components/{Label.svelte.d.ts → Entities/Label.svelte.d.ts} +0 -0
- /package/dist/components/{Line.svelte.d.ts → Entities/Line.svelte.d.ts} +0 -0
- /package/dist/components/{LineDots.svelte → Entities/LineDots.svelte} +0 -0
- /package/dist/components/{LineDots.svelte.d.ts → Entities/LineDots.svelte.d.ts} +0 -0
- /package/dist/components/{LineGeometry.svelte → Entities/LineGeometry.svelte} +0 -0
- /package/dist/components/{LineGeometry.svelte.d.ts → Entities/LineGeometry.svelte.d.ts} +0 -0
- /package/dist/components/{Points.svelte.d.ts → Entities/Points.svelte.d.ts} +0 -0
- /package/dist/components/{Pose.svelte.d.ts → Entities/Pose.svelte.d.ts} +0 -0
- /package/dist/components/overlay/{left-pane/Logs.svelte.d.ts → Logs.svelte.d.ts} +0 -0
|
@@ -7,33 +7,33 @@ import { Transform } from "../../common/v1/common_pb";
|
|
|
7
7
|
import { Drawing } from "./drawing_pb";
|
|
8
8
|
import { SceneMetadata } from "./scene_pb";
|
|
9
9
|
/**
|
|
10
|
-
* @generated from enum draw.v1.
|
|
10
|
+
* @generated from enum draw.v1.EntityChangeType
|
|
11
11
|
*/
|
|
12
|
-
export var
|
|
13
|
-
(function (
|
|
12
|
+
export var EntityChangeType;
|
|
13
|
+
(function (EntityChangeType) {
|
|
14
14
|
/**
|
|
15
|
-
* @generated from enum value:
|
|
15
|
+
* @generated from enum value: ENTITY_CHANGE_TYPE_UNSPECIFIED = 0;
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
EntityChangeType[EntityChangeType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
18
18
|
/**
|
|
19
|
-
* @generated from enum value:
|
|
19
|
+
* @generated from enum value: ENTITY_CHANGE_TYPE_ADDED = 1;
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
EntityChangeType[EntityChangeType["ADDED"] = 1] = "ADDED";
|
|
22
22
|
/**
|
|
23
|
-
* @generated from enum value:
|
|
23
|
+
* @generated from enum value: ENTITY_CHANGE_TYPE_REMOVED = 2;
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
EntityChangeType[EntityChangeType["REMOVED"] = 2] = "REMOVED";
|
|
26
26
|
/**
|
|
27
|
-
* @generated from enum value:
|
|
27
|
+
* @generated from enum value: ENTITY_CHANGE_TYPE_UPDATED = 3;
|
|
28
28
|
*/
|
|
29
|
-
|
|
30
|
-
})(
|
|
31
|
-
// Retrieve enum metadata with: proto3.getEnumType(
|
|
32
|
-
proto3.util.setEnumType(
|
|
33
|
-
{ no: 0, name: "
|
|
34
|
-
{ no: 1, name: "
|
|
35
|
-
{ no: 2, name: "
|
|
36
|
-
{ no: 3, name: "
|
|
29
|
+
EntityChangeType[EntityChangeType["UPDATED"] = 3] = "UPDATED";
|
|
30
|
+
})(EntityChangeType || (EntityChangeType = {}));
|
|
31
|
+
// Retrieve enum metadata with: proto3.getEnumType(EntityChangeType)
|
|
32
|
+
proto3.util.setEnumType(EntityChangeType, "draw.v1.EntityChangeType", [
|
|
33
|
+
{ no: 0, name: "ENTITY_CHANGE_TYPE_UNSPECIFIED" },
|
|
34
|
+
{ no: 1, name: "ENTITY_CHANGE_TYPE_ADDED" },
|
|
35
|
+
{ no: 2, name: "ENTITY_CHANGE_TYPE_REMOVED" },
|
|
36
|
+
{ no: 3, name: "ENTITY_CHANGE_TYPE_UPDATED" },
|
|
37
37
|
]);
|
|
38
38
|
/**
|
|
39
39
|
* @generated from message draw.v1.AddEntityRequest
|
|
@@ -272,62 +272,68 @@ export class RemoveAllTransformsResponse extends Message {
|
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
/**
|
|
275
|
-
* @generated from message draw.v1.
|
|
275
|
+
* @generated from message draw.v1.StreamEntityChangesRequest
|
|
276
276
|
*/
|
|
277
|
-
export class
|
|
277
|
+
export class StreamEntityChangesRequest extends Message {
|
|
278
278
|
constructor(data) {
|
|
279
279
|
super();
|
|
280
280
|
proto3.util.initPartial(data, this);
|
|
281
281
|
}
|
|
282
282
|
static runtime = proto3;
|
|
283
|
-
static typeName = "draw.v1.
|
|
283
|
+
static typeName = "draw.v1.StreamEntityChangesRequest";
|
|
284
284
|
static fields = proto3.util.newFieldList(() => []);
|
|
285
285
|
static fromBinary(bytes, options) {
|
|
286
|
-
return new
|
|
286
|
+
return new StreamEntityChangesRequest().fromBinary(bytes, options);
|
|
287
287
|
}
|
|
288
288
|
static fromJson(jsonValue, options) {
|
|
289
|
-
return new
|
|
289
|
+
return new StreamEntityChangesRequest().fromJson(jsonValue, options);
|
|
290
290
|
}
|
|
291
291
|
static fromJsonString(jsonString, options) {
|
|
292
|
-
return new
|
|
292
|
+
return new StreamEntityChangesRequest().fromJsonString(jsonString, options);
|
|
293
293
|
}
|
|
294
294
|
static equals(a, b) {
|
|
295
|
-
return proto3.util.equals(
|
|
295
|
+
return proto3.util.equals(StreamEntityChangesRequest, a, b);
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
/**
|
|
299
|
-
* @generated from message draw.v1.
|
|
299
|
+
* @generated from message draw.v1.StreamEntityChangesResponse
|
|
300
300
|
*/
|
|
301
|
-
export class
|
|
301
|
+
export class StreamEntityChangesResponse extends Message {
|
|
302
302
|
/**
|
|
303
|
-
* @generated from field: draw.v1.
|
|
303
|
+
* @generated from field: draw.v1.EntityChangeType change_type = 1;
|
|
304
304
|
*/
|
|
305
|
-
changeType =
|
|
305
|
+
changeType = EntityChangeType.UNSPECIFIED;
|
|
306
306
|
/**
|
|
307
|
-
* @generated from
|
|
307
|
+
* @generated from oneof draw.v1.StreamEntityChangesResponse.entity
|
|
308
308
|
*/
|
|
309
|
-
|
|
309
|
+
entity = { case: undefined };
|
|
310
|
+
/**
|
|
311
|
+
* @generated from field: google.protobuf.FieldMask updated_fields = 4;
|
|
312
|
+
*/
|
|
313
|
+
updatedFields;
|
|
310
314
|
constructor(data) {
|
|
311
315
|
super();
|
|
312
316
|
proto3.util.initPartial(data, this);
|
|
313
317
|
}
|
|
314
318
|
static runtime = proto3;
|
|
315
|
-
static typeName = "draw.v1.
|
|
319
|
+
static typeName = "draw.v1.StreamEntityChangesResponse";
|
|
316
320
|
static fields = proto3.util.newFieldList(() => [
|
|
317
|
-
{ no: 1, name: "change_type", kind: "enum", T: proto3.getEnumType(
|
|
318
|
-
{ no: 2, name: "transform", kind: "message", T: Transform },
|
|
321
|
+
{ no: 1, name: "change_type", kind: "enum", T: proto3.getEnumType(EntityChangeType) },
|
|
322
|
+
{ no: 2, name: "transform", kind: "message", T: Transform, oneof: "entity" },
|
|
323
|
+
{ no: 3, name: "drawing", kind: "message", T: Drawing, oneof: "entity" },
|
|
324
|
+
{ no: 4, name: "updated_fields", kind: "message", T: FieldMask },
|
|
319
325
|
]);
|
|
320
326
|
static fromBinary(bytes, options) {
|
|
321
|
-
return new
|
|
327
|
+
return new StreamEntityChangesResponse().fromBinary(bytes, options);
|
|
322
328
|
}
|
|
323
329
|
static fromJson(jsonValue, options) {
|
|
324
|
-
return new
|
|
330
|
+
return new StreamEntityChangesResponse().fromJson(jsonValue, options);
|
|
325
331
|
}
|
|
326
332
|
static fromJsonString(jsonString, options) {
|
|
327
|
-
return new
|
|
333
|
+
return new StreamEntityChangesResponse().fromJsonString(jsonString, options);
|
|
328
334
|
}
|
|
329
335
|
static equals(a, b) {
|
|
330
|
-
return proto3.util.equals(
|
|
336
|
+
return proto3.util.equals(StreamEntityChangesResponse, a, b);
|
|
331
337
|
}
|
|
332
338
|
}
|
|
333
339
|
/**
|
|
@@ -385,68 +391,9 @@ export class RemoveAllDrawingsResponse extends Message {
|
|
|
385
391
|
}
|
|
386
392
|
}
|
|
387
393
|
/**
|
|
388
|
-
* @generated from message draw.v1.
|
|
389
|
-
*/
|
|
390
|
-
export class StreamDrawingChangesRequest extends Message {
|
|
391
|
-
constructor(data) {
|
|
392
|
-
super();
|
|
393
|
-
proto3.util.initPartial(data, this);
|
|
394
|
-
}
|
|
395
|
-
static runtime = proto3;
|
|
396
|
-
static typeName = "draw.v1.StreamDrawingChangesRequest";
|
|
397
|
-
static fields = proto3.util.newFieldList(() => []);
|
|
398
|
-
static fromBinary(bytes, options) {
|
|
399
|
-
return new StreamDrawingChangesRequest().fromBinary(bytes, options);
|
|
400
|
-
}
|
|
401
|
-
static fromJson(jsonValue, options) {
|
|
402
|
-
return new StreamDrawingChangesRequest().fromJson(jsonValue, options);
|
|
403
|
-
}
|
|
404
|
-
static fromJsonString(jsonString, options) {
|
|
405
|
-
return new StreamDrawingChangesRequest().fromJsonString(jsonString, options);
|
|
406
|
-
}
|
|
407
|
-
static equals(a, b) {
|
|
408
|
-
return proto3.util.equals(StreamDrawingChangesRequest, a, b);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* @generated from message draw.v1.StreamDrawingChangesResponse
|
|
413
|
-
*/
|
|
414
|
-
export class StreamDrawingChangesResponse extends Message {
|
|
415
|
-
/**
|
|
416
|
-
* @generated from field: draw.v1.ChangeType change_type = 1;
|
|
417
|
-
*/
|
|
418
|
-
changeType = ChangeType.UNSPECIFIED;
|
|
419
|
-
/**
|
|
420
|
-
* @generated from field: draw.v1.Drawing drawing = 2;
|
|
421
|
-
*/
|
|
422
|
-
drawing;
|
|
423
|
-
constructor(data) {
|
|
424
|
-
super();
|
|
425
|
-
proto3.util.initPartial(data, this);
|
|
426
|
-
}
|
|
427
|
-
static runtime = proto3;
|
|
428
|
-
static typeName = "draw.v1.StreamDrawingChangesResponse";
|
|
429
|
-
static fields = proto3.util.newFieldList(() => [
|
|
430
|
-
{ no: 1, name: "change_type", kind: "enum", T: proto3.getEnumType(ChangeType) },
|
|
431
|
-
{ no: 2, name: "drawing", kind: "message", T: Drawing },
|
|
432
|
-
]);
|
|
433
|
-
static fromBinary(bytes, options) {
|
|
434
|
-
return new StreamDrawingChangesResponse().fromBinary(bytes, options);
|
|
435
|
-
}
|
|
436
|
-
static fromJson(jsonValue, options) {
|
|
437
|
-
return new StreamDrawingChangesResponse().fromJson(jsonValue, options);
|
|
438
|
-
}
|
|
439
|
-
static fromJsonString(jsonString, options) {
|
|
440
|
-
return new StreamDrawingChangesResponse().fromJsonString(jsonString, options);
|
|
441
|
-
}
|
|
442
|
-
static equals(a, b) {
|
|
443
|
-
return proto3.util.equals(StreamDrawingChangesResponse, a, b);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
/**
|
|
447
|
-
* @generated from message draw.v1.SetSceneMetadataRequest
|
|
394
|
+
* @generated from message draw.v1.SetSceneRequest
|
|
448
395
|
*/
|
|
449
|
-
export class
|
|
396
|
+
export class SetSceneRequest extends Message {
|
|
450
397
|
/**
|
|
451
398
|
* @generated from field: draw.v1.SceneMetadata scene_metadata = 1;
|
|
452
399
|
*/
|
|
@@ -456,45 +403,45 @@ export class SetSceneMetadataRequest extends Message {
|
|
|
456
403
|
proto3.util.initPartial(data, this);
|
|
457
404
|
}
|
|
458
405
|
static runtime = proto3;
|
|
459
|
-
static typeName = "draw.v1.
|
|
406
|
+
static typeName = "draw.v1.SetSceneRequest";
|
|
460
407
|
static fields = proto3.util.newFieldList(() => [
|
|
461
408
|
{ no: 1, name: "scene_metadata", kind: "message", T: SceneMetadata },
|
|
462
409
|
]);
|
|
463
410
|
static fromBinary(bytes, options) {
|
|
464
|
-
return new
|
|
411
|
+
return new SetSceneRequest().fromBinary(bytes, options);
|
|
465
412
|
}
|
|
466
413
|
static fromJson(jsonValue, options) {
|
|
467
|
-
return new
|
|
414
|
+
return new SetSceneRequest().fromJson(jsonValue, options);
|
|
468
415
|
}
|
|
469
416
|
static fromJsonString(jsonString, options) {
|
|
470
|
-
return new
|
|
417
|
+
return new SetSceneRequest().fromJsonString(jsonString, options);
|
|
471
418
|
}
|
|
472
419
|
static equals(a, b) {
|
|
473
|
-
return proto3.util.equals(
|
|
420
|
+
return proto3.util.equals(SetSceneRequest, a, b);
|
|
474
421
|
}
|
|
475
422
|
}
|
|
476
423
|
/**
|
|
477
|
-
* @generated from message draw.v1.
|
|
424
|
+
* @generated from message draw.v1.SetSceneResponse
|
|
478
425
|
*/
|
|
479
|
-
export class
|
|
426
|
+
export class SetSceneResponse extends Message {
|
|
480
427
|
constructor(data) {
|
|
481
428
|
super();
|
|
482
429
|
proto3.util.initPartial(data, this);
|
|
483
430
|
}
|
|
484
431
|
static runtime = proto3;
|
|
485
|
-
static typeName = "draw.v1.
|
|
432
|
+
static typeName = "draw.v1.SetSceneResponse";
|
|
486
433
|
static fields = proto3.util.newFieldList(() => []);
|
|
487
434
|
static fromBinary(bytes, options) {
|
|
488
|
-
return new
|
|
435
|
+
return new SetSceneResponse().fromBinary(bytes, options);
|
|
489
436
|
}
|
|
490
437
|
static fromJson(jsonValue, options) {
|
|
491
|
-
return new
|
|
438
|
+
return new SetSceneResponse().fromJson(jsonValue, options);
|
|
492
439
|
}
|
|
493
440
|
static fromJsonString(jsonString, options) {
|
|
494
|
-
return new
|
|
441
|
+
return new SetSceneResponse().fromJsonString(jsonString, options);
|
|
495
442
|
}
|
|
496
443
|
static equals(a, b) {
|
|
497
|
-
return proto3.util.equals(
|
|
444
|
+
return proto3.util.equals(SetSceneResponse, a, b);
|
|
498
445
|
}
|
|
499
446
|
}
|
|
500
447
|
/**
|
package/dist/color.js
CHANGED
|
@@ -17,9 +17,9 @@ const oklchToHex = (raw) => {
|
|
|
17
17
|
if (!match) {
|
|
18
18
|
return raw;
|
|
19
19
|
}
|
|
20
|
-
const l = parseFloat(match[1]) / 100;
|
|
21
|
-
const c = parseFloat(match[2]);
|
|
22
|
-
const h = parseFloat(match[3]);
|
|
20
|
+
const l = Number.parseFloat(match[1]) / 100;
|
|
21
|
+
const c = Number.parseFloat(match[2]);
|
|
22
|
+
const h = Number.parseFloat(match[3]);
|
|
23
23
|
// Convert h from degrees to radians
|
|
24
24
|
const hRad = (h * Math.PI) / 180;
|
|
25
25
|
// Step 1: OKLCH → OKLab
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
import HoveredEntities from './hover/HoveredEntities.svelte'
|
|
31
31
|
import Settings from './overlay/settings/Settings.svelte'
|
|
32
32
|
import { useXR } from '@threlte/xr'
|
|
33
|
+
import Logs from './overlay/Logs.svelte'
|
|
33
34
|
|
|
34
35
|
interface LocalConfigProps {
|
|
35
36
|
current: Struct
|
|
@@ -86,11 +87,7 @@
|
|
|
86
87
|
)
|
|
87
88
|
|
|
88
89
|
$effect.pre(() => {
|
|
89
|
-
|
|
90
|
-
environment.current.isStandalone = false
|
|
91
|
-
} else {
|
|
92
|
-
environment.current.isStandalone = true
|
|
93
|
-
}
|
|
90
|
+
environment.current.isStandalone = !localConfigProps
|
|
94
91
|
})
|
|
95
92
|
</script>
|
|
96
93
|
|
|
@@ -120,7 +117,6 @@
|
|
|
120
117
|
<FileDrop />
|
|
121
118
|
<Dashboard {dashboard} />
|
|
122
119
|
<Details />
|
|
123
|
-
<Settings />
|
|
124
120
|
|
|
125
121
|
{#if environment.current.isStandalone}
|
|
126
122
|
<LiveUpdatesBanner />
|
|
@@ -141,6 +137,9 @@
|
|
|
141
137
|
{/if}
|
|
142
138
|
|
|
143
139
|
<PortalTarget id="dom" />
|
|
140
|
+
|
|
141
|
+
<Settings />
|
|
142
|
+
<Logs />
|
|
144
143
|
</div>
|
|
145
144
|
{/snippet}
|
|
146
145
|
</SceneProviders>
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { T
|
|
2
|
+
import { T } from '@threlte/core'
|
|
3
3
|
import { useSettings } from '../hooks/useSettings.svelte'
|
|
4
|
-
import type { Camera } from 'three'
|
|
5
4
|
|
|
6
5
|
let { children, ...rest } = $props()
|
|
7
6
|
|
|
8
|
-
const { camera } = useThrelte()
|
|
9
7
|
const settings = useSettings()
|
|
10
8
|
const mode = $derived(settings.current.cameraMode)
|
|
11
|
-
|
|
12
|
-
$effect(() => {
|
|
13
|
-
;(window as unknown as { camera: Camera }).camera = $camera
|
|
14
|
-
})
|
|
15
9
|
</script>
|
|
16
10
|
|
|
17
11
|
{#if mode === 'perspective'}
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
enabled={!transformControls.active}
|
|
31
31
|
oncreate={(ref) => {
|
|
32
32
|
cameraControls.set(ref)
|
|
33
|
-
;(
|
|
34
|
-
;(
|
|
33
|
+
;(globalThis as unknown as { MathUtils: typeof MathUtils }).MathUtils = MathUtils
|
|
34
|
+
;(globalThis as unknown as { cameraControls: CameraControlsRef }).cameraControls = ref
|
|
35
35
|
}}
|
|
36
36
|
>
|
|
37
37
|
{#snippet children({ ref }: { ref: CameraControlsRef })}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { InstancedArrows } from '
|
|
3
|
-
import { traits, useWorld } from '
|
|
2
|
+
import { InstancedArrows } from '../../../three/InstancedArrows/InstancedArrows'
|
|
3
|
+
import { traits, useWorld } from '../../../ecs'
|
|
4
4
|
import type { Entity } from 'koota'
|
|
5
|
-
import { STRIDE } from '
|
|
5
|
+
import { STRIDE } from '../../../buffer'
|
|
6
6
|
import { SvelteMap } from 'svelte/reactivity'
|
|
7
7
|
import { Color } from 'three'
|
|
8
8
|
import Arrows from './Arrows.svelte'
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { T } from '@threlte/core'
|
|
3
3
|
import { Portal } from '@threlte/extras'
|
|
4
4
|
import type { Entity } from 'koota'
|
|
5
|
-
import { traits } from '
|
|
6
|
-
import {
|
|
7
|
-
import type { InstancedArrows } from '
|
|
8
|
-
import { useFocusedEntity, useSelectedEntity } from '
|
|
9
|
-
import { meshBoundsRaycast, raycast } from '
|
|
5
|
+
import { traits } from '../../../ecs'
|
|
6
|
+
import { useEntityEvents } from '../hooks/useEntityEvents.svelte'
|
|
7
|
+
import type { InstancedArrows } from '../../../three/InstancedArrows/InstancedArrows'
|
|
8
|
+
import { useFocusedEntity, useSelectedEntity } from '../../../hooks/useSelection.svelte'
|
|
9
|
+
import { meshBoundsRaycast, raycast } from '../../../three/InstancedArrows/raycast'
|
|
10
10
|
|
|
11
11
|
interface Props {
|
|
12
12
|
entity: Entity
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
let { entity, arrows }: Props = $props()
|
|
17
17
|
|
|
18
|
-
const events =
|
|
18
|
+
const events = useEntityEvents(() => entity)
|
|
19
19
|
const selectedEntity = useSelectedEntity()
|
|
20
20
|
const focusedEntity = useFocusedEntity()
|
|
21
21
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Entity } from 'koota';
|
|
2
|
-
import type { InstancedArrows } from '
|
|
2
|
+
import type { InstancedArrows } from '../../../three/InstancedArrows/InstancedArrows';
|
|
3
3
|
interface Props {
|
|
4
4
|
entity: Entity;
|
|
5
5
|
arrows: InstancedArrows;
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
import Label from './Label.svelte'
|
|
6
6
|
import Line from './Line.svelte'
|
|
7
7
|
import Points from './Points.svelte'
|
|
8
|
-
import
|
|
8
|
+
import Arrows from './Arrows/ArrowGroups.svelte'
|
|
9
|
+
|
|
10
|
+
import { traits, useQuery } from '../../ecs'
|
|
9
11
|
import { Not, Or } from 'koota'
|
|
10
12
|
|
|
11
13
|
/**
|
|
@@ -94,3 +96,5 @@
|
|
|
94
96
|
<Label text={entity.get(traits.Name)} />
|
|
95
97
|
</GLTF>
|
|
96
98
|
{/each}
|
|
99
|
+
|
|
100
|
+
<Arrows />
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte'
|
|
3
|
-
import {
|
|
3
|
+
import { useEntityEvents } from './hooks/useEntityEvents.svelte'
|
|
4
4
|
import { Color, Group, type Object3D } from 'three'
|
|
5
5
|
import Geometry from './Geometry.svelte'
|
|
6
|
-
import { useSelectedEntity } from '
|
|
7
|
-
import { useSettings } from '
|
|
8
|
-
import { use3DModels } from '
|
|
9
|
-
import { colors, darkenColor, resourceColors } from '
|
|
6
|
+
import { useSelectedEntity } from '../../hooks/useSelection.svelte'
|
|
7
|
+
import { useSettings } from '../../hooks/useSettings.svelte'
|
|
8
|
+
import { use3DModels } from '../../hooks/use3DModels.svelte'
|
|
9
|
+
import { colors, darkenColor, resourceColors } from '../../color'
|
|
10
10
|
import type { Entity } from 'koota'
|
|
11
|
-
import { traits, useTrait } from '
|
|
11
|
+
import { traits, useTrait } from '../../ecs'
|
|
12
12
|
import type { Pose } from '@viamrobotics/sdk'
|
|
13
|
-
import { useResourceByName } from '
|
|
13
|
+
import { useResourceByName } from '../../hooks/useResourceByName.svelte'
|
|
14
14
|
import { Portal, PortalTarget } from '@threlte/extras'
|
|
15
15
|
|
|
16
16
|
interface Props {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
const parent = useTrait(() => entity, traits.Parent)
|
|
35
35
|
const entityColor = useTrait(() => entity, traits.Color)
|
|
36
36
|
|
|
37
|
-
const events =
|
|
37
|
+
const events = useEntityEvents(() => entity)
|
|
38
38
|
const resourceColor = $derived.by(() => {
|
|
39
39
|
if (!name.current) {
|
|
40
40
|
return undefined
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
import { Portal, PortalTarget, useGltfAnimations, type ThrelteGltf } from '@threlte/extras'
|
|
17
17
|
import type { Snippet } from 'svelte'
|
|
18
18
|
import { Group, type Object3D } from 'three'
|
|
19
|
-
import {
|
|
19
|
+
import { useEntityEvents } from './hooks/useEntityEvents.svelte'
|
|
20
20
|
import type { Entity } from 'koota'
|
|
21
|
-
import { traits, useTrait } from '
|
|
22
|
-
import { poseToObject3d } from '
|
|
21
|
+
import { traits, useTrait } from '../../ecs'
|
|
22
|
+
import { poseToObject3d } from '../../transform'
|
|
23
23
|
|
|
24
24
|
interface Props extends ThrelteProps<Object3D> {
|
|
25
25
|
entity: Entity
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
const pose = useTrait(() => entity, traits.Pose)
|
|
36
36
|
const gltfTrait = useTrait(() => entity, traits.GLTF)
|
|
37
37
|
const scale = useTrait(() => entity, traits.Scale)
|
|
38
|
-
const
|
|
38
|
+
const events = useEntityEvents(() => entity)
|
|
39
39
|
|
|
40
40
|
const animationName = $derived(gltfTrait.current?.animationName)
|
|
41
41
|
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
is={$gltf.scene as Object3D}
|
|
86
86
|
scale={[scale.current?.x ?? 1, scale.current?.y ?? 1, scale.current?.z ?? 1]}
|
|
87
87
|
name={entity}
|
|
88
|
-
{...
|
|
88
|
+
{...events}
|
|
89
89
|
{...rest}
|
|
90
90
|
>
|
|
91
91
|
{@render children?.()}
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
import { meshBounds } from '@threlte/extras'
|
|
5
5
|
import { BufferGeometry, Color, DoubleSide, FrontSide, Group, Mesh } from 'three'
|
|
6
6
|
import { Line2, LineMaterial } from 'three/examples/jsm/Addons.js'
|
|
7
|
-
import { CapsuleGeometry } from '
|
|
8
|
-
import { colors, darkenColor } from '
|
|
9
|
-
import AxesHelper from '
|
|
7
|
+
import { CapsuleGeometry } from '../../three/CapsuleGeometry'
|
|
8
|
+
import { colors, darkenColor } from '../../color'
|
|
9
|
+
import AxesHelper from '../AxesHelper.svelte'
|
|
10
10
|
import type { Entity } from 'koota'
|
|
11
|
-
import { traits, useTrait } from '
|
|
12
|
-
import { poseToObject3d } from '
|
|
11
|
+
import { traits, useTrait } from '../../ecs'
|
|
12
|
+
import { poseToObject3d } from '../../transform'
|
|
13
13
|
import type { Pose } from '@viamrobotics/sdk'
|
|
14
14
|
import LineGeometry from './LineGeometry.svelte'
|
|
15
15
|
|
|
@@ -128,24 +128,17 @@
|
|
|
128
128
|
{...rest}
|
|
129
129
|
>
|
|
130
130
|
{#if geometryType}
|
|
131
|
-
{#if
|
|
132
|
-
<
|
|
133
|
-
width={3}
|
|
134
|
-
length={0.1}
|
|
135
|
-
/>
|
|
131
|
+
{#if model && renderMode.includes('model')}
|
|
132
|
+
<T is={model} />
|
|
136
133
|
{/if}
|
|
137
134
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
<T is={model} />
|
|
146
|
-
{/if}
|
|
147
|
-
|
|
148
|
-
{#if !model || renderMode.includes('colliders')}
|
|
135
|
+
{#if !model || renderMode.includes('colliders')}
|
|
136
|
+
<T
|
|
137
|
+
is={mesh}
|
|
138
|
+
name={entity}
|
|
139
|
+
userData.name={name}
|
|
140
|
+
renderOrder={renderOrder.current}
|
|
141
|
+
>
|
|
149
142
|
{#if linePositions.current}
|
|
150
143
|
<LineGeometry positions={linePositions.current} />
|
|
151
144
|
{:else if box.current}
|
|
@@ -168,40 +161,42 @@
|
|
|
168
161
|
{oncreate}
|
|
169
162
|
/>
|
|
170
163
|
{/if}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
164
|
+
|
|
165
|
+
{#if linePositions.current}
|
|
166
|
+
<T
|
|
167
|
+
is={LineMaterial}
|
|
168
|
+
{color}
|
|
169
|
+
width={lineWidth.current ? lineWidth.current * 0.001 : 0.5}
|
|
170
|
+
depthTest={materialProps.current?.depthTest ?? true}
|
|
171
|
+
/>
|
|
172
|
+
{:else}
|
|
173
|
+
{@const currentOpacity = opacity.current ?? 0.7}
|
|
174
|
+
<T.MeshToonMaterial
|
|
175
|
+
{color}
|
|
176
|
+
side={geometryType === 'buffer' ? DoubleSide : FrontSide}
|
|
177
|
+
transparent={currentOpacity < 1}
|
|
178
|
+
depthWrite={currentOpacity === 1}
|
|
179
|
+
opacity={currentOpacity}
|
|
180
|
+
depthTest={materialProps.current?.depthTest ?? true}
|
|
181
|
+
/>
|
|
182
|
+
|
|
183
|
+
{#if geo && (renderMode.includes('colliders') || !model)}
|
|
184
|
+
<T.LineSegments
|
|
185
|
+
raycast={() => null}
|
|
186
|
+
bvh={{ enabled: false }}
|
|
187
|
+
>
|
|
188
|
+
<T.EdgesGeometry args={[geo, 0]} />
|
|
189
|
+
<T.LineBasicMaterial color={darkenColor(color, 10)} />
|
|
190
|
+
</T.LineSegments>
|
|
191
|
+
{/if}
|
|
199
192
|
{/if}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
{
|
|
193
|
+
</T>
|
|
194
|
+
{/if}
|
|
195
|
+
{/if}
|
|
196
|
+
|
|
197
|
+
{#if showAxesHelper.current}
|
|
203
198
|
<AxesHelper
|
|
204
|
-
name={
|
|
199
|
+
name={entity}
|
|
205
200
|
width={3}
|
|
206
201
|
length={0.1}
|
|
207
202
|
/>
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
import Frame from './Frame.svelte'
|
|
9
9
|
import type { Snippet } from 'svelte'
|
|
10
10
|
import type { Entity } from 'koota'
|
|
11
|
-
import { traits, useTrait } from '
|
|
11
|
+
import { traits, useTrait } from '../../ecs'
|
|
12
12
|
import LineDots from './LineDots.svelte'
|
|
13
|
-
import { darkenColor } from '
|
|
13
|
+
import { darkenColor } from '../../color'
|
|
14
14
|
|
|
15
15
|
interface Props {
|
|
16
16
|
entity: Entity
|