orx 1.16
Portable Game Engine
Loading...
Searching...
No Matches
OrxVector

Data Structures

struct  orxVECTOR

Macros

#define orxCOLOR_DECLARE(NAME, R, G, B)

Functions

static orxINLINE orxFLOAT orxVector_2DDot (const orxVECTOR *_pvOp1, const orxVECTOR *_pvOp2)
static orxINLINE orxVECTORorxVector_2DRotate (orxVECTOR *_pvRes, const orxVECTOR *_pvOp, orxFLOAT _fAngle)
static orxINLINE orxVECTORorxVector_Abs (orxVECTOR *_pvRes, const orxVECTOR *_pvOp)
static orxINLINE orxVECTORorxVector_Add (orxVECTOR *_pvRes, const orxVECTOR *_pvOp1, const orxVECTOR *_pvOp2)
static orxINLINE orxBOOL orxVector_AreEqual (const orxVECTOR *_pvOp1, const orxVECTOR *_pvOp2)
orxDLLAPI orxVECTOR *orxFASTCALL orxVector_Bezier (orxVECTOR *_pvRes, const orxVECTOR *_pvPoint1, const orxVECTOR *_pvPoint2, const orxVECTOR *_pvPoint3, const orxVECTOR *_pvPoint4, orxFLOAT _fT)
orxDLLAPI orxVECTOR *orxFASTCALL orxVector_CatmullRom (orxVECTOR *_pvRes, const orxVECTOR *_pvPoint1, const orxVECTOR *_pvPoint2, const orxVECTOR *_pvPoint3, const orxVECTOR *_pvPoint4, orxFLOAT _fT)
static orxINLINE orxVECTORorxVector_Clamp (orxVECTOR *_pvRes, const orxVECTOR *_pvOp, const orxVECTOR *_pvMin, const orxVECTOR *_pvMax)
static orxINLINE orxVECTORorxVector_Copy (orxVECTOR *_pvDst, const orxVECTOR *_pvSrc)
static orxINLINE orxVECTORorxVector_Cross (orxVECTOR *_pvRes, const orxVECTOR *_pvOp1, const orxVECTOR *_pvOp2)
static orxINLINE orxVECTORorxVector_Div (orxVECTOR *_pvRes, const orxVECTOR *_pvOp1, const orxVECTOR *_pvOp2)
static orxINLINE orxVECTORorxVector_Divf (orxVECTOR *_pvRes, const orxVECTOR *_pvOp1, orxFLOAT _fOp2)
static orxINLINE orxFLOAT orxVector_Dot (const orxVECTOR *_pvOp1, const orxVECTOR *_pvOp2)
static orxINLINE orxVECTORorxVector_Floor (orxVECTOR *_pvRes, const orxVECTOR *_pvOp)
static orxINLINE orxVECTORorxVector_FromCartesianToSpherical (orxVECTOR *_pvRes, const orxVECTOR *_pvOp)
static orxINLINE orxVECTORorxVector_FromSphericalToCartesian (orxVECTOR *_pvRes, const orxVECTOR *_pvOp)
static orxINLINE orxFLOAT orxVector_GetDistance (const orxVECTOR *_pvOp1, const orxVECTOR *_pvOp2)
static orxINLINE orxFLOAT orxVector_GetSize (const orxVECTOR *_pvOp)
static orxINLINE orxFLOAT orxVector_GetSquareDistance (const orxVECTOR *_pvOp1, const orxVECTOR *_pvOp2)
static orxINLINE orxFLOAT orxVector_GetSquareSize (const orxVECTOR *_pvOp)
static orxINLINE orxBOOL orxVector_IsNull (const orxVECTOR *_pvOp)
static orxINLINE orxVECTORorxVector_Lerp (orxVECTOR *_pvRes, const orxVECTOR *_pvOp1, const orxVECTOR *_pvOp2, orxFLOAT _fOp)
static orxINLINE orxVECTORorxVector_Max (orxVECTOR *_pvRes, const orxVECTOR *_pvOp1, const orxVECTOR *_pvOp2)
static orxINLINE orxVECTORorxVector_Min (orxVECTOR *_pvRes, const orxVECTOR *_pvOp1, const orxVECTOR *_pvOp2)
static orxINLINE orxVECTORorxVector_Mod (orxVECTOR *_pvRes, const orxVECTOR *_pvOp1, const orxVECTOR *_pvOp2)
static orxINLINE orxVECTORorxVector_Mul (orxVECTOR *_pvRes, const orxVECTOR *_pvOp1, const orxVECTOR *_pvOp2)
static orxINLINE orxVECTORorxVector_Mulf (orxVECTOR *_pvRes, const orxVECTOR *_pvOp1, orxFLOAT _fOp2)
static orxINLINE orxVECTORorxVector_Neg (orxVECTOR *_pvRes, const orxVECTOR *_pvOp)
static orxINLINE orxVECTORorxVector_Normalize (orxVECTOR *_pvRes, const orxVECTOR *_pvOp)
static orxINLINE orxVECTORorxVector_Pow (orxVECTOR *_pvRes, const orxVECTOR *_pvOp1, const orxVECTOR *_pvOp2)
static orxINLINE orxVECTORorxVector_Rec (orxVECTOR *_pvRes, const orxVECTOR *_pvOp)
static orxINLINE orxVECTORorxVector_Remap (orxVECTOR *_pvRes, const orxVECTOR *_pvA1, const orxVECTOR *_pvB1, const orxVECTOR *_pvA2, const orxVECTOR *_pvB2, const orxVECTOR *_pvV)
static orxINLINE orxVECTORorxVector_Round (orxVECTOR *_pvRes, const orxVECTOR *_pvOp)
static orxINLINE orxVECTORorxVector_Set (orxVECTOR *_pvVec, orxFLOAT _fX, orxFLOAT _fY, orxFLOAT _fZ)
static orxINLINE orxVECTORorxVector_SetAll (orxVECTOR *_pvVec, orxFLOAT _fValue)
static orxINLINE orxVECTORorxVector_Sub (orxVECTOR *_pvRes, const orxVECTOR *_pvOp1, const orxVECTOR *_pvOp2)

