Castle Game Engine: CastleFrustum

# Unit CastleFrustum
Description | Uses | Classes, Interfaces, Objects and Records | Functions and Procedures | Types | Constants | Variables
## Description Frustum object (TFrustum) and helpers. ## Uses CastleVectors CastleBoxes ## Overview ### Classes, Interfaces, Objects and Records
Name | Description
--- | ---
Object `TFrustum` | Viewing frustum, defined as 6 plane equations.
### Types
`TFrustumPlane = (...);`
`TFrustumPointsSingle = packed array [0..7] of packed record case Integer of 0: (XYZ: TVector3Single; W: Single); 1: (XYZW: TVector4Single); end;`
`TFrustumPointsDouble = packed array [0..7] of packed record case Integer of 0: (XYZ: TVector3Double; W: Double); 1: (XYZW: TVector4Double); end;`
`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 FrustumProjMatrix 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:
`TFrustumPointsSingle = packed array [0..7] of packed record case Integer of 0: (XYZ: TVector3Single; W: Single); 1: (XYZW: TVector4Single); end;`
`TFrustumPointsDouble = packed array [0..7] of packed record case Integer of 0: (XYZ: TVector3Double; W: Double); 1: (XYZW: TVector4Double); end;`
`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.13.0 on 2015-06-15 04:43:09