IFrustum

Description

interface Tinman.Terrain.Meshing.IFrustum

Extended by

Frustum
HullFrustum sealed

Represents a frustum in terrain-space.

Public / Methods

Plane​At


public method PlaneAt → (1)

index in : int32

[0..IFrustum.PlaneCount-1]
The frustum plane index.

returns → Plane

The frustum plane.

Returns the index in-th frustum plane.

Public / Attributes

Plane​Count


public attribute PlaneCount → (get)

value : int32

[0..31]
The number of frustum planes.

The number of frustum planes.

If a frustum has a plane count of zero, it contains all space.

Extensions

Clip​Line​Segment


[Pure]
public static method ClipLineSegment → (2)

ref : Vec3D

First point of line segment.

ref : Vec3D

Second point of line segment.

returns → int32

-1 if the line segment lies entirely outside of the frustum.
0 if the line segment lies entirely inside of the frustum.
1 if ref has been updated to represent the clipped line segment.
2 if ref has been updated to represent the clipped line segment.
3 if ref and ref have been updated to represent the clipped line segment.

Clips the given line segment with this frustum.

Test​Cuboid


public static method TestCuboid → (2)

cuboid in : Cuboid

The cuboid.

insideMask opt : int32 = 0

A bitmask indicating for which planes the cuboid is already known to lie completely inside the planes inner half-space: for plane n within [0..PlaneCount-1], the corresponding bit is 2^n.

returns → int32

The resulting inside mask (with 0x7FFFFFFF indicating that the cuboid fully lies inside the frustum), -1 if the cuboid lies outside the frustum. Any other value indicates that the cuboid intersects with at least one frustum plane.

Tests if the given cuboid lies inside the frustum.

The current implementation only tests the corner vertices of the cuboid against each frustum plane, which will not detect the case when a cuboid face intersects with the frustum while all its vertices are outside.

Test​Extruded​Sphere


[Pure]
public static method TestExtrudedSphere → (4)

center in : Vec3D

Coordinates of sphere center.

radius in : float64

Radius of sphere.

extrusion in : Vec3D

The vector along which to extrude the sphere.

insideMask opt : int32 = 0

A bitmask indicating for which planes the sphere is already known to lie completely inside the planes inner half-space: for plane n within [0..PlaneCount-1], the corresponding bit is 2^n.

returns → int32

The resulting inside mask (with 0x7FFFFFFF indicating that the sphere fully lies inside the frustum), -1 if the sphere lies outside the frustum. Any other value indicates that the sphere intersects with at least one frustum plane.

Tests if the given extruded sphere lies inside the frustum.

Test​Sphere

2 overloads


[Pure]
public static method TestSphere1 → (2)

sphere in : Sphere

The sphere.

insideMask opt : int32 = 0

A bitmask indicating for which planes the sphere is already known to lie completely inside the planes inner half-space: for plane n within [0..PlaneCount-1], the corresponding bit is 2^n.

returns → int32

The resulting inside mask (with 0x7FFFFFFF indicating that the sphere fully lies inside the frustum), -1 if the sphere lies outside the frustum. Any other value indicates that the sphere intersects with at least one frustum plane.

Tests if the given sphere lies inside the frustum.


[Pure]
public static method TestSphere2 → (3)

center in : Vec3D

Coordinates of sphere center.

radius in : float64

Radius of sphere.

insideMask opt : int32 = 0

A bitmask indicating for which planes the sphere is already known to lie completely inside the planes inner half-space: for plane n within [0..PlaneCount-1], the corresponding bit is 2^n.

returns → int32

The resulting inside mask (with 0x7FFFFFFF indicating that the sphere fully lies inside the frustum), -1 if the sphere lies outside the frustum. Any other value indicates that the sphere intersects with at least one frustum plane.

Tests if the given sphere lies inside the frustum.