import {MatrixUtil} from '../../../runtime/math/MatrixUtil'; import {Projection} from './Projection'; //========================================================== // 渲染正交投影。 // // @author maocy // @history 141230 //========================================================== export class OrthoProjection extends Projection { //============================================================ // 更新矩阵。 // // @method //============================================================ public update() { var size = this.size; var left = -size.width * 0.5; var top = -size.height * 0.5; MatrixUtil.orthoLH(this.matrix, left, top, size.width, size.height, this.znear, this.zfar); } //============================================================ // 根据视截体更新矩阵。 // // @method // @param frustum:SFrustum 视截体 //============================================================ public updateFrustum(frustum) { this.znear = frustum.minZ; this.zfar = frustum.maxZ; this.update(); } //========================================================== // 释放处理。 // // @method //========================================================== public dispose() { super.dispose(); } }