Packed Record TGenericVector3
Unit
Declaration
type TGenericVector3 = packed record
Description
Vector of 3 floating-point values.
This is generic type (although not using "proper" Pascal generics for implementation reasons). In has two actual uses:
TVector3, a vector of 3 Single values (floats with single precision),
TVector3Double, a vector of 3 Double values (floats with double precision).
The actual type of TGenericScalar is Single or Double for (respectively) TVector3 or TVector3Double.
Overview
Nested Types
![]() |
TIndex = 0..Count - 1; |
Fields
![]() |
nested const Count = 3; |
![]() |
var X: TGenericScalar; |
![]() |
var Y: TGenericScalar; |
![]() |
var Z: TGenericScalar; |
Methods
![]() |
class operator + (const A, B: TGenericVector3): TGenericVector3; inline; |
![]() |
class operator - (const A, B: TGenericVector3): TGenericVector3; inline; |
![]() |
class operator - (const V: TGenericVector3): TGenericVector3; inline; |
![]() |
class operator * (const V: TGenericVector3; const Scalar: TGenericScalar): TGenericVector3; inline; |
![]() |
class operator * (const Scalar: TGenericScalar; const V: TGenericVector3): TGenericVector3; inline; |
![]() |
class operator * (const V1, V2: TGenericVector3): TGenericVector3; inline; |
![]() |
class operator / (const V: TGenericVector3; const Scalar: TGenericScalar): TGenericVector3; inline; |
![]() |
procedure Init(const AX, AY, AZ: TGenericScalar); inline; deprecated 'initialize instead like "V := Vector3(X, Y, Z)"; modifying a temporary record value is a trap, e.g. this is not reliable: "Scene.Translation.Init(X, Y, Z)"'; |
![]() |
function ToString: string; |
![]() |
function ToRawString: string; |
![]() |
function Normalize: TGenericVector3; inline; |
![]() |
procedure NormalizeMe; inline; deprecated 'normalize instead like "V := V.Normalize"; modifying a temporary record value is a trap, e.g. this is not reliable: "Scene.Translation.NormalizeMe"'; |
![]() |
function Length: TGenericScalar; inline; |
![]() |
function LengthSqr: TGenericScalar; inline; |
![]() |
function AdjustToLength(const NewLength: TGenericScalar): TGenericVector3; inline; |
![]() |
class function CrossProduct(const V1, V2: TGenericVector3): TGenericVector3; static; inline; |
![]() |
class function DotProduct(const V1, V2: TGenericVector3): TGenericScalar; static; inline; |
![]() |
function Abs: TGenericVector3; inline; |
![]() |
function Min: TGenericScalar; |
![]() |
function Max: TGenericScalar; |
![]() |
function Average: TGenericScalar; inline; |
![]() |
function IsZero: boolean; overload; inline; |
![]() |
function IsZero(const Epsilon: TGenericScalar): boolean; overload; inline; |
![]() |
function IsPerfectlyZero: boolean; inline; |
![]() |
class function Equals(const V1, V2: TGenericVector3): boolean; overload; inline; static; |
![]() |
class function Equals(const V1, V2: TGenericVector3; const Epsilon: TGenericScalar): boolean; overload; inline; static; |
![]() |
class function PerfectlyEquals(const V1, V2: TGenericVector3): boolean; static; inline; |
![]() |
function XY: TGenericVector2; inline; |
![]() |
class function Lerp(const A: TGenericScalar; const V1, V2: TGenericVector3): TGenericVector3; static; inline; |
![]() |
class function Zero: TGenericVector3; static; inline; |
Properties
![]() |
property Data [const Index: TIndex]: TGenericScalar read GetItems write SetItems; deprecated 'use instead X, Y, Z fields; modifying a temporary record value is a trap, e.g. this is not reliable: "Scene.Translation.Data[0] := Scene.Translation.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 fields; modifying a temporary record value is a trap, e.g. this is not reliable "Scene.Translation[0] := Scene.Translation[0] + 1"'; |
![]() |
class property One [const Index: TIndex]: TGenericVector3 read GetOne; |
Description
Nested Types
![]() |
TIndex = 0..Count - 1; |
This item has no description. |
Fields
![]() |
nested const Count = 3; |
This item has no description. |
![]() |
var X: TGenericScalar; |
This item has no description. |
![]() |
var Y: TGenericScalar; |
This item has no description. |
![]() |
var Z: TGenericScalar; |
This item has no description. |
Methods
![]() |
class operator + (const A, B: TGenericVector3): TGenericVector3; inline; |
This item has no description. |
![]() |
class operator - (const A, B: TGenericVector3): TGenericVector3; inline; |
This item has no description. |
![]() |
class operator - (const V: TGenericVector3): TGenericVector3; inline; |
This item has no description. |
![]() |
class operator * (const V: TGenericVector3; const Scalar: TGenericScalar): TGenericVector3; inline; |
This item has no description. |
![]() |
class operator * (const Scalar: TGenericScalar; const V: TGenericVector3): TGenericVector3; inline; |
This item has no description. |
![]() |
class operator * (const V1, V2: TGenericVector3): TGenericVector3; inline; |
Vector * vector makes a component-wise multiplication. This is consistent with GLSL and other vector APIs. |
![]() |
class operator / (const V: TGenericVector3; const Scalar: TGenericScalar): TGenericVector3; inline; |
This item has no description. |
![]() |
procedure Init(const AX, AY, AZ: TGenericScalar); inline; deprecated 'initialize instead like "V := Vector3(X, Y, Z)"; modifying a temporary record value is a trap, e.g. this is not reliable: "Scene.Translation.Init(X, Y, Z)"'; |
Warning: this symbol is deprecated: initialize instead like "V := Vector3(X, Y, Z)"; modifying a temporary record value is a trap, e.g. this is not reliable: "Scene.Translation.Init(X, Y, Z)" This item has no description. |
![]() |
function ToString: string; |
This item has no description. |
![]() |
function Normalize: TGenericVector3; inline; |
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): TGenericVector3; 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 CrossProduct(const V1, V2: TGenericVector3): TGenericVector3; static; inline; |
Vector cross product. See http://en.wikipedia.org/wiki/Cross_product . Result is a vector orthogonal to both given vectors. Generally there are two such vectors, this method returns the one following right-hand rule. More precisely, V1, V2 and Product(V1, V2) are in the same relation as basic X, Y, Z axes. Reverse the order of arguments to get negated result. If you use this to calculate a normal vector of a triangle (P0, P1, P2): note that When V1 and V2 are parallel (that is, when V1 = V2 multiplied by some scalar), and this includes the case when one of them is zero, then result is a zero vector. |
![]() |
class function DotProduct(const V1, V2: TGenericVector3): TGenericScalar; static; inline; |
Dot product of two vectors. See https://en.wikipedia.org/wiki/Dot_product . |
![]() |
function Abs: TGenericVector3; inline; |
Absolute value on all components. |
![]() |
function Min: TGenericScalar; |
Smallest component. |
![]() |
function Max: TGenericScalar; |
Largest component. |
![]() |
function Average: TGenericScalar; inline; |
|
![]() |
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: TGenericVector3): boolean; overload; inline; static; |
Compare two vectors, with epsilon to tolerate slightly different floats. |
![]() |
class function Equals(const V1, V2: TGenericVector3; const Epsilon: TGenericScalar): boolean; overload; inline; static; |
This item has no description. |
![]() |
class function PerfectlyEquals(const V1, V2: TGenericVector3): boolean; static; inline; |
Compare two vectors using exact comparison (like the "=" operator to compare floats). |
![]() |
function XY: TGenericVector2; inline; |
This item has no description. |
![]() |
class function Lerp(const A: TGenericScalar; const V1, V2: TGenericVector3): TGenericVector3; static; inline; |
Linear interpolation between two vector values. Returns So:
|
![]() |
class function Zero: TGenericVector3; static; inline; |
This item has no description. |
Properties
![]() |
property Data [const Index: TIndex]: TGenericScalar read GetItems write SetItems; deprecated 'use instead X, Y, Z fields; modifying a temporary record value is a trap, e.g. this is not reliable: "Scene.Translation.Data[0] := Scene.Translation.Data[0] + 1"'; |
Warning: this symbol is deprecated: use instead X, Y, Z fields; modifying a temporary record value is a trap, e.g. this is not reliable: "Scene.Translation.Data[0] := Scene.Translation.Data[0] + 1" Access (get, set) vector components by index. We discourage using it. Use X, Y, Z 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 fields; modifying a temporary record value is a trap, e.g. this is not reliable "Scene.Translation[0] := Scene.Translation[0] + 1"'; |
Warning: this symbol is deprecated: use instead X, Y, Z fields; modifying a temporary record value is a trap, e.g. this is not reliable "Scene.Translation[0] := Scene.Translation[0] + 1" This item has no description. |
![]() |
class property One [const Index: TIndex]: TGenericVector3 read GetOne; |
This item has no description. |
Generated by PasDoc 0.16.0.