Mount Fuji Engine
0.8b
|
Vector class to perform various vector operations. More...
Public Member Functions | |
void | Set (float x, float y, float z=0.0f, float w=1.0f) |
Set each component of a vector. More... | |
void | Swizzle (const MFVector &source, const uint8 x, const uint8 y, const uint8 z, const uint8 w) |
Swizzle components within a vector. More... | |
MFVector | operator- () |
Unary minus operator. More... | |
bool | operator== (const MFVector &v) const |
Comparison operator. More... | |
bool | operator!= (const MFVector &v) const |
Not-equals operator. More... | |
MFVector & | operator= (const MFVector &v) |
Assignment operator. More... | |
MFVector & | operator+= (const MFVector &v) |
Plus-equals operator. More... | |
MFVector & | operator-= (const MFVector &v) |
Minus-equals operator. More... | |
MFVector & | operator*= (float f) |
Scale-equals operator. More... | |
MFVector & | operator*= (const MFVector &v) |
Modulate-equals operator. More... | |
MFVector | operator+ (const MFVector &v) const |
Addition operator. More... | |
MFVector | operator- (const MFVector &v) const |
Subtraction operator. More... | |
MFVector | operator* (float f) const |
Scale operator. More... | |
MFVector | operator* (const MFVector &v) const |
Modulate operator. More... | |
MFVector & | Add4 (const MFVector &v1, const MFVector &v2) |
Add 4D function. More... | |
MFVector & | Sub4 (const MFVector &v1, const MFVector &v2) |
Subtract 4D function. More... | |
MFVector & | Mul4 (const MFVector &v1, float f) |
Scale 4D function. More... | |
MFVector & | Mul4 (const MFVector &v1, const MFVector &v2) |
Multiply 4D function. More... | |
MFVector & | Mad4 (const MFVector &v1, float f, const MFVector &v3) |
Scale and Add 4D function. More... | |
MFVector & | Mad4 (const MFVector &v1, const MFVector &v2, const MFVector &v3) |
Multiply and Add 4D function. More... | |
MFVector & | Add3 (const MFVector &v1, const MFVector &v2) |
Add 3D function. More... | |
MFVector & | Sub3 (const MFVector &v1, const MFVector &v2) |
Subtract 3D function. More... | |
MFVector & | Mul3 (const MFVector &v1, float f) |
Scale 3D function. More... | |
MFVector & | Mul3 (const MFVector &v1, const MFVector &v2) |
Multiply 3D function. More... | |
MFVector & | Mad3 (const MFVector &v1, float f, const MFVector &v3) |
Scale and Add 3D function. More... | |
MFVector & | Mad3 (const MFVector &v1, const MFVector &v2, const MFVector &v3) |
Multiply and Add 3D function. More... | |
MFVector & | Add2 (const MFVector &v1, const MFVector &v2) |
Add 2D function. More... | |
MFVector & | Sub2 (const MFVector &v1, const MFVector &v2) |
Subtract 2D function. More... | |
MFVector & | Mul2 (const MFVector &v1, float f) |
Scale 2D function. More... | |
MFVector & | Mul2 (const MFVector &v1, const MFVector &v2) |
Multiply 2D function. More... | |
MFVector & | Mad2 (const MFVector &v1, float f, const MFVector &v3) |
Scale and Add 2D function. More... | |
MFVector & | Mad2 (const MFVector &v1, const MFVector &v2, const MFVector &v3) |
Multiply and Add 2D function. More... | |
operator float * () | |
float pointer cast operator. More... | |
operator float * () const | |
const float pointer cast operator. More... | |
uint32 | ToPackedColour () const |
Get platform-specific packed colour. More... | |
MFVector & | FromPackedColour (uint32 col) |
Build vector from platform-specific packed colour. More... | |
MFVector & | Rcp4 (const MFVector &v) |
Find the reciprocal of all 4 components. More... | |
MFVector & | Rcp3 (const MFVector &v) |
Find the reciprocal of the first 3 components. More... | |
MFVector & | Rcp2 (const MFVector &v) |
Find the reciprocal of the first 2 components. More... | |
float | Dot4 (const MFVector &vec) const |
Dot Product 4D. More... | |
float | DotH (const MFVector &vec4) const |
Dot Product Homogeneous (assumes this vectors w = 1). More... | |
float | Dot3 (const MFVector &vec) const |
Dot Product 3D. More... | |
float | Dot2 (const MFVector &vec) const |
Dot Product 2D. More... | |
MFVector | Cross3 (const MFVector &vec) const |
Cross Product 3D. More... | |
float | Cross2 (const MFVector &vec) const |
Cross Product 2D. More... | |
MFVector & | Cross3 (const MFVector &vec, const MFVector &vec2) |
Cross Product 3D. More... | |
float | MagSquared4 () const |
Get the 4D Magnitude Squared. More... | |
float | MagSquared3 () const |
Get the 3D Magnitude Squared. More... | |
float | MagSquared2 () const |
Get the 2D Magnitude Squared. More... | |
float | Magnitude4 () const |
Get the 4D Magnitude. More... | |
float | Magnitude3 () const |
Get the 3D Magnitude. More... | |
float | Magnitude2 () const |
Get the 2D Magnitude. More... | |
float | InvMagnitude4 () const |
Get the inverse 4D Magnitude. More... | |
float | InvMagnitude3 () const |
Get the inverse 3D Magnitude. More... | |
float | InvMagnitude2 () const |
Get the inverse 2D Magnitude. More... | |
MFVector & | Normalise4 () |
Normalise vector 4D. More... | |
MFVector & | Normalise3 () |
Normalise vector 3D. More... | |
MFVector & | Normalise2 () |
Normalise vector 2D. More... | |
MFVector & | Normalise4 (const MFVector &vec) |
Normalise vector 4D. More... | |
MFVector & | Normalise3 (const MFVector &vec) |
Normalise vector 3D. More... | |
MFVector & | Normalise2 (const MFVector &vec) |
Normalise vector 2D. More... | |
float | Distance (const MFVector &v) const |
Get the distance between 2 vectors. More... | |
float | GetAngle (const MFVector &ref=up) |
Get the angle between 2 vectors. More... | |
MFVector & | Lerp (const MFVector &v, float t) |
Lerp between 2 vectors. More... | |
const char * | ToString4 () const |
Convert 4D vector to a string. More... | |
const char * | ToString3 () const |
Convert 3D vector to a string. More... | |
const char * | ToString2 () const |
Convert 2D vector to a string. More... | |
Static Public Attributes | |
static const MFVector | zero |
Constant ZERO vector { 0, 0, 0, 0 }. | |
static const MFVector | one |
Constant ONE vector { 1, 1, 1, 1 }. | |
static const MFVector | identity |
Constant IDENTITY vector { 0, 0, 0, 1 }. | |
static const MFVector | up |
Constant UP (+Y) vector { 0, 1, 0, 1 }. | |
static const MFVector | right |
Constant RIGHT (+X) vector { 1, 0, 0, 1 }. | |
static const MFVector | forward |
Constant FORWARD (+Z) vector { 0, 0, 1, 1 }. | |
static const MFVector | red |
Constant RED colour vector { 1, 0, 0, 1 }. | |
static const MFVector | green |
Constant GREEN colour vector { 0, 1, 0, 1 }. | |
static const MFVector | blue |
Constant BLUE colour vector { 0, 0, 1, 1 }. | |
static const MFVector | yellow |
Constant YELLOW colour vector { 1, 1, 0, 1 }. | |
static const MFVector | white |
Constant WHITE colour vector { 1, 1, 1, 1 }. | |
static const MFVector | black |
Constant BLACK colour vector { 0, 0, 0, 1 }. | |
static const MFVector | grey |
Constant GREY colour vector { 0.5, 0.5, 0.5, 1 }. | |
static const MFVector | lightgrey |
Constant LIGHT GREY colour vector { 0.8, 0.8, 0.8, 1 }. | |
static const MFVector | darkgrey |
Constant DARK GREY colour vector { 0.3, 0.3, 0.3, 1 }. | |
Vector class used throughout Fuji. Optimised for each platform.