Variables

orxDLLAPI const orxVECTOR orxVECTOR_0
orxDLLAPI const orxVECTOR orxVECTOR_1
orxDLLAPI const orxVECTOR orxVECTOR_X
orxDLLAPI const orxVECTOR orxVECTOR_Y
orxDLLAPI const orxVECTOR orxVECTOR_Z

Detailed Description

Vector module Module that handles vectors and basic structures based on them

Macro Definition Documentation

◆ orxCOLOR_DECLARE

#define orxCOLOR_DECLARE ( NAME,
R,
G,
B )
Value:
extern orxDLLAPI const orxVECTOR orxVECTOR_##NAME;
#define orxDLLAPI
Definition orxDecl.h:381

Definition at line 991 of file orxVector.h.

Function Documentation

◆ orxVector_2DDot()

orxINLINE orxFLOAT orxVector_2DDot ( const orxVECTOR * _pvOp1,
const orxVECTOR * _pvOp2 )
static

Gets 2D dot product of two vectors

Parameters
[in]_pvOp1First operand
[in]_pvOp2Second operand
Returns
2D dot product

Definition at line 915 of file orxVector.h.

◆ orxVector_2DRotate()

orxINLINE orxVECTOR * orxVector_2DRotate ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp,
orxFLOAT _fAngle )
static

Rotates a 2D vector (along Z-axis)

Parameters
[out]_pvResVector where to store the result (can be the operand)
[in]_pvOpVector to rotate
[in]_fAngleAngle of rotation (radians)
Returns
Rotated vector

Definition at line 665 of file orxVector.h.

◆ orxVector_Abs()

orxINLINE orxVECTOR * orxVector_Abs ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp )
static

Gets the absolute value of a vector and stores it in another one

Parameters
[out]_pvResVector where to store the result (can be the operand)
[in]_pvOpInput value
Returns
Resulting vector (Abs(Op))

Definition at line 452 of file orxVector.h.

◆ orxVector_Add()

orxINLINE orxVECTOR * orxVector_Add ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp1,
const orxVECTOR * _pvOp2 )
static

Adds vectors and stores result in a third one

Parameters
[out]_pvResVector where to store the result (can be one of the two operands)
[in]_pvOp1First operand
[in]_pvOp2Second operand
Returns
Resulting vector (Op1 + Op2)

Definition at line 154 of file orxVector.h.

◆ orxVector_AreEqual()

orxINLINE orxBOOL orxVector_AreEqual ( const orxVECTOR * _pvOp1,
const orxVECTOR * _pvOp2 )
static

Are vectors equal?

Parameters
[in]_pvOp1First vector to compare
[in]_pvOp2Second vector to compare
Returns
orxTRUE if both vectors are equal, orxFALSE otherwise

Definition at line 734 of file orxVector.h.

◆ orxVector_Bezier()

orxDLLAPI orxVECTOR *orxFASTCALL orxVector_Bezier ( orxVECTOR * _pvRes,
const orxVECTOR * _pvPoint1,
const orxVECTOR * _pvPoint2,
const orxVECTOR * _pvPoint3,
const orxVECTOR * _pvPoint4,
orxFLOAT _fT )
extern

