GLFX::Vec4 Struct Reference

#include <glfxvec.h>

List of all members.

Public Member Functions

 Vec4 (const float *v)
 Vec4 (const Vec4 &v)
 Vec4 (const Vec3 &v, float w)
 Vec4 (float x, float y, float z, float w)
 Vec4 (float f)
 operator float * ()
 operator const float * () const
 operator Vec3 () const
 operator const Vec3 & () const
float & operator[] (int n)
Vec4operator= (const Vec4 &v)
Vec4operator *= (const Vec4 &v)
Vec4operator/= (const Vec4 &v)
Vec4operator+= (const Vec4 &v)
Vec4operator-= (const Vec4 &v)
Vec3N ()
const Vec3N () const
bool Equal (const Vec4 &v) const
bool NotEqual (const Vec4 &v) const
float Eval (const Vec3 &point) const
bool Coplanar (const Vec4 &v) const
bool RayIntersect (Vec3 &out, const Vec3 &org, const Vec3 &dir) const
bool LineIntersect (Vec3 &out, const Vec3 &beg, const Vec3 &end) const
Vec3 MirrorPoint (const Vec3 &point) const
Vec3 MirrorVector (const Vec3 &point) const
Vec4 MirrorPlane (const Vec4 &plane) const
Vec3 ProjectPoint (const Vec3 &point) const
bool PointOnPlane (const Vec3 &point) const

Public Attributes

float x
float y
float z
float w

Friends

Vec4 operator * (const Vec4 &a, const Vec4 &b)
Vec4 operator/ (const Vec4 &a, const Vec4 &b)
Vec4 operator+ (const Vec4 &a, const Vec4 &b)
Vec4 operator+ (const Vec4 &v)
Vec4 operator- (const Vec4 &a, const Vec4 &b)
Vec4 operator- (const Vec4 &v)
bool operator== (const Vec4 &a, const Vec4 &b)
bool operator!= (const Vec4 &a, const Vec4 &b)
bool PlanesIntersect (Vec3 &out, const Vec4 &a, const Vec4 &b, const Vec4 &c)
Vec4 PlaneFromPoint (const Vec3 &point, const Vec3 &normal)
Vec4 PlaneFromPoints (const Vec3 &a, const Vec3 &b, const Vec3 &c)
Vec4 PlaneFromEdge (const Vec3 &begin, const Vec3 &end, const Vec3 &normal)
Vec4 Lerp (const Vec4 &a, const Vec4 &b, float f)


Constructor & Destructor Documentation

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

Construct from array of floats.

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

Construct from other vector.

GLFX::Vec4::Vec4 ( const Vec3 v,
float  w 
) [inline]

Construct from vector and scalar.

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

Construct from four float values.

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

Construct from single float value.


Member Function Documentation

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

Convert to array of floats.

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

Convert to array of floats.

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

Convert to 3d vector.

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

Convert to 3d vector.

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

Get plane element.

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

Assign plane.

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

Multiply plane elements.

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

Divide plane elements.

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

Add planes.

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

Substract planes.

Vec3 & GLFX::Vec4::N (  )  [inline]

Plane normal.

const Vec3 & GLFX::Vec4::N (  )  const [inline]

Plane normal.

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

Test if plane are equal (with epsilon).

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

Test if planes are not equal (with epsilon).

float GLFX::Vec4::Eval ( const Vec3 point  )  const [inline]

Evaluate point against plane.

bool GLFX::Vec4::Coplanar ( const Vec4 v  )  const [inline]

Test if planes are coplanar.

bool GLFX::Vec4::RayIntersect ( Vec3 out,
const Vec3 org,
const Vec3 dir 
) const [inline]

Find intersectio between plane and a ray.

bool GLFX::Vec4::LineIntersect ( Vec3 out,
const Vec3 beg,
const Vec3 end 
) const [inline]

Find intersection between plane and a line.

Vec3 GLFX::Vec4::MirrorPoint ( const Vec3 point  )  const [inline]

Mirror point by plane.

Vec3 GLFX::Vec4::MirrorVector ( const Vec3 point  )  const [inline]

Mirror vector by plane.

Vec4 GLFX::Vec4::MirrorPlane ( const Vec4 plane  )  const [inline]

Mirror plane by plane.

Vec3 GLFX::Vec4::ProjectPoint ( const Vec3 point  )  const [inline]

Project point onto plane (smallest distance).

bool GLFX::Vec4::PointOnPlane ( const Vec3 point  )  const [inline]

Test if point is on (thick) plane.


Friends And Related Function Documentation

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

Multiply vector elements.

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

Divide vector elements.

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

Add vectors.

Vec4 operator+ ( const Vec4 v  )  [friend]

Positive vector.

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

Substract vectors.

Vec4 operator- ( const Vec4 v  )  [friend]

Negate vector.

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

Test if vectors are equal.

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

Test if vectors are not equal.

bool PlanesIntersect ( Vec3 out,
const Vec4 a,
const Vec4 b,
const Vec4 c 
) [friend]

Find intersection of three planes (if exists).

Vec4 PlaneFromPoint ( const Vec3 point,
const Vec3 normal 
) [friend]

Construct plane from point and normal.

Vec4 PlaneFromPoints ( const Vec3 a,
const Vec3 b,
const Vec3 c 
) [friend]

Construct plane from three points.

Vec4 PlaneFromEdge ( const Vec3 begin,
const Vec3 end,
const Vec3 normal 
) [friend]

Construct plane from line and normal.

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

Linear interpolation between to vectors.


Member Data Documentation

float GLFX::Vec4::x

X-coordinate.

float GLFX::Vec4::y

Y-coordinate.

float GLFX::Vec4::z

Z-coordinate.

float GLFX::Vec4::w

W-coordinate.


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