Add method to tag entity group with ID and kind
This commit is contained in:
@@ -3669,6 +3669,26 @@ export class ViewportHost {
|
|||||||
group.add(mesh);
|
group.add(mesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private tagEntityGroup(
|
||||||
|
group: Group,
|
||||||
|
entityId: string,
|
||||||
|
entityKind: EntityInstance["kind"]
|
||||||
|
): Mesh[] {
|
||||||
|
const meshes: Mesh[] = [];
|
||||||
|
|
||||||
|
group.traverse((object) => {
|
||||||
|
if (!(object instanceof Mesh)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
object.userData.entityId = entityId;
|
||||||
|
object.userData.entityKind = entityKind;
|
||||||
|
meshes.push(object);
|
||||||
|
});
|
||||||
|
|
||||||
|
return meshes;
|
||||||
|
}
|
||||||
|
|
||||||
private createPointLightGizmoRenderObjects(
|
private createPointLightGizmoRenderObjects(
|
||||||
entityId: string,
|
entityId: string,
|
||||||
position: Vec3,
|
position: Vec3,
|
||||||
|
|||||||
Reference in New Issue
Block a user