Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

base::Quat4 Class Reference

Collaboration diagram for base::Quat4:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Quat4 ()
 Quat4 (const Quat4 &q)
 Quat4 (const Vector3 &v)
 Quat4 (const Vector4 &v)
 Quat4 (const Real &s)
 Quat4 (Real x, Real y, Real z, Real w)
 Quat4 (const Vector3 &axis, Real angle)
 ~Quat4 ()
void setIdentity () throw ()
void setZero () throw ()
Reale (Int i) throw ()
const Reale (Int i) const throw ()
Realat (Int i) throw (std::out_of_range)
const Realat (Int i) const throw (std::out_of_range)
Realoperator[] (Int i)
const Realoperator[] (Int i) const
Quat4operator= (const Quat4 &src) throw ()
bool operator== (const Quat4 &q) const throw ()
bool equals (const Quat4 &q) const throw ()
Real norm () const throw ()
Quat4normalize () throw ()
Quat4conjugate ()
Quat4invert () throw ()
Quat4operator *= (const Quat4 &qr)
Quat4operator *= (Real s)
Quat4operator/= (Real s)
Quat4operator+= (const Quat4 &q)
Quat4operator-= (const Quat4 &q)
Quat4negate () throw ()
void setRotation (const Matrix4 &rotation)
 Generate quat corresponding to rotation component of matrix.

void setRotation (const Vector3 &axis, Real angle)
void getRotation (Vector3 &axis, Real &angle) const
void rotatePoint (Point4 &p) const
void rotatePoint (Point3 &p) const
Point3 rotate (const Point3 &p) const
Point4 rotate (const Point4 &p) const
 operator Matrix4 () const
 convert to corresponding rotation matrix

Realc_array ()
void serialize (Serializer &s)
 read or write object state to Serializer


Static Public Member Functions

Quat4 interpolate (const Quat4 &from, const Quat4 &to, Real t)
 interpolate between from-to an amount t:[0..1] using SLERP

Real angleBetween (const Quat4 &q1, const Quat4 &q2)
 angle seperating the orientations q1 & q2


Public Attributes

Vector3 v
Real w

Static Public Attributes

const Int X = 1
const Int Y = 2
const Int Z = 3
const Int W = 4

Friends

std::ostream & operator<< (std::ostream &, const Quat4 &)

Detailed Description

Quaternion. Used for representing rotations.

Definition at line 51 of file Quat4.


Constructor & Destructor Documentation

base::Quat4::Quat4  )  [inline]
 

Definition at line 55 of file Quat4.

References setIdentity().

base::Quat4::Quat4 const Quat4 q  )  [inline]
 

Definition at line 56 of file Quat4.

References operator=().

base::Quat4::Quat4 const Vector3 v  )  [inline]
 

Definition at line 57 of file Quat4.

References base::Real, and w.

base::Quat4::Quat4 const Vector4 v  )  [inline]
 

Definition at line 58 of file Quat4.

References w.

base::Quat4::Quat4 const Real s  )  [inline, explicit]
 

Definition at line 59 of file Quat4.

References base::Real, and w.

base::Quat4::Quat4 Real  x,
Real  y,
Real  z,
Real  w
[inline]
 

Definition at line 60 of file Quat4.

References base::Real.

base::Quat4::Quat4 const Vector3 axis,
Real  angle
[inline]
 

Definition at line 61 of file Quat4.

References base::Real, and setRotation().

base::Quat4::~Quat4  )  [inline]
 

Definition at line 62 of file Quat4.


Member Function Documentation

Real base::Quat4::angleBetween const Quat4 q1,
const Quat4 q2
[static]
 

angle seperating the orientations q1 & q2

const Real& base::Quat4::at Int  i  )  const throw (std::out_of_range) [inline]
 

Definition at line 106 of file Quat4.

References base::Vector3::e(), Exception, base::Int, base::Real, and w.

Real& base::Quat4::at Int  i  )  throw (std::out_of_range) [inline]
 

Definition at line 98 of file Quat4.

References base::Vector3::e(), Exception, base::Int, base::Real, and w.

Real* base::Quat4::c_array  )  [inline]
 

Definition at line 198 of file Quat4.

References base::Real, and base::Vector3::x.

Quat4& base::Quat4::conjugate  )  [inline]
 

Definition at line 157 of file Quat4.

References base::Vector3::negate().

Referenced by base::conjugate(), and invert().

const Real& base::Quat4::e Int  i  )  const throw () [inline]
 

Definition at line 89 of file Quat4.

References base::Vector3::e(), Exception, base::Int, base::Real, and w.

Real& base::Quat4::e Int  i  )  throw () [inline]
 

Definition at line 80 of file Quat4.

References base::Vector3::e(), Exception, base::Int, base::Real, and w.

Referenced by operator[]().

bool base::Quat4::equals const Quat4 q  )  const throw () [inline]
 

Definition at line 135 of file Quat4.

References base::equals(), base::Vector3::equals(), and w.

void base::Quat4::getRotation Vector3 axis,
Real angle
const
 

