auto-git:

[change] src/viewport-three/viewport-host.ts
This commit is contained in:
2026-04-22 17:07:02 +02:00
parent fc41de7cac
commit f97654a348

View File

@@ -4679,6 +4679,27 @@ export class ViewportHost {
group.quaternion.copy(orientation);
}
private applyCameraRigGroupTransform(
group: Group,
entity: Pick<CameraRigEntity, "position" | "target" | "targetOffset">,
document: SceneDocument | null
) {
group.position.set(entity.position.x, entity.position.y, entity.position.z);
const lookTarget =
document === null
? null
: resolveCameraRigDocumentLookTarget(entity, document.entities);
if (lookTarget === null) {
group.rotation.set(0, 0, 0);
group.quaternion.identity();
return;
}
group.lookAt(lookTarget.x, lookTarget.y, lookTarget.z);
}
private applyEntityRenderObjectTransform(entity: EntityInstance) {
const renderObjects = this.entityRenderObjects.get(entity.id);
@@ -4699,6 +4720,13 @@ export class ViewportHost {
renderObjects.group.rotation.set(0, 0, 0);
renderObjects.group.quaternion.identity();
break;
case "cameraRig":
this.applyCameraRigGroupTransform(
renderObjects.group,
entity,
this.currentDocument
);
break;
case "spotLight":
this.applySpotLightGroupTransform(
renderObjects.group,