beam: avoid point cloud highlight masking

This commit is contained in:
CODEX
2026-06-05 00:03:31 +03:00
parent 0a09296022
commit ff994e705d
3 changed files with 20 additions and 5 deletions
+14 -3
View File
@@ -18,6 +18,13 @@ export class TransformGizmo {
this._bindTree();
}
_isPointCloudTarget(model, objectId = null) {
const entity = objectId ? this.scene.objects[objectId] : null;
const firstObject = entity || Object.values(model?.objects || {})[0];
const firstMesh = firstObject?.meshes?.[0] || model?.meshes?.[0];
return firstMesh?._geometry?._state?.primitiveName === "points";
}
setMode(next) {
if (!["translate", "rotate", "scale"].includes(next)) return;
this.mode = next;
@@ -66,7 +73,9 @@ export class TransformGizmo {
scale: model.scale ? [...model.scale] : [1, 1, 1],
},
});
this.scene.setObjectsHighlighted([objectId], true);
if (!this._isPointCloudTarget(model, objectId)) {
this.scene.setObjectsHighlighted([objectId], true);
}
this.target = { modelId, objectId };
return;
}
@@ -74,7 +83,7 @@ export class TransformGizmo {
// Если objectId нет, работаем всей моделью
const ids = Object.keys(model.objects || {});
if (ids.length) {
if (ids.length && !this._isPointCloudTarget(model)) {
this.scene.setObjectsHighlighted(ids, true);
}
this.onTargetChange?.({
@@ -101,7 +110,9 @@ export class TransformGizmo {
if (model) {
const ids = Object.keys(model.objects || {});
this.scene.setObjectsHighlighted(this.scene.highlightedObjectIds || [], false);
this.scene.setObjectsHighlighted(ids, true);
if (!this._isPointCloudTarget(model)) {
this.scene.setObjectsHighlighted(ids, true);
}
this.target = { modelId, objectId: null };
}
}