MathFu
An open source project by FPL.
 All Classes Namespaces Files Functions Variables Typedefs Friends Groups Pages
mathfu::Vector< float, 4 > Class Template Reference

Public Types

typedef float Scalar
 

Public Member Functions

 Vector (const Vector< float, 4 > &v)
 
 Vector (const Vector< int, 4 > &v)
 
 Vector (const simd4f &v)
 
 Vector (const float &s)
 
 Vector (const float &s1, const float &s2, const float &s3, const float &s4)
 
 Vector (const float *v)
 
 Vector (const Vector< float, 3 > &vector3, const float &value)
 
 Vector (const Vector< float, 2 > &vector12, const Vector< float, 2 > &vector34)
 
 Vector (const VectorPacked< float, 4 > &vector)
 
float & operator() (const int i)
 
const float & operator() (const int i) const
 
float & operator[] (const int i)
 
const float & operator[] (const int i) const
 
Vector< float, 3 > xyz ()
 GLSL style multi-component accessors.
 
const Vector< float, 3 > xyz () const
 
Vector< float, 2 > xy ()
 
const Vector< float, 2 > xy () const
 
Vector< float, 2 > zw ()
 
const Vector< float, 2 > zw () const
 
void Pack (VectorPacked< float, 4 > *const vector) const
 
Vector< float, 4 > operator- () const
 
Vector< float, 4 > operator* (const Vector< float, 4 > &v) const
 
Vector< float, 4 > operator/ (const Vector< float, 4 > &v) const
 
Vector< float, 4 > operator+ (const Vector< float, 4 > &v) const
 
Vector< float, 4 > operator- (const Vector< float, 4 > &v) const
 
Vector< float, 4 > operator* (const float &s) const
 
Vector< float, 4 > operator/ (const float &s) const
 
Vector< float, 4 > operator+ (const float &s) const
 
Vector< float, 4 > operator- (const float &s) const
 
Vector< float, 4 > & operator*= (const Vector< float, 4 > &v)
 
Vector< float, 4 > & operator/= (const Vector< float, 4 > &v)
 
Vector< float, 4 > & operator+= (const Vector< float, 4 > &v)
 
Vector< float, 4 > & operator-= (const Vector< float, 4 > &v)
 
Vector< float, 4 > & operator*= (const float &s)
 
Vector< float, 4 > & operator/= (const float &s)
 
Vector< float, 4 > & operator+= (const float &s)
 
Vector< float, 4 > & operator-= (const float &s)
 
bool operator== (const Vector< float, 4 > &v) const
 
bool operator!= (const Vector< float, 4 > &v) const
 
float LengthSquared () const
 
float Length () const
 
float Normalize ()
 
Vector< float, 4 > Normalized () const
 

Static Public Member Functions

template<typename CompatibleT >
static Vector< float, 4 > FromType (const CompatibleT &compatible)
 
template<typename CompatibleT >
static CompatibleT ToType (const Vector< float, 4 > &v)
 
static float DotProduct (const Vector< float, 4 > &v1, const Vector< float, 4 > &v2)
 
static Vector< float, 4 > HadamardProduct (const Vector< float, 4 > &v1, const Vector< float, 4 > &v2)
 
static Vector< float, 4 > Lerp (const Vector< float, 4 > &v1, const Vector< float, 4 > &v2, float percent)
 
static Vector< float, 4 > RandomInRange (const Vector< float, 4 > &min, const Vector< float, 4 > &max)
 
static Vector< float, 4 > Max (const Vector< float, 4 > &v1, const Vector< float, 4 > &v2)
 
static Vector< float, 4 > Min (const Vector< float, 4 > &v1, const Vector< float, 4 > &v2)
 

Public Attributes

MATHFU_DEFINE_CLASS_SIMD_AWARE_NEW_DELETE
union mathfu::Vector< float, 4 >:: { ... }  
 
simd4f simd
 
float data_ [4]
 
float x
 
float y
 
float z
 
float w
 

Friends

template<class T , int rows, int cols>
class Matrix
 

Member Function Documentation

static Vector<float, 4> mathfu::Vector< float, 4 >::RandomInRange ( const Vector< float, 4 > &  min,
const Vector< float, 4 > &  max 
)
inlinestatic

Generates a random vector, where the range for each component is bounded by min and max.


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