Skip to content

Commit 0089e9e

Browse files
committed
v1.1.1: Fix OrbitControls up prop TypeScript error
1 parent 89fc47f commit 0089e9e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "everything-we-currently-know-about-tubes",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Everything We Currently Know About Tubes - Optimize pressure vessel dimensions for underwater applications",
55
"main": "dist-electron/main.js",
66
"scripts": {

src/components/CylinderViewer.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,14 +468,15 @@ function ControlsWithInteractionDetection({ onInteraction }: { onInteraction: ()
468468
const controls = controlsRef.current
469469
const handleStart = () => onInteraction()
470470

471+
// Set Z-up coordinate system
472+
controls.object.up.set(0, 0, 1)
473+
controls.update()
474+
471475
controls.addEventListener('start', handleStart)
472476
return () => controls.removeEventListener('start', handleStart)
473477
}
474478
}, [onInteraction])
475479

476-
// Z-up coordinate system
477-
const upVector = useMemo(() => new THREE.Vector3(0, 0, 1), [])
478-
479480
return (
480481
<OrbitControls
481482
ref={controlsRef}
@@ -484,7 +485,6 @@ function ControlsWithInteractionDetection({ onInteraction }: { onInteraction: ()
484485
enableRotate={true}
485486
minDistance={0.5}
486487
maxDistance={50}
487-
up={upVector}
488488
/>
489489
)
490490
}

0 commit comments

Comments
 (0)