Options
All
  • Public
  • Public/Protected
  • All
Menu

Class frustum

Hierarchy

  • frustum

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

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

Accessors

accurate

  • set accurate(b: boolean): void

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