Computes an interpolated point on a cubic Bezier curve segment for a given parameter

Parameters
[out]_pvResVector where to store the result
[in]_pvPoint1First point for this curve segment
[in]_pvPoint2First control point for this curve segment
[in]_pvPoint3Second control point for this curve segment
[in]_pvPoint4Last point for this curve segment
[in]_fTInterpolation parameter in [0.0, 1.0]
Returns
Interpolated point on the cubic Bezier curve segment

◆ orxVector_CatmullRom()

orxDLLAPI orxVECTOR *orxFASTCALL orxVector_CatmullRom ( orxVECTOR * _pvRes,
const orxVECTOR * _pvPoint1,
const orxVECTOR * _pvPoint2,
const orxVECTOR * _pvPoint3,
const orxVECTOR * _pvPoint4,
orxFLOAT _fT )
extern

Computes an interpolated point on a Catmull-Rom curve segment for a given parameter

Parameters
[out]_pvResVector where to store the result
[in]_pvPoint1First control point for this curve segment
[in]_pvPoint2Second control point for this curve segment
[in]_pvPoint3Third control point for this curve segment
[in]_pvPoint4Fourth control point for this curve segment
[in]_fTInterpolation parameter in [0.0, 1.0]
Returns
Interpolated point on the Catmull-Rom curve segment

◆ orxVector_Clamp()

orxINLINE orxVECTOR * orxVector_Clamp ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp,
const orxVECTOR * _pvMin,
const orxVECTOR * _pvMax )
static

Clamps a vector between two others

Parameters
[out]_pvResVector where to store the result (can be the operand)
[in]_pvOpVector to clamp
[in]_pvMinMinimum boundary
[in]_pvMaxMaximum boundary
Returns
Resulting vector CLAMP(Op, MIN, MAX)

Definition at line 430 of file orxVector.h.

◆ orxVector_Copy()

orxINLINE orxVECTOR * orxVector_Copy ( orxVECTOR * _pvDst,
const orxVECTOR * _pvSrc )
static

Copies a vector onto another one

Parameters
[in]_pvDstVector to copy to (destination)
[in]_pvSrcVector to copy from (source)
Returns
Destination vector

Definition at line 135 of file orxVector.h.

◆ orxVector_Cross()

orxINLINE orxVECTOR * orxVector_Cross ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp1,
const orxVECTOR * _pvOp2 )
static

Gets cross product of two vectors

Parameters
[out]_pvResVector where to store the result
[in]_pvOp1First operand
[in]_pvOp2Second operand
Returns
Cross product orxVECTOR / orxNULL

Definition at line 936 of file orxVector.h.

◆ orxVector_Div()

orxINLINE orxVECTOR * orxVector_Div ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp1,
const orxVECTOR * _pvOp2 )
static

Divides a vector by another vector and stores result in a third one

Parameters
[out]_pvResVector where to store the result (can be one of the two operands)
[in]_pvOp1First operand
[in]_pvOp2Second operand
Returns
Resulting vector (Op1 / Op2)

Definition at line 268 of file orxVector.h.

◆ orxVector_Divf()

orxINLINE orxVECTOR * orxVector_Divf ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp1,
orxFLOAT _fOp2 )
static

Divides a vector by an orxFLOAT and stores result in another one

Parameters
[out]_pvResVector where to store the result (can be the operand)
[in]_pvOp1First operand
[in]_fOp2Second operand
Returns
Resulting vector

Definition at line 241 of file orxVector.h.

◆ orxVector_Dot()

orxINLINE orxFLOAT orxVector_Dot ( const orxVECTOR * _pvOp1,
const orxVECTOR * _pvOp2 )
static

Gets dot product of two vectors

Parameters
[in]_pvOp1First operand
[in]_pvOp2Second operand
Returns
Dot product

Definition at line 895 of file orxVector.h.

◆ orxVector_Floor()

orxINLINE orxVECTOR * orxVector_Floor ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp )
static

Gets floored vector and stores the result in another one

Parameters
[out]_pvResVector where to store the result (can be the operand)
[in]_pvOpInput value
Returns
Resulting vector Floor(Op)

Definition at line 512 of file orxVector.h.

◆ orxVector_FromCartesianToSpherical()

orxINLINE orxVECTOR * orxVector_FromCartesianToSpherical ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp )
static

Transforms a cartesian vector into a spherical one

Parameters
[out]_pvResVector where to store the result (can be the operand)
[in]_pvOpVector to transform
Returns
Transformed vector

Definition at line 754 of file orxVector.h.

◆ orxVector_FromSphericalToCartesian()

