made connections not grabbable.

This commit is contained in:
Michael Mainguy 2024-05-30 10:11:07 -05:00
parent f26aa01211
commit d0b08b72e2
2 changed files with 8 additions and 2 deletions

View File

@ -139,8 +139,10 @@ export class Base {
switch (this.grabbedMeshType) { switch (this.grabbedMeshType) {
case MeshTypeEnum.ENTITY: case MeshTypeEnum.ENTITY:
const diagramObject = this.diagramManager.getDiagramObject(mesh.id); const diagramObject = this.diagramManager.getDiagramObject(mesh.id);
if (diagramObject.isGrabbable) {
diagramObject.baseTransform.setParent(this.xrInputSource.motionController.rootMesh); diagramObject.baseTransform.setParent(this.xrInputSource.motionController.rootMesh);
this.grabbedObject = diagramObject; this.grabbedObject = diagramObject;
}
break; break;
case MeshTypeEnum.HANDLE: case MeshTypeEnum.HANDLE:
this.grabbedMesh.setParent(this.xrInputSource.motionController.rootMesh); this.grabbedMesh.setParent(this.xrInputSource.motionController.rootMesh);

View File

@ -71,6 +71,10 @@ export class DiagramObject {
return this._baseTransform; return this._baseTransform;
} }
public get isGrabbable() {
return this._diagramEntity?.template !== '#connection-template';
}
public get diagramEntity(): DiagramEntity { public get diagramEntity(): DiagramEntity {
if (this._mesh) { if (this._mesh) {
this._diagramEntity = toDiagramEntity(this._mesh); this._diagramEntity = toDiagramEntity(this._mesh);