Options
All
  • Public
  • Public/Protected
  • All
Menu

Class frustum

Basic Geometry: frustum.

Hierarchy

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]);};})()

Create a ortho frustum.

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

  • Update the frustum information according to the given transform matrix. Note that the resulting planes are not normalized under normal mode.

    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