Unit CastleProjection
Description
Projection parameters (TProjection).
Uses
Overview
Classes, Interfaces, Objects and Records
Record TProjection 
Projection determines how does the 3D world map onto 2D screen. 
Functions and Procedures
function AdjustViewAngleDegToAspectRatio(const FirstViewAngleDeg, SecondToFirstRatio: Single): Single; deprecated 'use radians for everything throughout CGE'; 
function AdjustViewAngleRadToAspectRatio(const FirstViewAngleRad, SecondToFirstRatio: Single): Single; 
function OrthoProjectionMatrix(const Dimensions: TFloatRectangle; const ZNear, ZFar: Single): TMatrix4; overload; 
function OrthoProjectionMatrix(const left, right, bottom, top, ZNear, ZFar: Single): TMatrix4; overload; deprecated 'use the overloaded version that takes Dimensions as TFloatRectangle'; 
function Ortho2DProjectionMatrix(const Dimensions: TFloatRectangle): TMatrix4; overload; deprecated 'just use OrthoProjectionMatrix, the 2D optimization is not really worth the maintenance'; 
function Ortho2DProjectionMatrix(const left, right, bottom, top: Single): TMatrix4; overload; deprecated 'just use OrthoProjectionMatrix, the 2D optimization is not really worth the maintenance'; 
function FrustumProjectionMatrix(const Dimensions: TFloatRectangle; const ZNear, ZFar: Single): TMatrix4; overload; 
function FrustumProjectionMatrix(const left, right, bottom, top, ZNear, ZFar: Single): TMatrix4; overload; deprecated 'use the overloaded version that takes Dimensions as TFloatRectangle'; 
function PerspectiveProjectionMatrixDeg(const fovyDeg, aspect, ZNear, ZFar: Single): TMatrix4; 
function PerspectiveProjectionMatrixRad(const fovyRad, aspect, ZNear, ZFar: Single): TMatrix4; 
function ProjectionTypeToStr(const ProjectionType: TProjectionTypeCore): String; 
Types
Constants
Description
Functions and Procedures
function AdjustViewAngleDegToAspectRatio(const FirstViewAngleDeg, SecondToFirstRatio: Single): Single; deprecated 'use radians for everything throughout CGE'; 
Warning: this symbol is deprecated: use radians for everything throughout CGE
Calculate second viewing angle for perspective projection. Given one viewing angle of the camera (FirstViewAngleDeg) and aspect ratio of your window sizes (SecondToFirstRatio), calculate second viewing angle of the camera.
The intention is that when projecting camera view (with given view angles) on a screen with given aspect ratio), the image will not be distorted (squeezed horizontally or vertically).
For the "Deg" version both angles (given and returned) are in degress, for the "Rad" version both angles and in radians.

function AdjustViewAngleRadToAspectRatio(const FirstViewAngleRad, SecondToFirstRatio: Single): Single; 

function OrthoProjectionMatrix(const left, right, bottom, top, ZNear, ZFar: Single): TMatrix4; overload; deprecated 'use the overloaded version that takes Dimensions as TFloatRectangle'; 
Warning: this symbol is deprecated: use the overloaded version that takes Dimensions as TFloatRectangle 
function Ortho2DProjectionMatrix(const Dimensions: TFloatRectangle): TMatrix4; overload; deprecated 'just use OrthoProjectionMatrix, the 2D optimization is not really worth the maintenance'; 
Warning: this symbol is deprecated: just use OrthoProjectionMatrix, the 2D optimization is not really worth the maintenance 
function Ortho2DProjectionMatrix(const left, right, bottom, top: Single): TMatrix4; overload; deprecated 'just use OrthoProjectionMatrix, the 2D optimization is not really worth the maintenance'; 
Warning: this symbol is deprecated: just use OrthoProjectionMatrix, the 2D optimization is not really worth the maintenance 
function FrustumProjectionMatrix(const Dimensions: TFloatRectangle; const ZNear, ZFar: Single): TMatrix4; overload; 

function FrustumProjectionMatrix(const left, right, bottom, top, ZNear, ZFar: Single): TMatrix4; overload; deprecated 'use the overloaded version that takes Dimensions as TFloatRectangle'; 
Warning: this symbol is deprecated: use the overloaded version that takes Dimensions as TFloatRectangle 
function PerspectiveProjectionMatrixDeg(const fovyDeg, aspect, ZNear, ZFar: Single): TMatrix4; 

function PerspectiveProjectionMatrixRad(const fovyRad, aspect, ZNear, ZFar: Single): TMatrix4; 

Types
Constants
ZFarInfinity = 0.0; 
Special value that you can pass to various perspectiveprojection functions with the intention to set far plane at infinity. These functions include like FrustumProjectionMatrix, PerspectiveProjectionMatrixDeg, PerspectiveProjectionMatrixRad, PerspectiveProjection. You can pass ZFarInfinity as their ZFar parameter value.
Implementation note: It would be "cooler" to define this constant as Math.Infinity, but operating on Math.Infinity requires unnecessary turning off of some compiler checks. The point was only to have some special ZFar value, so 0 is as good as Infinity.

Generated by PasDoc 0.16.0.