Frustum

Package: Libraries.Compute · Inherits from: Libraries.Language.Object

A Frustum is a truncated rectangular pyramid (i.e., a pyramid with the top chopped off) used to define the viewable region and its projection onto the screen.

Variables

  • Libraries.Containers.Array planePoints
  • Libraries.Containers.Array planes

Actions

PointInFrustum(number x, number y, number z)

This action determines wither the point with the passed x, y, and z coordinates lies in the frustum.

Parameters

  • x number: The x component of the point to test
  • y number: The y component of the point to test
  • z number: The z component of the point to test

Returns

boolean: true if the point is in the frustum, false otherwise

PointInFrustum(Libraries.Compute.Vector3 point)

This action determines whether the passed point lies in the frustum.

Parameters

Returns

boolean: true if the point is in the frustum, false otherwise

SphereInFrustum(number x, number y, number z, number radius)

This action determines whether the sphere with its center at the passed x, y, and z coordinates and radius lies in the frustum.

Parameters

  • x number: The x coordinate of the center of the sphere
  • y number: The y coordinate of the center of the sphere
  • z number: The z coordinate of the center of the sphere
  • radius number: The radius of the sphere

Returns

boolean: true if the sphere lies in the frustum, false otherwise

SphereInFrustum(Libraries.Compute.Vector3 center, number radius)

This action determines whether the sphere with the passed center and radius lies in the frustum.

Parameters

Returns

boolean: true if the sphere lies in the frustum, false otherwise

SphereInFrustumWithoutNearFar(number x, number y, number z, number radius)

This action determines whether the sphere with the passed center and radius lies within the frustum without checking whether it is behind the near and far clipping plane.

Parameters

  • x number: The x coordinate of the center of the sphere
  • y number: The y coordinate of the center of the sphere
  • z number: The z coordinate of the center of the sphere
  • radius number: The radius of the sphere

Returns

boolean: true if the sphere is in the frustum, false otherwise

SphereInFrustumWithoutNearFar(Libraries.Compute.Vector3 center, number radius)

This action determines whether the sphere with the passed center and radius lies within the frustum without checking whether it is behind the near and far clipping plane.

Parameters

Returns

boolean: true if the sphere is in the frustum, false otherwise

Update(Libraries.Compute.Matrix4 inverseProjectionView)

This action updates the clipping planes based on the given inverse combined projection and view matrix, like one gotten from an orthographic or perspective camera

Parameters

Inherited Actions

3 actions from Libraries.Language.Object