UNPKG

1.81 kBTypeScriptView Raw
1import { Camera } from "./Camera.js";
2import { PerspectiveCamera } from "./PerspectiveCamera.js";
3
4/**
5 * Dual {@link PerspectiveCamera | PerspectiveCamera}s used for effects such as
6 * {@link https://en.wikipedia.org/wiki/Anaglyph_3D | 3D Anaglyph} or
7 * {@link https://en.wikipedia.org/wiki/parallax_barrier | Parallax Barrier}.
8 * @see Example: {@link https://threejs.org/examples/#webgl_effects_anaglyph | effects / anaglyph }
9 * @see Example: {@link https://threejs.org/examples/#webgl_effects_parallaxbarrier | effects / parallaxbarrier }
10 * @see Example: {@link https://threejs.org/examples/#webgl_effects_stereo | effects / stereo }
11 * @see {@link https://threejs.org/docs/index.html#api/en/cameras/StereoCamera | Official Documentation}
12 * @see {@link https://github.com/mrdoob/three.js/blob/master/src/cameras/StereoCamera.js | Source}
13 */
14export class StereoCamera extends Camera {
15 constructor();
16
17 type: "StereoCamera";
18
19 /**
20 * @remarks Expects a `Float`
21 * @defaultValue `1`
22 */
23 aspect: number;
24
25 /**
26 * @remarks Expects a `Float`
27 * @defaultValue `0.064`
28 */
29 eyeSep: number;
30
31 /**
32 * The Left camera.
33 * A {@link PerspectiveCamera } added to {@link THREE.PerspectiveCamera.layers | layer 1}
34 * @remarks Objects to be rendered by the **left** camera must also be added to this layer.
35 */
36 cameraL: PerspectiveCamera;
37
38 /**
39 * The Right camera.
40 * A {@link PerspectiveCamera } added to {@link THREE.PerspectiveCamera.layers | layer 2}
41 * @remarks Objects to be rendered by the **right** camera must also be added to this layer.
42 */
43 cameraR: PerspectiveCamera;
44
45 /**
46 * Update the stereo cameras based on the camera passed in.
47 * @param camera
48 */
49 update(camera: PerspectiveCamera): void;
50}