import {ObjectBase} from '../../../runtime/common/lang/ObjectBase';
import {ObjectUtil} from '../../../runtime/common/lang/ObjectUtil';
import {Matrix4} from '../../../runtime/math/Matrix4';
import {Size2} from '../../../runtime/math/Size2';
//==========================================================
// 渲染投影。
//
// @author maocy
// @history 141230
//==========================================================
export class Projection extends ObjectBase {
// 矩阵
public matrix: Matrix4;
// 尺寸
public size: Size2;
// 角度
public angle: number;
// 夹角
public fieldOfView;
// 近平面
public znear: number;
// 远平面
public zfar: number;
// 缩放
public zoom: number;
//==========================================================
// 构造处理。
//
// @method
//==========================================================
public constructor() {
super();
this.matrix = new Matrix4();
this.size = new Size2();
this.angle = 60;
this.fieldOfView = 0;
this.znear = 0.1;
this.zfar = 200;
this.zoom = 1;
}
//==========================================================
// 获得距离。
//
// @method
// @return Number 距离
//==========================================================
public distance() {
return this.zfar - this.znear;
}
//============================================================
// 更新矩阵。
//
// @method
//============================================================
public update() {
}
//==========================================================
// 释放处理。
//
// @method
//==========================================================
public dispose() {
// 释放属性
this.matrix = ObjectUtil.dispose(this.matrix);
this.size = ObjectUtil.dispose(this.size);
// 父处理
super.dispose();
}
}