record TIVector4

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TIVector4 = record

Description

A 4-dimensional vector that uses integer components instead of floating-point components.

Overview

Fields

X: Integer
Y: Integer
Z: Integer
W: Integer
R: Integer
G: Integer
B: Integer
A: Integer
S: Integer
T: Integer
P: Integer
Q: Integer
C: array [0..3] of Integer

Methods

procedure Init; overload; inline;
procedure Init(const A: Integer); overload; inline;
procedure Init(const A1, A2, A3, A4: Integer); overload; inline;
class operator Equal(const A, B: TIVector4): Boolean; inline;
class operator NotEqual(const A, B: TIVector4): Boolean; inline;
class operator Negative(const A: TIVector4): TIVector4;
class operator Add(const A: TIVector4; const B: Integer): TIVector4;
class operator Add(const A: Integer; const B: TIVector4): TIVector4;
class operator Add(const A, B: TIVector4): TIVector4;
class operator Subtract(const A: TIVector4; const B: Integer): TIVector4;
class operator Subtract(const A: Integer; const B: TIVector4): TIVector4;
class operator Subtract(const A, B: TIVector4): TIVector4;
class operator Multiply(const A: TIVector4; const B: Integer): TIVector4;
class operator Multiply(const A: Integer; const B: TIVector4): TIVector4;
class operator Multiply(const A, B: TIVector4): TIVector4;
class operator IntDivide(const A: TIVector4; const B: Integer): TIVector4;
class operator IntDivide(const A: Integer; const B: TIVector4): TIVector4;
class operator IntDivide(const A, B: TIVector4): TIVector4;
function IsZero: Boolean; inline;

Properties

property Components[constAIndex:Integer]: Integer read GetComponent write SetComponent;

Description

Fields

X: Integer

X, Y, Z and W components of the vector. Aliases for C[0], C[1], C[2] and C[3].

Y: Integer

X, Y, Z and W components of the vector. Aliases for C[0], C[1], C[2] and C[3].

Z: Integer

X, Y, Z and W components of the vector. Aliases for C[0], C[1], C[2] and C[3].

W: Integer

X, Y, Z and W components of the vector. Aliases for C[0], C[1], C[2] and C[3].

R: Integer

Red, Green, Blue and Alpha components of the vector. Aliases for C[0], C[1], C[2] and C[3].

G: Integer

Red, Green, Blue and Alpha components of the vector. Aliases for C[0], C[1], C[2] and C[3].

B: Integer

Red, Green, Blue and Alpha components of the vector. Aliases for C[0], C[1], C[2] and C[3].

A: Integer

Red, Green, Blue and Alpha components of the vector. Aliases for C[0], C[1], C[2] and C[3].

S: Integer

S, T, P and Q components of the vector. Aliases for C[0], C[1], C[2] and C[3].

T: Integer

S, T, P and Q components of the vector. Aliases for C[0], C[1], C[2] and C[3].

P: Integer

S, T, P and Q components of the vector. Aliases for C[0], C[1], C[2] and C[3].

Q: Integer

S, T, P and Q components of the vector. Aliases for C[0], C[1], C[2] and C[3].

C: array [0..3] of Integer

The four components of the vector.

Methods

procedure Init; overload; inline;

Sets the four elements (X, Y, Z and W) to 0.

procedure Init(const A: Integer); overload; inline;

Sets the four elements (X, Y, Z and W) to A.

Parameters
A
the value to set the three elements to.
procedure Init(const A1, A2, A3, A4: Integer); overload; inline;

Sets the four elements (X, Y, Z and W) to A1, A2, A3 and A4 respectively.

Parameters
A1
the value to set the first element to.
A2
the value to set the second element to.
A3
the value to set the third element to.
A4
the value to set the fourth element to.
class operator Equal(const A, B: TIVector4): Boolean; inline;

Checks two vectors for equality.

Returns

True if the two vectors match each other.

class operator NotEqual(const A, B: TIVector4): Boolean; inline;

Checks two vectors for inequality.

Returns

True if the two vectors are not equal.

class operator Negative(const A: TIVector4): TIVector4;

Negates a vector.

Returns

The negative value of a vector (eg. (-A.X, -A.Y, -A.Z, -A.W))

class operator Add(const A: TIVector4; const B: Integer): TIVector4;

Adds a scalar value to a vector.

Returns

(A.X + B, A.Y + B, A.Z + B, A.W + B)

class operator Add(const A: Integer; const B: TIVector4): TIVector4;

Adds a vector to a scalar value.

Returns

(A + B.X, A + B.Y, A + B.Z, A + B.W)

class operator Add(const A, B: TIVector4): TIVector4;

Adds two vectors.

Returns

(A.X + B.X, A.Y + B.Y, A.Z + B.Z, A.W + B.W)

class operator Subtract(const A: TIVector4; const B: Integer): TIVector4;

Subtracts a scalar value from a vector.

Returns

(A.X - B, A.Y - B, A.Z - B, A.W - B)

class operator Subtract(const A: Integer; const B: TIVector4): TIVector4;

Subtracts a vector from a scalar value.

Returns

(A - B.X, A - B.Y, A - B.Z, A - B.W)

class operator Subtract(const A, B: TIVector4): TIVector4;

Subtracts two vectors.

Returns

(A.X - B.X, A.Y - B.Y, A.Z - B.Z, A.W - B.W)

class operator Multiply(const A: TIVector4; const B: Integer): TIVector4;

Multiplies a vector with a scalar value.

Returns

(A.X * B, A.Y * B, A.Z * B, A.W * B)

class operator Multiply(const A: Integer; const B: TIVector4): TIVector4;

Multiplies a scalar value with a vector.

Returns

(A * B.X, A * B.Y, A * B.Z, A * B.W)

class operator Multiply(const A, B: TIVector4): TIVector4;

Multiplies two vectors component-wise.

Returns

(A.X * B.X, A.Y * B.Y, A.Z * B.Z, A.W * B.W)

class operator IntDivide(const A: TIVector4; const B: Integer): TIVector4;

Divides a vector by a scalar value.

Returns

(A.X div B, A.Y div B, A.Z div B, A.W div B)

class operator IntDivide(const A: Integer; const B: TIVector4): TIVector4;

Divides a scalar value by a vector.

Returns

(A div B.X, A div B.Y, A div B.Z, A div B.W)

class operator IntDivide(const A, B: TIVector4): TIVector4;

Divides two vectors component-wise.

Returns

(A.X div B.X, A.Y div B.Y, A.Z div B.Z, A.W div B.W)

function IsZero: Boolean; inline;

Whether this is a zero vector.

Returns

True if X, Y, Z and W are 0

Properties

property Components[constAIndex:Integer]: Integer read GetComponent write SetComponent;

Returns the components of the vector. This is identical to accessing the C-field, but this property can be used as a default array property.

Parameters
AIndex
index of the component to return (0-3). Range is checked with an assertion.

Generated by PasDocEx, based on PasDoc 0.14.0.