fix(Editor): Sync cameraProps state when auto-framing on model generation
Build and Deploy / build-and-push (push) Successful in 49s
Build and Deploy / build-and-push (push) Successful in 49s
This commit is contained in:
@@ -1609,6 +1609,11 @@ export default function Editor() {
|
|||||||
camera.far = radius * 100;
|
camera.far = radius * 100;
|
||||||
camera.updateProjectionMatrix();
|
camera.updateProjectionMatrix();
|
||||||
camera.lookAt(center);
|
camera.lookAt(center);
|
||||||
|
|
||||||
|
setCameraProps(prev => ({
|
||||||
|
...prev,
|
||||||
|
position: [center.x, center.y + (maxDim / 4), center.z + cameraZDistance]
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Update OrbitControls
|
// 4. Update OrbitControls
|
||||||
@@ -5255,6 +5260,11 @@ export default function Editor() {
|
|||||||
camera.far = radius * 100;
|
camera.far = radius * 100;
|
||||||
camera.updateProjectionMatrix();
|
camera.updateProjectionMatrix();
|
||||||
camera.lookAt(center);
|
camera.lookAt(center);
|
||||||
|
|
||||||
|
setCameraProps(prev => ({
|
||||||
|
...prev,
|
||||||
|
position: [center.x, center.y + (maxDim / 4), center.z + cameraZDistance]
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (orbitControlsRef.current) {
|
if (orbitControlsRef.current) {
|
||||||
|
|||||||
Reference in New Issue
Block a user