Options
All
  • Public
  • Public/Protected
  • All
Menu

Class frustum

基础几何 截头锥体。

Hierarchy

  • frustum

Index

Constructors

constructor

Properties

Protected _type

_type: number

planes

planes: plane[]

vertices

vertices: Vec3[]

Static createOrtho

createOrtho: (Anonymous function) = (() => {const _temp_v3 = new Vec3();return (out: frustum, width: number, height: number, near: number, far: number, transform: Mat4) => {const halfWidth = width / 2;const halfHeight = height / 2;Vec3.set(_temp_v3, halfWidth, halfHeight, near);Vec3.transformMat4(out.vertices[0], _temp_v3, transform);Vec3.set(_temp_v3, -halfWidth, halfHeight, near);Vec3.transformMat4(out.vertices[1], _temp_v3, transform);Vec3.set(_temp_v3, -halfWidth, -halfHeight, near);Vec3.transformMat4(out.vertices[2], _temp_v3, transform);Vec3.set(_temp_v3, halfWidth, -halfHeight, near);Vec3.transformMat4(out.vertices[3], _temp_v3, transform);Vec3.set(_temp_v3, halfWidth, halfHeight, far);Vec3.transformMat4(out.vertices[4], _temp_v3, transform);Vec3.set(_temp_v3, -halfWidth, halfHeight, far);Vec3.transformMat4(out.vertices[5], _temp_v3, transform);Vec3.set(_temp_v3, -halfWidth, -halfHeight, far);Vec3.transformMat4(out.vertices[6], _temp_v3, transform);Vec3.set(_temp_v3, halfWidth, -halfHeight, far);Vec3.transformMat4(out.vertices[7], _temp_v3, transform);plane.fromPoints(out.planes[0], out.vertices[1], out.vertices[6], out.vertices[5]);plane.fromPoints(out.planes[1], out.vertices[3], out.vertices[4], out.vertices[7]);plane.fromPoints(out.planes[2], out.vertices[6], out.vertices[3], out.vertices[7]);plane.fromPoints(out.planes[3], out.vertices[0], out.vertices[5], out.vertices[4]);plane.fromPoints(out.planes[4], out.vertices[2], out.vertices[0], out.vertices[3]);plane.fromPoints(out.planes[0], out.vertices[7], out.vertices[5], out.vertices[6]);};})()

创建一个正交视锥体。

param

正交视锥体的变换矩阵。

param

正交视锥体的变换矩阵。

param

正交视锥体的变换矩阵。

param

正交视锥体的变换矩阵。

param

正交视锥体的变换矩阵。

param

正交视锥体的变换矩阵。

returns

frustum.

Accessors

accurate

  • set accurate(b: boolean): void

type

  • get type(): number

Methods

transform

  • transform(mat: Mat4): void

update

  • 根据给定的变换矩阵更新截锥体信息,注意得到的平面不是在标准模式下归一化的。

    Parameters

    • m: Mat4

      the view-projection matrix

    • inv: Mat4

      the inverse view-projection matrix

    Returns void

Static clone

Static copy

Static create

Generated using TypeDoc