Mount Fuji Engine  0.8b
Public Member Functions | Static Public Attributes
MFVector Struct Reference

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...
 
MFVectoroperator= (const MFVector &v)
 Assignment operator. More...
 
MFVectoroperator+= (const MFVector &v)
 Plus-equals operator. More...
 
MFVectoroperator-= (const MFVector &v)
 Minus-equals operator. More...
 
MFVectoroperator*= (float f)
 Scale-equals operator. More...
 
MFVectoroperator*= (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...
 
MFVectorAdd4 (const MFVector &v1, const MFVector &v2)
 Add 4D function. More...
 
MFVectorSub4 (const MFVector &v1, const MFVector &v2)
 Subtract 4D function. More...
 
MFVectorMul4 (const MFVector &v1, float f)
 Scale 4D function. More...
 
MFVectorMul4 (const MFVector &v1, const MFVector &v2)
 Multiply 4D function. More...
 
MFVectorMad4 (const MFVector &v1, float f, const MFVector &v3)
 Scale and Add 4D function. More...
 
MFVectorMad4 (const MFVector &v1, const MFVector &v2, const MFVector &v3)
 Multiply and Add 4D function. More...
 
MFVectorAdd3 (const MFVector &v1, const MFVector &v2)
 Add 3D function. More...
 
MFVectorSub3 (const MFVector &v1, const MFVector &v2)
 Subtract 3D function. More...
 
MFVectorMul3 (const MFVector &v1, float f)
 Scale 3D function. More...
 
MFVectorMul3 (const MFVector &v1, const MFVector &v2)
 Multiply 3D function. More...
 
MFVectorMad3 (const MFVector &v1, float f, const MFVector &v3)
 Scale and Add 3D function. More...
 
MFVectorMad3 (const MFVector &v1, const MFVector &v2, const MFVector &v3)
 Multiply and Add 3D function. More...
 
MFVectorAdd2 (const MFVector &v1, const MFVector &v2)
 Add 2D function. More...
 
MFVectorSub2 (const MFVector &v1, const MFVector &v2)
 Subtract 2D function. More...
 
MFVectorMul2 (const MFVector &v1, float f)
 Scale 2D function. More...
 
MFVectorMul2 (const MFVector &v1, const MFVector &v2)
 Multiply 2D function. More...
 
MFVectorMad2 (const MFVector &v1, float f, const MFVector &v3)
 Scale and Add 2D function. More...
 
MFVectorMad2 (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...
 
MFVectorFromPackedColour (uint32 col)
 Build vector from platform-specific packed colour. More...
 
MFVectorRcp4 (const MFVector &v)
 Find the reciprocal of all 4 components. More...
 
MFVectorRcp3 (const MFVector &v)
 Find the reciprocal of the first 3 components. More...
 
MFVectorRcp2 (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...
 
MFVectorCross3 (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...
 
MFVectorNormalise4 ()
 Normalise vector 4D. More...
 
MFVectorNormalise3 ()
 Normalise vector 3D. More...
 
MFVectorNormalise2 ()
 Normalise vector 2D. More...
 
MFVectorNormalise4 (const MFVector &vec)
 Normalise vector 4D. More...
 
MFVectorNormalise3 (const MFVector &vec)
 Normalise vector 3D. More...
 
MFVectorNormalise2 (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...
 
MFVectorLerp (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 }.
 

Detailed Description

Vector class used throughout Fuji. Optimised for each platform.


The documentation for this struct was generated from the following file: