GLFX::Quat Struct Reference

#include <glfxvec.h>

List of all members.


Detailed Description

    w + i * x + j * y + k * z
    where: i, j, k  - quaternion base
    


Public Member Functions

 Quat (const float *q)
 Quat (const Quat &q)
 Quat (const Vec3 &v, float w)
 Quat (float x, float y, float z, float w)
 Quat (float f)
 operator float * ()
 operator const float * () const
 operator Vec4 () const
float & operator[] (int n)
Quatoperator= (const Quat &q)
Quatoperator *= (const Quat &q)
Quatoperator *= (const float f)
Quatoperator+= (const Quat &q)
Quatoperator-= (const Quat &q)
Vec3N ()
const Vec3N () const
Vec3 TransformVector (const Vec3 &v) const

Public Attributes

float x
float y
float z
float w

Friends

Quat operator * (const Quat &a, const Quat &b)
Quat operator * (const Quat &q, float f)
Quat operator * (float f, const Quat &q)
Quat operator+ (const Quat &a, const Quat &b)
Quat operator+ (const Quat &q)
Quat operator- (const Quat &a, const Quat &b)
Quat operator- (const Quat &q)
bool operator== (const Quat &a, const Quat &b)
bool operator!= (const Quat &a, const Quat &b)
Quat Normalize (const Quat &q)
float Dot (const Quat &a, const Quat &b)
Quat Slerp (const Quat &a, const Quat &b, float f, bool shortestPath)
Quat Inverse (const Quat &q)
Quat UnitInverse (const Quat &q)
Quat QuaternionFromAngleAxis (const Vec3 &axis, float angle)
Quat QuaternionRotationYawPitchRoll (float yaw, float pitch, float roll)
Quat QuaternionRotationYawPitchRoll (const Vec3 &angles)


Constructor & Destructor Documentation

GLFX::Quat::Quat ( const float *  q  )  [inline]

Construct quaternion from an array of 4 floats.

GLFX::Quat::Quat ( const Quat q  )  [inline]

Construct quaternion from another one.

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

Construct quaternion from vector and scalar.

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

Construct quaternion from 4 float values.

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

Construct quaternion from scalar.


Member Function Documentation

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

Return array of floats.

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

Return array of floats.

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

Convert to 4d vector.

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

Get quaternion element.

Quat & GLFX::Quat::operator= ( const Quat q  )  [inline]

Assign quaternion.

Quat & GLFX::Quat::operator *= ( const Quat q  )  [inline]

Multiply by quaternion.

Quat & GLFX::Quat::operator *= ( const float  f  )  [inline]

Multiply by scalar.

Quat & GLFX::Quat::operator+= ( const Quat q  )  [inline]

Add quaternion.

Quat & GLFX::Quat::operator-= ( const Quat q  )  [inline]

Substract quaternion.

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

Return 3d vector.

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

Return 3d vector.

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

Transform vector by quaternion.


Friends And Related Function Documentation

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

Quaternion multiplication.

Quat operator * ( const Quat q,
float  f 
) [friend]

Quaternion multiplication by scalar.

Quat operator * ( float  f,
const Quat q 
) [friend]

Quaternion multiplication by scalar.

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

Quaternion addition.

Quat operator+ ( const Quat q  )  [friend]

Positive quaternion.

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

Quaternion substraction.

Quat operator- ( const Quat q  )  [friend]

Quaternion negation.

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

Check if quaternions are equal.

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

Check if quaternions are not equal.

Quat Normalize ( const Quat q  )  [friend]

Normalize quaternion.

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

Quaternion dot product.

Quat Slerp ( const Quat a,
const Quat b,
float  f,
bool  shortestPath 
) [friend]

Interpolate quaternion.

Quat Inverse ( const Quat q  )  [friend]

Inverse quaternion.

Quat UnitInverse ( const Quat q  )  [friend]

Inverse unit quaternion.

Quat QuaternionFromAngleAxis ( const Vec3 axis,
float  angle 
) [friend]

Construct quaternion from axis and angle.

Quat QuaternionRotationYawPitchRoll ( float  yaw,
float  pitch,
float  roll 
) [friend]

Construct quaternion from yaw, pitch and roll.

Quat QuaternionRotationYawPitchRoll ( const Vec3 angles  )  [friend]

Construct quaternion from yaw, pitch and roll.


Member Data Documentation

float GLFX::Quat::x

x-component

float GLFX::Quat::y

y-component

float GLFX::Quat::z

z-component

float GLFX::Quat::w

w-component


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