Record TGenericMatrix4
Unit
Declaration
type TGenericMatrix4 = record
Description
4x4 matrix of floating-point values.
See also
- TGenericMatrix3
- 3x3 matrix of floating-point values.
Overview
Nested Types
![]() |
TIndex = 0..3; |
![]() |
TIndexArray = array[TIndex] of TGenericScalar; |
Fields
![]() |
var Data: array [TIndex] of TIndexArray; |
Methods
![]() |
class operator + (const A, B: TGenericMatrix4): TGenericMatrix4; inline; |
![]() |
class operator - (const A, B: TGenericMatrix4): TGenericMatrix4; inline; |
![]() |
class operator - (const M: TGenericMatrix4): TGenericMatrix4; inline; |
![]() |
class operator * (const V: TGenericMatrix4; const Scalar: TGenericScalar): TGenericMatrix4; inline; |
![]() |
class operator * (const Scalar: TGenericScalar; const V: TGenericMatrix4): TGenericMatrix4; inline; |
![]() |
class operator * (const M: TGenericMatrix4; const V: TGenericVector4): TGenericVector4; inline; |
![]() |
class operator * (const M1, M2: TGenericMatrix4): TGenericMatrix4; inline; |
![]() |
function TransposeMultiply(const V: TGenericVector4): TGenericVector4; inline; |
![]() |
function ToString(const LineIndent: string = ''): string; |
![]() |
function ToRawString(const LineIndent: string = ''): string; |
![]() |
function Determinant: TGenericScalar; |
![]() |
function Inverse(ADeterminant: TGenericScalar): TGenericMatrix4; |
![]() |
function TryInverse(out MInverse: TGenericMatrix4): boolean; |
![]() |
function Transpose: TGenericMatrix4; |
![]() |
function MultPoint(const Pt: TGenericVector3): TGenericVector3; overload; |
![]() |
function MultPoint(const Pt: TGenericVector2): TGenericVector2; overload; |
![]() |
function MultDirection(const Dir: TGenericVector3): TGenericVector3; overload; |
![]() |
function MultDirection(const Dir: TGenericVector2): TGenericVector2; overload; |
![]() |
class function Equals(const M1, M2: TGenericMatrix4): boolean; overload; static; |
![]() |
class function Equals(const M1, M2: TGenericMatrix4; const Epsilon: TGenericScalar): boolean; overload; static; |
![]() |
class function PerfectlyEquals(const M1, M2: TGenericMatrix4): boolean; static; |
![]() |
class function Lerp(const A: TGenericScalar; const M1, M2: TGenericMatrix4): TGenericMatrix4; static; |
![]() |
class function Zero: TGenericMatrix4; static; |
![]() |
class function Identity: TGenericMatrix4; static; |
Properties
![]() |
property Items [constAColumn,ARow:TIndex]: TGenericScalar read GetItems write SetItems; |
![]() |
property Rows [constARow:TIndex]: TGenericVector4 read GetRows write SetRows; |
![]() |
property Columns [constAColumn:TIndex]: TGenericVector4 read GetColumns write SetColumns; |
Description
Nested Types
![]() |
TIndex = 0..3; |
![]() |
TIndexArray = array[TIndex] of TGenericScalar; |
Fields
![]() |
var Data: array [TIndex] of TIndexArray; |
Data: array [TIndex, TIndex] of TGenericScalar; |
Methods
![]() |
class operator + (const A, B: TGenericMatrix4): TGenericMatrix4; inline; |
![]() |
class operator - (const A, B: TGenericMatrix4): TGenericMatrix4; inline; |
![]() |
class operator - (const M: TGenericMatrix4): TGenericMatrix4; inline; |
![]() |
class operator * (const V: TGenericMatrix4; const Scalar: TGenericScalar): TGenericMatrix4; inline; |
![]() |
class operator * (const Scalar: TGenericScalar; const V: TGenericMatrix4): TGenericMatrix4; inline; |
![]() |
class operator * (const M: TGenericMatrix4; const V: TGenericVector4): TGenericVector4; inline; |
![]() |
class operator * (const M1, M2: TGenericMatrix4): TGenericMatrix4; inline; |
Matrix * matrix makes a normal matrix algebraic multiplication (not component-wise multiplication). Note that this is different from vectors, where vector * vector makes a component-wise multiplication. |
![]() |
function TransposeMultiply(const V: TGenericVector4): TGenericVector4; inline; |
Calculates "M.Transpose * V" in a faster way (without spending *any* time on calculating transposition). |
![]() |
function ToString(const LineIndent: string = ''): string; |
![]() |
function Determinant: TGenericScalar; |
![]() |
function Inverse(ADeterminant: TGenericScalar): TGenericMatrix4; |
This does division by ADeterminant internally, so will raise exception from this float division if the matrix is not reversible. Check Math.IsZero(ADeterminant) first to avoid this, or use TryInverse. |
![]() |
function TryInverse(out MInverse: TGenericMatrix4): boolean; |
Inverse the matrix, or return |
![]() |
function Transpose: TGenericMatrix4; |
![]() |
function MultPoint(const Pt: TGenericVector3): TGenericVector3; overload; |
Transform a 3D or 2D point with 4x4 matrix. This works by temporarily converting point to 4-component vector (4th component is 1). After multiplying matrix * vector we divide by 4th component. So this works Ok for all matrices, even with last row different than identity (0, 0, 0, 1). E.g. this works for projection matrices too.
Exceptions raised
|
![]() |
function MultPoint(const Pt: TGenericVector2): TGenericVector2; overload; |
![]() |
function MultDirection(const Dir: TGenericVector3): TGenericVector3; overload; |
Transform a 3D or 2D direction with 4x4 matrix. This works by temporarily converting direction to 4-component vector (4th component is 0). After multiplying matrix * vector we check is the 4th component still 0 (eventually raising ETransformedResultInvalid).
Exceptions raised
|
![]() |
function MultDirection(const Dir: TGenericVector2): TGenericVector2; overload; |
![]() |
class function Equals(const M1, M2: TGenericMatrix4): boolean; overload; static; |
Compare two vectors, with epsilon to tolerate slightly different floats. |
![]() |
class function Equals(const M1, M2: TGenericMatrix4; const Epsilon: TGenericScalar): boolean; overload; static; |
![]() |
class function PerfectlyEquals(const M1, M2: TGenericMatrix4): boolean; static; |
Compare two vectors using exact comparison (like the "=" operator to compare floats). |
![]() |
class function Lerp(const A: TGenericScalar; const M1, M2: TGenericMatrix4): TGenericMatrix4; static; |
Linear interpolation between two matrix values. See also
|
![]() |
class function Zero: TGenericMatrix4; static; |
![]() |
class function Identity: TGenericMatrix4; static; |
Properties
![]() |
property Items [constAColumn,ARow:TIndex]: TGenericScalar read GetItems write SetItems; |
![]() |
property Rows [constARow:TIndex]: TGenericVector4 read GetRows write SetRows; |
![]() |
property Columns [constAColumn:TIndex]: TGenericVector4 read GetColumns write SetColumns; |
Generated by PasDoc 0.16.0.