Packed Record TGenericVector4
Unit
Declaration
type TGenericVector4 = packed record
Description
Vector of 4 floating-point values.
See also
- TGenericVector3
- Vector of 3 floating-point values.
Overview
Nested Types
![]() |
TIndex = 0..Count - 1; |
Fields
![]() |
nested const Count = 4; |
![]() |
var X: TGenericScalar; |
![]() |
var Y: TGenericScalar; |
![]() |
var Z: TGenericScalar; |
![]() |
var W: TGenericScalar; |
Methods
![]() |
class operator + (const A, B: TGenericVector4): TGenericVector4; inline; |
![]() |
class operator - (const A, B: TGenericVector4): TGenericVector4; inline; |
![]() |
class operator - (const V: TGenericVector4): TGenericVector4; inline; |
![]() |
class operator * (const V: TGenericVector4; const Scalar: TGenericScalar): TGenericVector4; inline; |
![]() |
class operator * (const Scalar: TGenericScalar; const V: TGenericVector4): TGenericVector4; inline; |
![]() |
class operator * (const V1, V2: TGenericVector4): TGenericVector4; inline; |
![]() |
class operator / (const V: TGenericVector4; const Scalar: TGenericScalar): TGenericVector4; inline; |
![]() |
procedure Init(const AX, AY, AZ, AW: TGenericScalar); inline; deprecated 'initialize instead like "V := Vector4(X, Y, Z, W)"; modifying a temporary record value is a trap, e.g. this is not reliable: "Scene.Rotation.Init(X, Y, Z, W)"'; |
![]() |
function ToString: string; |
![]() |
function ToRawString: string; |
![]() |
function Length: TGenericScalar; inline; |
![]() |
function LengthSqr: TGenericScalar; inline; |
![]() |
function AdjustToLength(const NewLength: TGenericScalar): TGenericVector4; inline; |
![]() |
class function DotProduct(const V1, V2: TGenericVector4): TGenericScalar; static; inline; |
![]() |
function Abs: TGenericVector4; inline; |
![]() |
function IsZero: boolean; overload; inline; |
![]() |
function IsZero(const Epsilon: TGenericScalar): boolean; overload; inline; |
![]() |
function IsPerfectlyZero: boolean; inline; |
![]() |
class function Equals(const V1, V2: TGenericVector4): boolean; overload; inline; static; |
![]() |
class function Equals(const V1, V2: TGenericVector4; const Epsilon: TGenericScalar): boolean; overload; inline; static; |
![]() |
class function PerfectlyEquals(const V1, V2: TGenericVector4): boolean; static; inline; |
![]() |
function ToPosition: TGenericVector3; inline; |
![]() |
class function Lerp(const A: TGenericScalar; const V1, V2: TGenericVector4): TGenericVector4; static; inline; |
![]() |
class function Zero: TGenericVector4; static; inline; |
Properties
![]() |
property Data [const Index: TIndex]: TGenericScalar read GetItems write SetItems; deprecated 'use instead X, Y, Z, W fields; modifying a temporary record value is a trap, e.g. this is not reliable: "Scene.Rotation.Data[0] := Scene.Rotation.Data[0] + 1"'; |
![]() |
property AsArray [const Index: TIndex]: TGenericScalar read GetItems; |
![]() |
property Items [const Index: TIndex]: TGenericScalar read GetItems write SetItems; deprecated 'use instead X, Y, Z, W fields; modifying a temporary record value is a trap, e.g. this is not reliable "Scene.Rotation[0] := Scene.Rotation[0] + 1"'; |
![]() |
property XYZ: TGenericVector3 read GetXYZ ; |
![]() |
property XY: TGenericVector2 read GetXY ; |
![]() |
class property One [const Index: TIndex]: TGenericVector4 read GetOne; |
Description
Nested Types
![]() |
TIndex = 0..Count - 1; |
This item has no description. |
Fields
![]() |
nested const Count = 4; |
This item has no description. |
![]() |
var X: TGenericScalar; |
procedure SetXYZ(const AValue: TGenericVector3); {$ifdef INLINE_GENERIC_VECTORS}inline;{$endif} procedure SetXY(const AValue: TGenericVector2); {$ifdef INLINE_GENERIC_VECTORS}inline;{$endif} |
![]() |
var Y: TGenericScalar; |
procedure SetXYZ(const AValue: TGenericVector3); {$ifdef INLINE_GENERIC_VECTORS}inline;{$endif} procedure SetXY(const AValue: TGenericVector2); {$ifdef INLINE_GENERIC_VECTORS}inline;{$endif} |
![]() |
var Z: TGenericScalar; |
procedure SetXYZ(const AValue: TGenericVector3); {$ifdef INLINE_GENERIC_VECTORS}inline;{$endif} procedure SetXY(const AValue: TGenericVector2); {$ifdef INLINE_GENERIC_VECTORS}inline;{$endif} |
![]() |
var W: TGenericScalar; |
procedure SetXYZ(const AValue: TGenericVector3); {$ifdef INLINE_GENERIC_VECTORS}inline;{$endif} procedure SetXY(const AValue: TGenericVector2); {$ifdef INLINE_GENERIC_VECTORS}inline;{$endif} |
Methods
![]() |
class operator + (const A, B: TGenericVector4): TGenericVector4; inline; |
This item has no description. |
![]() |
class operator - (const A, B: TGenericVector4): TGenericVector4; inline; |
This item has no description. |
![]() |
class operator - (const V: TGenericVector4): TGenericVector4; inline; |
This item has no description. |
![]() |
class operator * (const V: TGenericVector4; const Scalar: TGenericScalar): TGenericVector4; inline; |
This item has no description. |
![]() |
class operator * (const Scalar: TGenericScalar; const V: TGenericVector4): TGenericVector4; inline; |
This item has no description. |
![]() |
class operator * (const V1, V2: TGenericVector4): TGenericVector4; inline; |
Vector * vector makes a component-wise multiplication. This is consistent with GLSL and other vector APIs. |
![]() |
class operator / (const V: TGenericVector4; const Scalar: TGenericScalar): TGenericVector4; inline; |
This item has no description. |
![]() |
procedure Init(const AX, AY, AZ, AW: TGenericScalar); inline; deprecated 'initialize instead like "V := Vector4(X, Y, Z, W)"; modifying a temporary record value is a trap, e.g. this is not reliable: "Scene.Rotation.Init(X, Y, Z, W)"'; |
Warning: this symbol is deprecated: initialize instead like "V := Vector4(X, Y, Z, W)"; modifying a temporary record value is a trap, e.g. this is not reliable: "Scene.Rotation.Init(X, Y, Z, W)" This item has no description. |
![]() |
function ToString: string; |
This item has no description. |
![]() |
function Length: TGenericScalar; inline; |
This item has no description. |
![]() |
function LengthSqr: TGenericScalar; inline; |
Vector length squared. This is slightly faster than Length as it avoids calculating a square root along the way. (But, please remember to not optimize your code without a need. Optimize only parts that are proven bottlenecks, otherwise don't make the code less readable for the sake of speed.) |
![]() |
function AdjustToLength(const NewLength: TGenericScalar): TGenericVector4; inline; |
Calculate a new vector scaled so that it has length equal to NewLength. NewLength may be negative, in which case we'll negate the vector and then adjust it's length to Abs(NewLength). |
![]() |
class function DotProduct(const V1, V2: TGenericVector4): TGenericScalar; static; inline; |
Dot product of two vectors. See https://en.wikipedia.org/wiki/Dot_product . |
![]() |
function Abs: TGenericVector4; inline; |
Absolute value on all components. |
![]() |
function IsZero: boolean; overload; inline; |
Are all components equal to zero (within some epsilon margin). |
![]() |
function IsZero(const Epsilon: TGenericScalar): boolean; overload; inline; |
Are all components equal to zero (within Epsilon margin). |
![]() |
function IsPerfectlyZero: boolean; inline; |
This item has no description. |
![]() |
class function Equals(const V1, V2: TGenericVector4): boolean; overload; inline; static; |
Compare two vectors, with epsilon to tolerate slightly different floats. |
![]() |
class function Equals(const V1, V2: TGenericVector4; const Epsilon: TGenericScalar): boolean; overload; inline; static; |
This item has no description. |
![]() |
class function PerfectlyEquals(const V1, V2: TGenericVector4): boolean; static; inline; |
Compare two vectors using exact comparison (like the "=" operator to compare floats). |
![]() |
function ToPosition: TGenericVector3; inline; |
Convert a 4D homogeneous coordinate to 3D position. |
![]() |
class function Lerp(const A: TGenericScalar; const V1, V2: TGenericVector4): TGenericVector4; static; inline; |
Linear interpolation between two vector values. Works analogous to TVector3.Lerp |
![]() |
class function Zero: TGenericVector4; static; inline; |
This item has no description. |
Properties
![]() |
property Data [const Index: TIndex]: TGenericScalar read GetItems write SetItems; deprecated 'use instead X, Y, Z, W fields; modifying a temporary record value is a trap, e.g. this is not reliable: "Scene.Rotation.Data[0] := Scene.Rotation.Data[0] + 1"'; |
Warning: this symbol is deprecated: use instead X, Y, Z, W fields; modifying a temporary record value is a trap, e.g. this is not reliable: "Scene.Rotation.Data[0] := Scene.Rotation.Data[0] + 1" Access (get, set) vector components by index. We discourage using it. Use X, Y, Z, W to change vector components. Use AsArray to access it by index, read-only. |
![]() |
property AsArray [const Index: TIndex]: TGenericScalar read GetItems; |
Get vector components by index. |
![]() |
property Items [const Index: TIndex]: TGenericScalar read GetItems write SetItems; deprecated 'use instead X, Y, Z, W fields; modifying a temporary record value is a trap, e.g. this is not reliable "Scene.Rotation[0] := Scene.Rotation[0] + 1"'; |
Warning: this symbol is deprecated: use instead X, Y, Z, W fields; modifying a temporary record value is a trap, e.g. this is not reliable "Scene.Rotation[0] := Scene.Rotation[0] + 1" This item has no description. |
![]() |
property XYZ: TGenericVector3 read GetXYZ ; |
Get first 3 components as a 3D vector. This simply rejects the 4th component. |
![]() |
property XY: TGenericVector2 read GetXY ; |
Get first 2 components as a 2D vector. This simply rejects the remaining vector components. |
![]() |
class property One [const Index: TIndex]: TGenericVector4 read GetOne; |
This item has no description. |
Generated by PasDoc 0.16.0.