File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,11 @@ import { useLimitedFrame } from "../../logic";
20
20
const AUDIO_URL =
21
21
"https://d27rt3a60hh1lx.cloudfront.net/tools/camera/shutter-sound.mp3" ;
22
22
23
- export function Camera ( ) {
23
+ type CameraProps = { onCapture ?: ( ) => void } ;
24
+
25
+ export function Camera ( props : CameraProps ) {
26
+ const { onCapture } = props ;
27
+
24
28
const { device, paused } = useEnvironment ( ) ;
25
29
const { scene } = useThree ( ) ;
26
30
const toolbelt = useToolbelt ( ) ;
@@ -62,6 +66,7 @@ export function Camera() {
62
66
const audio = new Audio ( AUDIO_URL ) ;
63
67
audio . play ( ) ;
64
68
photo . takePicture ( ) ;
69
+ if ( onCapture ) onCapture ( ) ;
65
70
} ;
66
71
67
72
useEffect ( ( ) => {
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ export const usePhotography = (
56
56
r . toneMapping = ACESFilmicToneMapping ;
57
57
58
58
document . body . append ( r . domElement ) ;
59
+ cam . current . aspect = aspect . x / aspect . y ;
59
60
60
61
r . render ( scene , cam . current ) ;
61
62
You can’t perform that action at this time.
0 commit comments