record TVector3f

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TVector3f = record

Description

3D floating-point vector.

Overview

Fields

X: VectorFloat;
Y: VectorFloat;
Z: VectorFloat;

Methods

function Angle(const Vector: TVector3f): VectorFloat;
function Cross(const Vector: TVector3f): TVector3f;
function Distance(const Vector: TVector3f): VectorFloat;
function Dot(const Vector: TVector3f): VectorFloat; inline;
function Empty: Boolean;
function GetXY: TPoint2f; inline;
function Length: VectorFloat;
function Lerp(const Vector: TVector3f; const Theta: VectorFloat): TVector3f;
function Normalize: TVector3f;
function Parallel(const Direction: TVector3f): TVector3f;
function Perpendicular(const Direction: TVector3f): TVector3f;
function Reflect(const Normal: TVector3f): TVector3f;
function ToInt: TVector3i;

Description

Fields

X: VectorFloat;

The coordinate in 3D space.

Y: VectorFloat;

The coordinate in 3D space.

Z: VectorFloat;

The coordinate in 3D space.

Methods

function Angle(const Vector: TVector3f): VectorFloat;

Calculates angle between current and the specified 3D vector. The returned value has range of [0..Pi].

function Cross(const Vector: TVector3f): TVector3f;

Calculates a cross product between current and the specified 3D vector. The resulting vector is perpendicular to both vectors and normal to the plane containing them.

function Distance(const Vector: TVector3f): VectorFloat;

Calculates distance between current and given vectors.

function Dot(const Vector: TVector3f): VectorFloat; inline;

Calculates a dot product between current and the specified 3D vector. The dot product is an indirect measure of angle between two vectors.

function Empty: Boolean;

Tests whether X, Y and Z are nearly zero.

function GetXY: TPoint2f; inline;

Returns (x, y) portion of 3D vector as TPoint2f.

function Length: VectorFloat;

Returns length of current vector.

function Lerp(const Vector: TVector3f; const Theta: VectorFloat): TVector3f;

Interpolates between current and destination 3D vectors.

Parameters
Vector
The destination vector to be used in the interpolation
Theta
The mixture of the two vectors with the a range of [0..1].
function Normalize: TVector3f;

Normalizes current vector to unity length. If current length is zero, the same vector is returned.

function Parallel(const Direction: TVector3f): TVector3f;

Calculates a portion of current vector that is parallel to the direction vector.

function Perpendicular(const Direction: TVector3f): TVector3f;

Calculates a portion of current vector that is perpendicular to the direction vector.

function Reflect(const Normal: TVector3f): TVector3f;

Calculates 3D vector that is a reflection of current vector from surface given by specified normal.

function ToInt: TVector3i;

Converts TVector3f to TVector3i by using floating-point rounding.


Copyright © 2000 - 2017 Yuriy Kotsarenko. Help files generated by PasDoc.