orxINLINE orxVECTOR * orxVector_FromSphericalToCartesian ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp )
static

Transforms a spherical vector into a cartesian one

Parameters
[out]_pvResVector where to store the result (can be the operand)
[in]_pvOpVector to transform
Returns
Transformed vector

Definition at line 848 of file orxVector.h.

◆ orxVector_GetDistance()

orxINLINE orxFLOAT orxVector_GetDistance ( const orxVECTOR * _pvOp1,
const orxVECTOR * _pvOp2 )
static

Gets distance between 2 positions

Parameters
[in]_pvOp1First position
[in]_pvOp2Second position
Returns
Distance

Definition at line 612 of file orxVector.h.

◆ orxVector_GetSize()

orxINLINE orxFLOAT orxVector_GetSize ( const orxVECTOR * _pvOp)
static

Gets vector size

Parameters
[in]_pvOpInput vector
Returns
Vector's size

Definition at line 569 of file orxVector.h.

◆ orxVector_GetSquareDistance()

orxINLINE orxFLOAT orxVector_GetSquareDistance ( const orxVECTOR * _pvOp1,
const orxVECTOR * _pvOp2 )
static

Gets squared distance between 2 positions

Parameters
[in]_pvOp1First position
[in]_pvOp2Second position
Returns
Squared distance

Definition at line 588 of file orxVector.h.

◆ orxVector_GetSquareSize()

orxINLINE orxFLOAT orxVector_GetSquareSize ( const orxVECTOR * _pvOp)
static

Gets vector squared size

Parameters
[in]_pvOpInput vector
Returns
Vector's squared size

Definition at line 551 of file orxVector.h.

◆ orxVector_IsNull()

orxINLINE orxBOOL orxVector_IsNull ( const orxVECTOR * _pvOp)
static

Is vector null?

Parameters
[in]_pvOpVector to test
Returns
orxTRUE if vector's null, orxFALSE otherwise

Definition at line 715 of file orxVector.h.

◆ orxVector_Lerp()

orxINLINE orxVECTOR * orxVector_Lerp ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp1,
const orxVECTOR * _pvOp2,
orxFLOAT _fOp )
static

Lerps from one vector to another one using a coefficient

Parameters
[out]_pvResVector where to store the result (can be one of the two operands)
[in]_pvOp1First operand
[in]_pvOp2Second operand
[in]_fOpLerp coefficient parameter
Returns
Resulting vector

Definition at line 335 of file orxVector.h.

◆ orxVector_Max()

orxINLINE orxVECTOR * orxVector_Max ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp1,
const orxVECTOR * _pvOp2 )
static

Gets maximum between two vectors

Parameters
[out]_pvResVector where to store the result (can be one of the two operands)
[in]_pvOp1First operand
[in]_pvOp2Second operand
Returns
Resulting vector MAX(Op1, Op2)

Definition at line 407 of file orxVector.h.

◆ orxVector_Min()

orxINLINE orxVECTOR * orxVector_Min ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp1,
const orxVECTOR * _pvOp2 )
static

Gets minimum between two vectors

Parameters
[out]_pvResVector where to store the result (can be one of the two operands)
[in]_pvOp1First operand
[in]_pvOp2Second operand
Returns
Resulting vector MIN(Op1, Op2)

Definition at line 385 of file orxVector.h.

◆ orxVector_Mod()

orxINLINE orxVECTOR * orxVector_Mod ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp1,
const orxVECTOR * _pvOp2 )
static

Gets the modulo of a vector by another vector and stores result in a third one

Parameters
[out]_pvResVector where to store the result (can be one of the two operands)
[in]_pvOp1First operand
[in]_pvOp2Second operand
Returns
Resulting vector (Op1 / Op2)

Definition at line 290 of file orxVector.h.

◆ orxVector_Mul()

orxINLINE orxVECTOR * orxVector_Mul ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp1,
const orxVECTOR * _pvOp2 )
static

Multiplies a vector by another vector and stores result in a third one

Parameters
[out]_pvResVector where to store the result (can be one of the two operands)
[in]_pvOp1First operand
[in]_pvOp2Second operand
Returns
Resulting vector (Op1 * Op2)

Definition at line 219 of file orxVector.h.

◆ orxVector_Mulf()

orxINLINE orxVECTOR * orxVector_Mulf ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp1,
orxFLOAT _fOp2 )
static

Multiplies a vector by an orxFLOAT and stores result in another one

Parameters
[out]_pvResVector where to store the result (can be the operand)
[in]_pvOp1First operand
[in]_fOp2Second operand
Returns
Resulting vector

Definition at line 198 of file orxVector.h.

