Unit CastleFrustum

Description

Frustum object (TFrustum) and helpers.

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Object TFrustum Viewing frustum, defined as 6 plane equations.

Types

TFrustumPlane = (...);
TFrustumPoints = packed array [0..7] of packed record case Integer of 0: (XYZ: TVector3; W: Single); 1: (XYZW: TVector4); end;
TFrustumPointsSingle = TFrustumPoints deprecated 'use TFrustumPoints';
TFrustumPointsDouble = packed array [0..7] of packed record case Integer of 0: (XYZ: TVector3Double; W: Double); 1: (XYZW: TVector4Double); end deprecated 'use Single-precision TFrustumPoints';
TFrustumCollisionPossible = (...);
PFrustum = ˆTFrustum;

Constants

FrustumPointsQuadsIndexes: array[TFrustumPlane, 0..3]of LongWord = ( (0, 3, 7, 4), (1, 2, 6, 5), (2, 3, 7, 6), (0, 1, 5, 4), (0, 1, 2, 3), (4, 5, 6, 7) );
FrustumPointsLinesIndexes: array[0..11, 0..1]of LongWord = ( (0, 1), (1, 2), (2, 3), (3, 0), (4, 5), (5, 6), (6, 7), (7, 4), (0, 4), (1, 5), (2, 6), (3, 7) );

Description

Types

TFrustumPlane = (...);

Order of planes of TFrustum.

(This order is the same as the order of params to procedure FrustumProjectionMatrix and OpenGL's glFrustum routine. Article [http://www2.ravensoft.com/users/ggribb/plane%20extraction.pdf] has swapped bottom and top positions).

Values
  • fpLeft
  • fpRight
  • fpBottom
  • fpTop
  • fpNear
  • fpFar
TFrustumPoints = packed array [0..7] of packed record case Integer of 0: (XYZ: TVector3; W: Single); 1: (XYZW: TVector4); end;
 
TFrustumPointsSingle = TFrustumPoints deprecated 'use TFrustumPoints';

Warning: this symbol is deprecated: use TFrustumPoints

 
TFrustumPointsDouble = packed array [0..7] of packed record case Integer of 0: (XYZ: TVector3Double; W: Double); 1: (XYZW: TVector4Double); end deprecated 'use Single-precision TFrustumPoints';

Warning: this symbol is deprecated: use Single-precision TFrustumPoints

 
TFrustumCollisionPossible = (...);

See TFrustum.SphereCollisionPossible for description what each value of this type means.

Values
  • fcNoCollision
  • fcSomeCollisionPossible
  • fcInsideFrustum
PFrustum = ˆTFrustum;
 

Constants

FrustumPointsQuadsIndexes: array[TFrustumPlane, 0..3]of LongWord = ( (0, 3, 7, 4), (1, 2, 6, 5), (2, 3, 7, 6), (0, 1, 5, 4), (0, 1, 2, 3), (4, 5, 6, 7) );
 
FrustumPointsLinesIndexes: array[0..11, 0..1]of LongWord = ( (0, 1), (1, 2), (2, 3), (3, 0), (4, 5), (5, 6), (6, 7), (7, 4), (0, 4), (1, 5), (2, 6), (3, 7) );

Useful if you want to draw frustum obtained from TFrustum.CalculatePoints.

It's guaranteed that the first 4 items touch only the first 4 (near plane) points of the frustum — useful if you want to draw only the near plane rect. For ZFarInfinity, other points may be in infinity.


Generated by PasDoc 0.15.0.