Quat4 base::Quat4::interpolate const Quat4 from,
const Quat4 to,
Real  t
[static]
 

interpolate between from-to an amount t:[0..1] using SLERP

Quat4& base::Quat4::invert  )  throw () [inline]
 

Definition at line 159 of file Quat4.

References conjugate(), base::equals(), norm(), and base::Real.

Referenced by base::inverse().

Quat4& base::Quat4::negate  )  throw () [inline]
 

Definition at line 178 of file Quat4.

References base::Vector3::negate(), and w.

Referenced by base::operator-().

Real base::Quat4::norm  )  const throw () [inline]
 

Definition at line 142 of file Quat4.

References base::Real, w, base::Vector3::x, base::Vector3::y, and base::Vector3::z.

Referenced by invert(), and normalize().

Quat4& base::Quat4::normalize  )  throw () [inline]
 

Definition at line 145 of file Quat4.

References base::equals(), norm(), base::Real, base::sqrt(), and w.

Quat4& base::Quat4::operator *= Real  s  )  [inline]
 

Definition at line 173 of file Quat4.

References base::Real, and w.

Quat4& base::Quat4::operator *= const Quat4 qr  ) 
 

base::Quat4::operator Matrix4  )  const
 

convert to corresponding rotation matrix

Quat4& base::Quat4::operator+= const Quat4 q  )  [inline]
 

Definition at line 175 of file Quat4.

References v, and w.

Quat4& base::Quat4::operator-= const Quat4 q  )  [inline]
 

Definition at line 176 of file Quat4.

References v, and w.

Quat4& base::Quat4::operator/= Real  s  )  [inline]
 

Definition at line 174 of file Quat4.

References base::Real, and w.

Quat4& base::Quat4::operator= const Quat4 src  )  throw () [inline]
 

Definition at line 120 of file Quat4.

References w.

Referenced by Quat4().

bool base::Quat4::operator== const Quat4 q  )  const throw () [inline]
 

Definition at line 128 of file Quat4.

References w.

const Real& base::Quat4::operator[] Int  i  )  const [inline]
 

Definition at line 117 of file Quat4.

References e(), base::Int, and base::Real.

Real& base::Quat4::operator[] Int  i  )  [inline]
 

Definition at line 114 of file Quat4.

References e(), base::Int, and base::Real.

Point4 base::Quat4::rotate const Point4 p  )  const [inline]
 

Definition at line 190 of file Quat4.

References base::Point4, and rotatePoint().

Point3 base::Quat4::rotate const Point3 p  )  const [inline]
 

Definition at line 188 of file Quat4.

References base::Point3, base::Point4, rotatePoint(), base::Vector4::x, base::Vector4::y, and base::Vector4::z.

Referenced by base::Orient::rotate().

void base::Quat4::rotatePoint Point3 p  )  const [inline]
 

Definition at line 186 of file Quat4.

References base::Point3, base::Point4, rotatePoint(), base::Vector4::w, base::Vector4::x, base::Vector4::y, and base::Vector4::z.

void base::Quat4::rotatePoint Point4 p  )  const
 

Referenced by rotate(), base::LineSegPathRep::rotate(), rotatePoint(), and base::Orient::rotatePoint().

void base::Quat4::serialize Serializer s  ) 
 

read or write object state to Serializer

Referenced by base::Serializer::operator()().

void base::Quat4::setIdentity  )  throw () [inline]
 

Definition at line 69 of file Quat4.

References base::Real, w, base::Vector3::x, base::Vector3::y, and base::Vector3::z.

Referenced by Quat4(), and setZero().

void base::Quat4::setRotation const Vector3 axis,
Real  angle
 

void base::Quat4::setRotation const Matrix4 rotation  ) 
 

Generate quat corresponding to rotation component of matrix.

Referenced by Quat4(), and base::LineSegPathRep::transform().

void base::Quat4::setZero  )  throw () [inline]
 

Definition at line 74 of file Quat4.

References base::Real, setIdentity(), and w.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  ,
const Quat4
[friend]
 


Member Data Documentation

Vector3 base::Quat4::v
 

Definition at line 202 of file Quat4.

Referenced by operator+=(), operator-=(), base::operator<<(), and base::Orient::operator=().

Real base::Quat4::w
 

Definition at line 203 of file Quat4.

Referenced by at(), e(), equals(), negate(), norm(), normalize(), operator *=(), operator+=(), operator-=(), operator/=(), base::operator<<(), operator=(), base::Orient::operator=(), operator==(), Quat4(), setIdentity(), and setZero().

const Int base::Quat4::W = 4 [static]
 

Definition at line 67 of file Quat4.

const Int base::Quat4::X = 1 [static]
 

Definition at line 64 of file Quat4.

const Int base::Quat4::Y = 2 [static]
 

Definition at line 65 of file Quat4.

const Int base::Quat4::Z = 3 [static]
 

Definition at line 66 of file Quat4.


The documentation for this class was generated from the following file:
Generated on Thu Jul 29 16:39:03 2004 for OpenSim by doxygen 1.3.6