◆ orxVector_Neg()

orxINLINE orxVECTOR * orxVector_Neg ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp )
static

Negates a vector and stores result in another one

Parameters
[out]_pvResVector where to store the result (can be the operand)
[in]_pvOpVector to negates
Returns
Resulting vector (-Op)

Definition at line 472 of file orxVector.h.

◆ orxVector_Normalize()

orxINLINE orxVECTOR * orxVector_Normalize ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp )
static

Normalizes a vector

Parameters
[out]_pvResVector where to store the result (can be the operand)
[in]_pvOpVector to normalize
Returns
Normalized vector

Definition at line 636 of file orxVector.h.

◆ orxVector_Pow()

orxINLINE orxVECTOR * orxVector_Pow ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp1,
const orxVECTOR * _pvOp2 )
static

Gets the power of a vector by another vector and stores result in a third one

Parameters
[out]_pvResVector where to store the result (can be one of the two operands)
[in]_pvOp1First operand
[in]_pvOp2Second operand
Returns
Resulting vector (Op1 / Op2)

Definition at line 312 of file orxVector.h.

◆ orxVector_Rec()

orxINLINE orxVECTOR * orxVector_Rec ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp )
static

Gets reciprocal (1.0 /) vector and stores the result in another one

Parameters
[out]_pvResVector where to store the result (can be the operand)
[in]_pvOpInput value
Returns
Resulting vector (1 / Op)

Definition at line 492 of file orxVector.h.

◆ orxVector_Remap()

orxINLINE orxVECTOR * orxVector_Remap ( orxVECTOR * _pvRes,
const orxVECTOR * _pvA1,
const orxVECTOR * _pvB1,
const orxVECTOR * _pvA2,
const orxVECTOR * _pvB2,
const orxVECTOR * _pvV )
static

Remaps a vector value from one interval to another one

Parameters
[out]_pvResVector where to store the result (can be any of the other operands)
[in]_pvA1First interval's low boundary
[in]_pvB1First interval's high boundary
[in]_pvA2Second interval's low boundary
[in]_pvB2Second interval's high boundary
[in]_pvVValue to remap from the first interval to the second one
Returns
Resulting vector

Definition at line 360 of file orxVector.h.

◆ orxVector_Round()

orxINLINE orxVECTOR * orxVector_Round ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp )
static

Gets rounded vector and stores the result in another one

Parameters
[out]_pvResVector where to store the result (can be the operand)
[in]_pvOpInput value
Returns
Resulting vector Round(Op)

Definition at line 532 of file orxVector.h.

◆ orxVector_Set()

orxINLINE orxVECTOR * orxVector_Set ( orxVECTOR * _pvVec,
orxFLOAT _fX,
orxFLOAT _fY,
orxFLOAT _fZ )
static

Sets vector XYZ values (also work for other coordinate system)

Parameters
[in]_pvVecConcerned vector
[in]_fXFirst coordinate value
[in]_fYSecond coordinate value
[in]_fZThird coordinate value
Returns
Vector

Definition at line 105 of file orxVector.h.

◆ orxVector_SetAll()

orxINLINE orxVECTOR * orxVector_SetAll ( orxVECTOR * _pvVec,
orxFLOAT _fValue )
static

Sets all the vector coordinates with the given value

Parameters
[in]_pvVecConcerned vector
[in]_fValueValue to set
Returns
Vector

Definition at line 124 of file orxVector.h.

◆ orxVector_Sub()

orxINLINE orxVECTOR * orxVector_Sub ( orxVECTOR * _pvRes,
const orxVECTOR * _pvOp1,
const orxVECTOR * _pvOp2 )
static

Substracts vectors and stores result in a third one

Parameters
[out]_pvResVector where to store the result (can be one of the two operands)
[in]_pvOp1First operand
[in]_pvOp2Second operand
Returns
Resulting vector (Op1 - Op2)

Definition at line 176 of file orxVector.h.

Variable Documentation

◆ orxVECTOR_0

orxDLLAPI const orxVECTOR orxVECTOR_0
extern

Null vector

◆ orxVECTOR_1

orxDLLAPI const orxVECTOR orxVECTOR_1
extern

Vector filled with 1s

◆ orxVECTOR_X

orxDLLAPI const orxVECTOR orxVECTOR_X
extern

X-Axis unit vector

◆ orxVECTOR_Y

orxDLLAPI const orxVECTOR orxVECTOR_Y
extern

Y-Axis unit vector

◆ orxVECTOR_Z

orxDLLAPI const orxVECTOR orxVECTOR_Z
extern

Z-Axis unit vector


Generated for orx by doxygen 1.8.11