GLFX::Vec3 Struct Reference

#include <glfxvec.h>

List of all members.

Public Member Functions

 Vec3 (const float *v)
 Vec3 (const Vec3 &v)
 Vec3 (float x, float y, float z)
 Vec3 (float f)
 operator float * ()
 operator const float * () const
 operator Vec2 () const
 operator Vec4 () const
float & operator[] (int n)
Vec3operator= (const Vec3 &v)
Vec3Normalize ()
float Length () const
bool Equal (const Vec3 &v) const
bool NotEqual (const Vec3 &v) const
Vec3 MakePlanar (const Vec3 &v) const
Vec3operator *= (const Vec3 &v)
Vec3operator/= (const Vec3 &v)
Vec3operator+= (const Vec3 &v)
Vec3operator-= (const Vec3 &v)

Public Attributes

float x
float y
float z

Friends

Vec3 operator * (const Vec3 &a, const Vec3 &b)
Vec3 operator/ (const Vec3 &a, const Vec3 &b)
Vec3 operator+ (const Vec3 &a, const Vec3 &b)
Vec3 operator+ (const Vec3 &v)
Vec3 operator- (const Vec3 &a, const Vec3 &b)
Vec3 operator- (const Vec3 &v)
bool operator== (const Vec3 &a, const Vec3 &b)
bool operator!= (const Vec3 &a, const Vec3 &b)
bool operator< (const Vec3 &a, const Vec3 &b)
Vec3 Cross (const Vec3 &a, const Vec3 &b)
float Dot (const Vec3 &a, const Vec3 &b)
Vec3 Normalize (const Vec3 &v)
Vec3 Lerp (const Vec3 &a, const Vec3 &b, float f)
Vec3 RotateVectorX (const Vec3 &v, float angle)
Vec3 RotateVectorY (const Vec3 &v, float angle)
Vec3 RotateVectorZ (const Vec3 &v, float angle)
float Length (const Vec3 &a)


Constructor & Destructor Documentation

GLFX::Vec3::Vec3 ( const float *  v  )  [inline]

Construct vector from array of floats.

GLFX::Vec3::Vec3 ( const Vec3 v  )  [inline]

Construct vector from another one.

GLFX::Vec3::Vec3 ( float  x,
float  y,
float  z 
) [inline]

Construct vector from 3 floats.

GLFX::Vec3::Vec3 ( float  f  )  [inline]

Construct vector from single float.


Member Function Documentation

GLFX::Vec3::operator float * (  )  [inline]

Convert to array of floats.

GLFX::Vec3::operator const float * (  )  const [inline]

Convert to array of floats.

GLFX::Vec3::operator Vec2 (  )  const [inline]

Convert to 2d vector.

GLFX::Vec3::operator Vec4 (  )  const [inline]

Convert to 4d vector.

float & GLFX::Vec3::operator[] ( int  n  )  [inline]

Get vector element.

Vec3 & GLFX::Vec3::operator= ( const Vec3 v  )  [inline]

Assign vectors.

Vec3 & GLFX::Vec3::Normalize (  )  [inline]

Normalize vector. This method is not safe for zero-length vectors.

float GLFX::Vec3::Length (  )  const [inline]

Compute vector length.

bool GLFX::Vec3::Equal ( const Vec3 v  )  const [inline]

Test if (thick) vectors are equal.

bool GLFX::Vec3::NotEqual ( const Vec3 v  )  const [inline]

Test if (thick) vectors are not equal.

Vec3 GLFX::Vec3::MakePlanar ( const Vec3 v  )  const [inline]

Make vector planar. The dot-product of this vector and the produced vector will be 0.

Vec3 & GLFX::Vec3::operator *= ( const Vec3 v  )  [inline]

Multiply vector elements.

Vec3 & GLFX::Vec3::operator/= ( const Vec3 v  )  [inline]

Divide vector elements.

Vec3 & GLFX::Vec3::operator+= ( const Vec3 v  )  [inline]

Add vectors.

Vec3 & GLFX::Vec3::operator-= ( const Vec3 v  )  [inline]

Substract vectors.


Friends And Related Function Documentation

Vec3 operator * ( const Vec3 a,
const Vec3 b 
) [friend]

Multiply vector elements.

Vec3 operator/ ( const Vec3 a,
const Vec3 b 
) [friend]

Divide vector elements.

Vec3 operator+ ( const Vec3 a,
const Vec3 b 
) [friend]

Add vectors.

Vec3 operator+ ( const Vec3 v  )  [friend]

Positive vector.

Vec3 operator- ( const Vec3 a,
const Vec3 b 
) [friend]

Substract vectors.

Vec3 operator- ( const Vec3 v  )  [friend]

Negate vector.

bool operator== ( const Vec3 a,
const Vec3 b 
) [friend]

Test if vectors are equal.

bool operator!= ( const Vec3 a,
const Vec3 b 
) [friend]

Test if vectors are not equal.

bool operator< ( const Vec3 a,
const Vec3 b 
) [friend]

Test if any of vector a element is less than any of vector b element.

Vec3 Cross ( const Vec3 a,
const Vec3 b 
) [friend]

Compute vector cross product.

float Dot ( const Vec3 a,
const Vec3 b 
) [friend]

Compute vector dot product.

Vec3 Normalize ( const Vec3 v  )  [friend]

Normalize vectors.

Vec3 Lerp ( const Vec3 a,
const Vec3 b,
float  f 
) [friend]

Linear interpolation of two vectors.

Vec3 RotateVectorX ( const Vec3 v,
float  angle 
) [friend]

Rotate vector around X-axis.

Vec3 RotateVectorY ( const Vec3 v,
float  angle 
) [friend]

Rotate vector around Y-axis.

Vec3 RotateVectorZ ( const Vec3 v,
float  angle 
) [friend]

Rotate vector around Z-axis.

float Length ( const Vec3 a  )  [friend]

Compute vector length.


Member Data Documentation

float GLFX::Vec3::x

X-coordinate.

float GLFX::Vec3::y

Y-coordinate.

float GLFX::Vec3::z

Z-coordinate.


The documentation for this struct was generated from the following file:
SourceForge.net Logo