Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

gslib::glsl_math::quat Struct Reference

#include <glsl_math.h>

Inheritance diagram for gslib::glsl_math::quat:

Inheritance graph
[legend]
Collaboration diagram for gslib::glsl_math::quat:

Collaboration graph
[legend]
List of all members.

Public Types

typedef tuple_mixin< quat, 4 > TupleMixin

Public Member Functions

 quat ()
 quat (value_type v)
 quat (value_type inX, value_type inY, value_type inZ, value_type inW)
 quat (const vec3 &axis, value_type theta)
vec4xyzw ()
 swizzle ( cast to vec4 )

const vec4xyzw () const
 swizzle ( cast to vec4 )

vec3xyz ()
 swizzle

const vec3xyz () const
 swizzle

vec2xy ()
 swizzle

const vec2xy () const
 swizzle

quatoperator *= (value_type v)
quat operator * (value_type v) const
quatoperator/= (value_type v)
quat operator/ (value_type v) const
quat operator * (const quat &q) const
quatoperator *= (const quat &q)

Static Public Member Functions

quat identity ()

Member Typedef Documentation

typedef tuple_mixin< quat, 4 > gslib::glsl_math::quat::TupleMixin
 

Definition at line 774 of file glsl_math.h.


Constructor & Destructor Documentation

gslib::glsl_math::quat::quat  )  [inline]
 

Definition at line 734 of file glsl_math.h.

Referenced by identity(), and operator *().

00734 {}

gslib::glsl_math::quat::quat value_type  v  )  [inline]
 

Definition at line 735 of file glsl_math.h.

00735 : x( v ), y( v ), z( v ), w( v ) {}

gslib::glsl_math::quat::quat value_type  inX,
value_type  inY,
value_type  inZ,
value_type  inW
[inline]
 

Definition at line 736 of file glsl_math.h.

00736 : x( inX ), y( inY ), z( inZ ), w( inW ) {}

gslib::glsl_math::quat::quat const vec3 axis,
value_type  theta
[inline]
 

Definition at line 737 of file glsl_math.h.

References xyz().

00737                                                        {
00738                 value_type halfCos = cosf( theta * 0.5f );
00739                 value_type halfSin = sinf( theta * 0.5f );
00740                 xyz() = halfCos * axis;
00741                 w = halfSin;
00742             }

Here is the call graph for this function:


Member Function Documentation

quat gslib::glsl_math::quat::identity  )  [inline, static]
 

Definition at line 800 of file glsl_math.h.

References quat().

00800                                    {
00801                 return quat( 0, 0, 0, 1 );
00802             }

Here is the call graph for this function:

quat gslib::glsl_math::quat::operator * const quat q  )  const [inline]
 

Definition at line 787 of file glsl_math.h.

References quat(), w, x, y, and z.

00787                                                     {
00788                 return quat(
00789                     w * q.x + x * q.w + y * q.z - z * q.y,
00790                     w * q.y + y * q.w + z * q.x - x * q.z,
00791                     w * q.z + z * q.w + x * q.y - y * q.x,
00792                     w * q.w - x * q.x - y * q.y - z * q.z
00793                 );
00794             }

Here is the call graph for this function:

quat gslib::glsl_math::quat::operator * value_type  v  )  const [inline]
 

Reimplemented from gslib::glsl_math::tuple_mixin< quat, 4 >.

Definition at line 778 of file glsl_math.h.

00778                                                    {
00779                 return TupleMixin::operator * ( v );
00780             }

quat& gslib::glsl_math::quat::operator *= const quat q  )  [inline]
 

Definition at line 795 of file glsl_math.h.

00795                                                 {
00796                 *this = *this * q;
00797                 return *this;
00798             }

quat& gslib::glsl_math::quat::operator *= value_type  v  )  [inline]
 

Reimplemented from gslib::glsl_math::tuple_mixin< quat, 4 >.

Definition at line 775 of file glsl_math.h.

00775                                                {
00776                 return TupleMixin::operator *= ( v );
00777             }

quat gslib::glsl_math::quat::operator/ value_type  v  )  const [inline]
 

Reimplemented from gslib::glsl_math::tuple_mixin< quat, 4 >.

Definition at line 784 of file glsl_math.h.

00784                                                    {
00785                 return TupleMixin::operator / ( v );
00786             }

quat& gslib::glsl_math::quat::operator/= value_type  v  )  [inline]
 

Reimplemented from gslib::glsl_math::tuple_mixin< quat, 4 >.

Definition at line 781 of file glsl_math.h.

00781                                                {
00782                 return TupleMixin::operator /= ( v );
00783             }

const vec2& gslib::glsl_math::quat::xy  )  const [inline]
 

swizzle

Definition at line 770 of file glsl_math.h.

00770                                    {
00771                 return *reinterpret_cast< const vec2* >( array );
00772             }

vec2& gslib::glsl_math::quat::xy  )  [inline]
 

swizzle

Definition at line 765 of file glsl_math.h.

00765                        {
00766                 return *reinterpret_cast< vec2* >( array );
00767             }

const vec3& gslib::glsl_math::quat::xyz  )  const [inline]
 

swizzle

Definition at line 760 of file glsl_math.h.

00760                                     {
00761                 return *reinterpret_cast< const vec3* >( array );
00762             }

vec3& gslib::glsl_math::quat::xyz  )  [inline]
 

swizzle

Definition at line 755 of file glsl_math.h.

Referenced by quat().

00755                         {
00756                 return *reinterpret_cast< vec3* >( array );
00757             }

const vec4& gslib::glsl_math::quat::xyzw  )  const [inline]
 

swizzle ( cast to vec4 )

Definition at line 750 of file glsl_math.h.

00750                                      {
00751                 return *reinterpret_cast< const vec4* >( array );
00752             }

vec4& gslib::glsl_math::quat::xyzw  )  [inline]
 

swizzle ( cast to vec4 )

Definition at line 745 of file glsl_math.h.

00745                          {
00746                 return *reinterpret_cast< vec4* >( array );
00747             }


Member Data Documentation

float gslib::glsl_math::quat::array[ 4 ]
 

Definition at line 732 of file glsl_math.h.

float gslib::glsl_math::quat::w
 

Definition at line 730 of file glsl_math.h.

Referenced by operator *().

float gslib::glsl_math::quat::x
 

Definition at line 730 of file glsl_math.h.

Referenced by operator *().

float gslib::glsl_math::quat::y
 

Definition at line 730 of file glsl_math.h.

Referenced by operator *().

float gslib::glsl_math::quat::z
 

Definition at line 730 of file glsl_math.h.

Referenced by operator *().


The documentation for this struct was generated from the following file:
Generated on Fri Dec 24 00:52:35 2004 for glsl_math by doxygen 1.3.6