Dawn/ts/display/Camera.ts

32 lines
782 B
TypeScript

export class Camera {
public _camera:CCamera;
constructor() {
this._camera = cameraCreate();
}
public lookAt(x:number, y:number, z:number, lx:number, ly:number, lz:number) {
cameraLookAt(this._camera, x, y, z, lx, ly, lz);
}
public look(
x:number, y:number, z:number, pitch:number, yaw:number, roll:number
) {
cameraLook(this._camera, x, y, z, pitch, yaw, roll);
}
public perspective(fov:number, aspect:number, near:number, far:number) {
cameraPerspective(this._camera, fov, aspect, near, far);
}
public ortho(
left:number, right:number, bottom:number, top:number,
near:number, far:number
) {
cameraOrtho(this._camera, left, right, bottom, top, near, far);
}
public dispose() {
cameraDispose(this._camera);
}
}