Recast Navigation  1.0.35
Vector.h File Reference

Go to the source code of this file.

Functions

Vector helper functions.
void rcVcross (float *dest, const float *v1, const float *v2)
 Derives the cross product of two vectors. More...
 
float rcVdot (const float *v1, const float *v2)
 Derives the dot product of two vectors. More...
 
void rcVmad (float *dest, const float *v1, const float *v2, const float s)
 Performs a scaled vector addition. More...
 
void rcVadd (float *dest, const float *v1, const float *v2)
 Performs a vector addition. More...
 
void rcVsub (float *dest, const float *v1, const float *v2)
 Performs a vector subtraction. More...
 
void rcVmin (float *mn, const float *v)
 Selects the minimum value of each element from the specified vectors. More...
 
void rcVmax (float *mx, const float *v)
 Selects the maximum value of each element from the specified vectors. More...
 
void rcVcopy (float *dest, const float *v)
 Performs a vector copy. More...
 
float rcVdist (const float *v1, const float *v2)
 Returns the distance between two points. More...
 
float rcVdistSqr (const float *v1, const float *v2)
 Returns the square of the distance between two points. More...
 
void rcVnormalize (float *v)
 Normalizes the vector. More...
 

Function Documentation

void rcVadd ( float *  dest,
const float *  v1,
const float *  v2 
)
inline

Performs a vector addition.

(v1 + v2)

Parameters
[out]destThe result vector. [(x, y, z)]
[in]v1The base vector. [(x, y, z)]
[in]v2The vector to add to v1. [(x, y, z)]
void rcVcopy ( float *  dest,
const float *  v 
)
inline

Performs a vector copy.

Parameters
[out]destThe result. [(x, y, z)]
[in]vThe vector to copy. [(x, y, z)]
void rcVcross ( float *  dest,
const float *  v1,
const float *  v2 
)
inline

Derives the cross product of two vectors.

(v1 x v2)

Parameters
[out]destThe cross product. [(x, y, z)]
[in]v1A Vector [(x, y, z)]
[in]v2A vector [(x, y, z)]
float rcVdist ( const float *  v1,
const float *  v2 
)
inline

Returns the distance between two points.

Parameters
[in]v1A point. [(x, y, z)]
[in]v2A point. [(x, y, z)]
Returns
The distance between the two points.
float rcVdistSqr ( const float *  v1,
const float *  v2 
)
inline

Returns the square of the distance between two points.

Parameters
[in]v1A point. [(x, y, z)]
[in]v2A point. [(x, y, z)]
Returns
The square of the distance between the two points.
float rcVdot ( const float *  v1,
const float *  v2 
)
inline

Derives the dot product of two vectors.

(v1 . v2)

Parameters
[in]v1A Vector [(x, y, z)]
[in]v2A vector [(x, y, z)]
Returns
The dot product.
void rcVmad ( float *  dest,
const float *  v1,
const float *  v2,
const float  s 
)
inline

Performs a scaled vector addition.

(v1 + (v2 * s))

Parameters
[out]destThe result vector. [(x, y, z)]
[in]v1The base vector. [(x, y, z)]
[in]v2The vector to scale and add to v1. [(x, y, z)]
[in]sThe amount to scale v2 by before adding to v1.
void rcVmax ( float *  mx,
const float *  v 
)
inline

Selects the maximum value of each element from the specified vectors.

Parameters
[in,out]mxA vector. (Will be updated with the result.) [(x, y, z)]
[in]vA vector. [(x, y, z)]
void rcVmin ( float *  mn,
const float *  v 
)
inline

Selects the minimum value of each element from the specified vectors.

Parameters
[in,out]mnA vector. (Will be updated with the result.) [(x, y, z)]
[in]vA vector. [(x, y, z)]
void rcVnormalize ( float *  v)
inline

Normalizes the vector.

Parameters
[in,out]vThe vector to normalize. [(x, y, z)]
void rcVsub ( float *  dest,
const float *  v1,
const float *  v2 
)
inline

Performs a vector subtraction.

(v1 - v2)

Parameters
[out]destThe result vector. [(x, y, z)]
[in]v1The base vector. [(x, y, z)]
[in]v2The vector to subtract from v1. [(x, y, z)]