Options
All
  • Public
  • Public/Protected
  • All
Menu

Class frustum

Alias of Frustum

deprecated

Since v3.0

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

创建一个正交视锥体。

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