From 27d7636a4519c9f662b3adb007f5aa56f7257f2b Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 31 Mar 2026 20:06:13 +0200 Subject: [PATCH] Rename render object creation methods in ViewportHost --- src/viewport-three/viewport-host.ts | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/viewport-three/viewport-host.ts b/src/viewport-three/viewport-host.ts index a297b0cd..2f4797f3 100644 --- a/src/viewport-three/viewport-host.ts +++ b/src/viewport-three/viewport-host.ts @@ -355,13 +355,13 @@ export class ViewportHost { switch (entity.kind) { case "pointLight": { - const renderObjects = this.createPointLightRenderObjects(entity, selected); + const renderObjects = this.createPointLightRuntimeObjects(entity); this.localLightGroup.add(renderObjects.group); this.localLightRenderObjects.set(entity.id, renderObjects); break; } case "spotLight": { - const renderObjects = this.createSpotLightRenderObjects(entity, selected); + const renderObjects = this.createSpotLightRuntimeObjects(entity); this.localLightGroup.add(renderObjects.group); this.localLightRenderObjects.set(entity.id, renderObjects); break; @@ -469,7 +469,7 @@ export class ViewportHost { group.add(mesh); } - private createPointLightRenderObjects( + private createPointLightGizmoRenderObjects( entityId: string, position: Vec3, distance: number, @@ -516,7 +516,7 @@ export class ViewportHost { }; } - private createSpotLightRenderObjects( + private createSpotLightGizmoRenderObjects( entityId: string, position: Vec3, direction: Vec3, @@ -571,7 +571,7 @@ export class ViewportHost { }; } - private createSpotLightObjects(entity: SpotLightEntity): Group { + private createSpotLightRuntimeObjects(entity: SpotLightEntity): LocalLightRenderObjects { const group = new Group(); const light = new SpotLight(entity.colorHex, entity.intensity, entity.distance, (entity.angleDegrees * Math.PI) / 180, 0.18, 1); const direction = new Vector3(entity.direction.x, entity.direction.y, entity.direction.z).normalize(); @@ -584,10 +584,12 @@ export class ViewportHost { group.add(light); group.add(light.target); - return group; + return { + group + }; } - private createPointLightObjects(entity: PointLightEntity): Group { + private createPointLightRuntimeObjects(entity: PointLightEntity): LocalLightRenderObjects { const group = new Group(); const light = new PointLight(entity.colorHex, entity.intensity, entity.distance); @@ -595,21 +597,11 @@ export class ViewportHost { light.position.set(0, 0, 0); group.add(light); - return group; - } - - private createPointLightRenderObjectsWrapper(entity: PointLightEntity): LocalLightRenderObjects { return { group: this.createPointLightObjects(entity) }; } - private createSpotLightRenderObjectsWrapper(entity: SpotLightEntity): LocalLightRenderObjects { - return { - group: this.createSpotLightObjects(entity) - }; - } - private createPlayerStartRenderObjects(entityId: string, position: Vec3, yawDegrees: number, selected: boolean): EntityRenderObjects { const markerColor = selected ? PLAYER_START_SELECTED_COLOR : PLAYER_START_COLOR; const group = new Group();