-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathCamera.ts
More file actions
41 lines (28 loc) · 816 Bytes
/
Camera.ts
File metadata and controls
41 lines (28 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { PerspectiveCamera } from "three";
import { ICamera } from "../../src/Proxy/ICamera";
import Node from "./Node";
export default class Camera extends Node implements ICamera {
protected _camera: PerspectiveCamera;
constructor(camera: PerspectiveCamera) {
super(camera);
this._camera = camera;
}
get object(): PerspectiveCamera {
return this._camera;
}
get aspect(): number {
return this._camera.aspect;
}
set aspect(a: number) {
this._camera.aspect = a;
}
get fov(): number {
return this._camera.fov;
}
set fov(f: number) {
this._camera.fov = f;
}
public updateProjectionMatrix(): void {
this._camera.updateProjectionMatrix();
}
}