LLQuaternion Class Reference

#include <llquaternion.h>

Collaboration diagram for LLQuaternion:

Collaboration graph
[legend]

List of all members.

Public Types

enum  Order {
  XYZ = 0, YZX = 1, ZXY = 2, XZY = 3,
  YXZ = 4, ZYX = 5
}

Public Member Functions

 LLQuaternion ()
 LLQuaternion (const LLMatrix4 &mat)
 LLQuaternion (const LLMatrix3 &mat)
 LLQuaternion (F32 x, F32 y, F32 z, F32 w)
 LLQuaternion (F32 angle, const LLVector4 &vec)
 LLQuaternion (F32 angle, const LLVector3 &vec)
 LLQuaternion (const F32 *q)
 LLQuaternion (const LLVector3 &x_axis, const LLVector3 &y_axis, const LLVector3 &z_axis)
BOOL isIdentity () const
BOOL isNotIdentity () const
BOOL isFinite () const
void quantize16 (F32 lower, F32 upper)
void quantize8 (F32 lower, F32 upper)
void loadIdentity ()
const LLQuaternionset (F32 x, F32 y, F32 z, F32 w)
const LLQuaternionset (const LLQuaternion &quat)
const LLQuaternionset (const F32 *q)
const LLQuaternionset (const LLMatrix3 &mat)
const LLQuaternionset (const LLMatrix4 &mat)
const LLQuaternionsetAngleAxis (F32 angle, F32 x, F32 y, F32 z)
const LLQuaternionsetAngleAxis (F32 angle, const LLVector3 &vec)
const LLQuaternionsetAngleAxis (F32 angle, const LLVector4 &vec)
const LLQuaternionsetEulerAngles (F32 roll, F32 pitch, F32 yaw)
const LLQuaternionsetQuatInit (F32 x, F32 y, F32 z, F32 w)
const LLQuaternionsetQuat (const LLQuaternion &quat)
const LLQuaternionsetQuat (const F32 *q)
const LLQuaternionsetQuat (const LLMatrix3 &mat)
const LLQuaternionsetQuat (const LLMatrix4 &mat)
const LLQuaternionsetQuat (F32 angle, F32 x, F32 y, F32 z)
const LLQuaternionsetQuat (F32 angle, const LLVector3 &vec)
const LLQuaternionsetQuat (F32 angle, const LLVector4 &vec)
const LLQuaternionsetQuat (F32 roll, F32 pitch, F32 yaw)
LLMatrix4 getMatrix4 (void) const
LLMatrix3 getMatrix3 (void) const
void getAngleAxis (F32 *angle, F32 *x, F32 *y, F32 *z) const
void getAngleAxis (F32 *angle, LLVector3 &vec) const
void getEulerAngles (F32 *roll, F32 *pitch, F32 *yaw) const
F32 normalize ()
F32 normQuat ()
const LLQuaternionconjugate (void)
const LLQuaternionconjQuat (void)
const LLQuaterniontranspose ()
const LLQuaterniontransQuat ()
void shortestArc (const LLVector3 &a, const LLVector3 &b)
const LLQuaternionconstrain (F32 radians)
bool operator== (const LLQuaternion &b) const
bool operator!= (const LLQuaternion &b) const
LLVector3 packToVector3 () const
void unpackFromVector3 (const LLVector3 &vec)

Static Public Member Functions

static BOOL parseQuat (const char *buf, LLQuaternion *value)

Public Attributes

F32 mQ [LENGTHOFQUAT]

Static Public Attributes

static const LLQuaternion DEFAULT

Friends

std::ostream & operator<< (std::ostream &s, const LLQuaternion &a)
LLQuaternion operator+ (const LLQuaternion &a, const LLQuaternion &b)
LLQuaternion operator- (const LLQuaternion &a, const LLQuaternion &b)
LLQuaternion operator- (const LLQuaternion &a)
LLQuaternion operator* (F32 a, const LLQuaternion &q)
LLQuaternion operator* (const LLQuaternion &q, F32 b)
LLQuaternion operator* (const LLQuaternion &a, const LLQuaternion &b)
LLQuaternion operator~ (const LLQuaternion &a)
const LLQuaternionoperator*= (LLQuaternion &a, const LLQuaternion &b)
LLVector4 operator* (const LLVector4 &a, const LLQuaternion &rot)
LLVector3 operator* (const LLVector3 &a, const LLQuaternion &rot)
LLVector3d operator* (const LLVector3d &a, const LLQuaternion &rot)
F32 dot (const LLQuaternion &a, const LLQuaternion &b)
LLQuaternion lerp (F32 t, const LLQuaternion &p, const LLQuaternion &q)
LLQuaternion lerp (F32 t, const LLQuaternion &q)
LLQuaternion slerp (F32 t, const LLQuaternion &p, const LLQuaternion &q)
LLQuaternion slerp (F32 t, const LLQuaternion &q)
LLQuaternion nlerp (F32 t, const LLQuaternion &p, const LLQuaternion &q)
LLQuaternion nlerp (F32 t, const LLQuaternion &q)
LLQuaternion mayaQ (F32 x, F32 y, F32 z, Order order)
const char * OrderToString (const Order order)
Order StringToOrder (const char *str)


Detailed Description

Definition at line 50 of file llquaternion.h.


Member Enumeration Documentation

Enumerator:
XYZ 
YZX 
ZXY 
XZY 
YXZ 
ZYX 

Definition at line 145 of file llquaternion.h.


Constructor & Destructor Documentation

LLQuaternion::LLQuaternion ( void   )  [inline]

Definition at line 193 of file llquaternion.h.

References mQ, VS, VX, VY, and VZ.

Referenced by operator*(), operator+(), and operator-().

Here is the caller graph for this function:

LLQuaternion::LLQuaternion ( const LLMatrix4 mat  )  [explicit]

Definition at line 51 of file llquaternion.cpp.

References normalize(), and LLMatrix4::quaternion().

Here is the call graph for this function:

LLQuaternion::LLQuaternion ( const LLMatrix3 mat  )  [explicit]

Definition at line 57 of file llquaternion.cpp.

References normalize(), and LLMatrix3::quaternion().

Here is the call graph for this function:

LLQuaternion::LLQuaternion ( F32  x,
F32  y,
F32  z,
F32  w 
) [inline]

Definition at line 201 of file llquaternion.h.

References mQ, VS, VX, VY, and VZ.

LLQuaternion::LLQuaternion ( F32  angle,
const LLVector4 vec 
)

Definition at line 63 of file llquaternion.cpp.

References cosf, mQ, LLVector3::mV, LLVector4::mV, normalize(), LLVector3::normalize(), sinf, VW, VX, VY, and VZ.

Here is the call graph for this function:

LLQuaternion::LLQuaternion ( F32  angle,
const LLVector3 vec 
)

Definition at line 79 of file llquaternion.cpp.

References cosf, mQ, LLVector3::mV, normalize(), LLVector3::normalize(), sinf, VW, VX, VY, and VZ.

Here is the call graph for this function:

LLQuaternion::LLQuaternion ( const F32 q  )  [inline]

Definition at line 218 of file llquaternion.h.

References mQ, normalize(), VS, VW, VX, VY, and VZ.

Here is the call graph for this function:

LLQuaternion::LLQuaternion ( const LLVector3 x_axis,
const LLVector3 y_axis,
const LLVector3 z_axis 
)

Definition at line 95 of file llquaternion.cpp.

References normalize(), LLMatrix3::quaternion(), and LLMatrix3::setRows().

Here is the call graph for this function:


Member Function Documentation

BOOL LLQuaternion::isIdentity (  )  const [inline]

Definition at line 173 of file llquaternion.h.

References mQ, VS, VX, VY, and VZ.

Referenced by run_jumpif(), and run_jumpnif().

Here is the caller graph for this function:

BOOL LLQuaternion::isNotIdentity (  )  const [inline]

Definition at line 182 of file llquaternion.h.

References mQ, VS, VX, VY, and VZ.

BOOL LLQuaternion::isFinite (  )  const [inline]

Definition at line 168 of file llquaternion.h.

References llfinite, mQ, VS, VX, VY, and VZ.

Referenced by LLEditingMotion::onUpdate(), LLXform::setRotation(), and LLJoint::setRotation().

Here is the caller graph for this function:

void LLQuaternion::quantize16 ( F32  lower,
F32  upper 
)

Definition at line 106 of file llquaternion.cpp.

References F32_to_U16_ROUND(), mQ, normQuat(), U16_to_F32(), VS, VX, VY, and VZ.

Here is the call graph for this function:

void LLQuaternion::quantize8 ( F32  lower,
F32  upper 
)

Definition at line 126 of file llquaternion.cpp.

References F32_to_U8_ROUND(), mQ, normQuat(), U8_to_F32(), VS, VX, VY, and VZ.

Here is the call graph for this function:

void LLQuaternion::loadIdentity (  )  [inline]

const LLQuaternion & LLQuaternion::set ( F32  x,
F32  y,
F32  z,
F32  w 
) [inline]

Definition at line 244 of file llquaternion.h.

References mQ, normalize(), VS, VX, VY, and VZ.

Referenced by parseQuat().

Here is the call graph for this function:

Here is the caller graph for this function:

const LLQuaternion & LLQuaternion::set ( const LLQuaternion quat  )  [inline]

Definition at line 254 of file llquaternion.h.

References mQ, normalize(), VW, VX, VY, and VZ.

Here is the call graph for this function:

const LLQuaternion & LLQuaternion::set ( const F32 q  )  [inline]

Definition at line 264 of file llquaternion.h.

References mQ, normalize(), VS, VW, VX, VY, and VZ.

Here is the call graph for this function:

const LLQuaternion & LLQuaternion::set ( const LLMatrix3 mat  ) 

Definition at line 208 of file llquaternion.cpp.

References normalize(), and LLMatrix3::quaternion().

Here is the call graph for this function:

const LLQuaternion & LLQuaternion::set ( const LLMatrix4 mat  ) 

Definition at line 216 of file llquaternion.cpp.

References normalize(), and LLMatrix4::quaternion().

Here is the call graph for this function:

const LLQuaternion & LLQuaternion::setAngleAxis ( F32  angle,
F32  x,
F32  y,
F32  z 
)

Definition at line 141 of file llquaternion.cpp.

References cosf, mQ, LLVector3::mV, normalize(), LLVector3::normalize(), sinf, VW, VX, VY, and VZ.

Referenced by shortestArc().

Here is the call graph for this function:

Here is the caller graph for this function:

const LLQuaternion & LLQuaternion::setAngleAxis ( F32  angle,
const LLVector3 vec 
)

Definition at line 160 of file llquaternion.cpp.

References cosf, mQ, LLVector3::mV, normalize(), LLVector3::normalize(), sinf, VW, VX, VY, and VZ.

Here is the call graph for this function:

const LLQuaternion & LLQuaternion::setAngleAxis ( F32  angle,
const LLVector4 vec 
)

Definition at line 179 of file llquaternion.cpp.

References cosf, mQ, LLVector3::mV, LLVector4::mV, normalize(), LLVector3::normalize(), sinf, VW, VX, VY, and VZ.

Here is the call graph for this function:

const LLQuaternion & LLQuaternion::setEulerAngles ( F32  roll,
F32  pitch,
F32  yaw 
)

Definition at line 197 of file llquaternion.cpp.

References normalize(), LLMatrix3::orthogonalize(), and LLMatrix3::quaternion().

Here is the call graph for this function:

const LLQuaternion & LLQuaternion::setQuatInit ( F32  x,
F32  y,
F32  z,
F32  w 
) [inline]

Definition at line 276 of file llquaternion.h.

References mQ, normalize(), VS, VX, VY, and VZ.

Here is the call graph for this function:

const LLQuaternion & LLQuaternion::setQuat ( const LLQuaternion quat  )  [inline]

const LLQuaternion & LLQuaternion::setQuat ( const F32 q  )  [inline]

Definition at line 298 of file llquaternion.h.

References mQ, normalize(), VS, VW, VX, VY, and VZ.

Here is the call graph for this function:

const LLQuaternion & LLQuaternion::setQuat ( const LLMatrix3 mat  ) 

Definition at line 291 of file llquaternion.cpp.

References normalize(), and LLMatrix3::quaternion().

Here is the call graph for this function:

const LLQuaternion & LLQuaternion::setQuat ( const LLMatrix4 mat  ) 

Definition at line 298 of file llquaternion.cpp.

References normalize(), and LLMatrix4::quaternion().

Here is the call graph for this function:

const LLQuaternion & LLQuaternion::setQuat ( F32  angle,
F32  x,
F32  y,
F32  z 
)

Definition at line 224 of file llquaternion.cpp.

References cosf, mQ, LLVector3::mV, normalize(), LLVector3::normalize(), sinf, VW, VX, VY, and VZ.

Here is the call graph for this function:

const LLQuaternion & LLQuaternion::setQuat ( F32  angle,
const LLVector3 vec 
)

Definition at line 244 of file llquaternion.cpp.

References cosf, mQ, LLVector3::mV, normalize(), LLVector3::normalize(), sinf, VW, VX, VY, and VZ.

Here is the call graph for this function:

const LLQuaternion & LLQuaternion::setQuat ( F32  angle,
const LLVector4 vec 
)

Definition at line 263 of file llquaternion.cpp.

References cosf, mQ, LLVector3::mV, LLVector4::mV, normalize(), LLVector3::normalize(), sinf, VW, VX, VY, and VZ.

Here is the call graph for this function:

const LLQuaternion & LLQuaternion::setQuat ( F32  roll,
F32  pitch,
F32  yaw 
)

Definition at line 281 of file llquaternion.cpp.

References normalize(), LLMatrix3::orthogonalize(), and LLMatrix3::quaternion().

Here is the call graph for this function:

LLMatrix4 LLQuaternion::getMatrix4 ( void   )  const

Definition at line 389 of file llquaternion.cpp.

References LLMatrix4::mMatrix, mQ, VW, VX, VY, and VZ.

LLMatrix3 LLQuaternion::getMatrix3 ( void   )  const

Definition at line 357 of file llquaternion.cpp.

References LLMatrix3::mMatrix, mQ, VW, VX, VY, and VZ.

Referenced by LLMatrix3::setRot(), and LLVOAvatar::updateCharacter().

Here is the caller graph for this function:

void LLQuaternion::getAngleAxis ( F32 angle,
F32 x,
F32 y,
F32 z 
) const [inline]

void LLQuaternion::getAngleAxis ( F32 angle,
LLVector3 vec 
) const

Definition at line 843 of file llquaternion.cpp.

References F_PI, mQ, LLVector3::mV, VW, VX, VY, and VZ.

void LLQuaternion::getEulerAngles ( F32 roll,
F32 pitch,
F32 yaw 
) const

Definition at line 882 of file llquaternion.cpp.

References LLMatrix3::getEulerAngles(), and LLMatrix3::orthogonalize().

Referenced by LLPanelObject::getState(), LLEyeMotion::onUpdate(), LLManipRotate::render(), and LLVOAvatar::updateCharacter().

Here is the call graph for this function:

Here is the caller graph for this function:

F32 LLQuaternion::normalize (  )  [inline]

Definition at line 471 of file llquaternion.h.

References FP_MAG_THRESHOLD, mQ, sqrtf, VS, VX, VY, and VZ.

Referenced by lerp(), LLQuaternion(), set(), setAngleAxis(), setEulerAngles(), setQuat(), and setQuatInit().

Here is the caller graph for this function:

F32 LLQuaternion::normQuat (  )  [inline]

Definition at line 495 of file llquaternion.h.

References FP_MAG_THRESHOLD, mQ, sqrtf, VS, VX, VY, and VZ.

Referenced by LLKeyframeStandMotion::onUpdate(), LLViewerObject::processUpdateMessage(), quantize16(), and quantize8().

Here is the caller graph for this function:

const LLQuaternion & LLQuaternion::conjugate ( void   )  [inline]

Definition at line 348 of file llquaternion.h.

References mQ, VX, VY, and VZ.

const LLQuaternion & LLQuaternion::conjQuat ( void   )  [inline]

Definition at line 356 of file llquaternion.h.

References mQ, VX, VY, and VZ.

Referenced by operator~(), quaternion_quaternion_operation(), ray_box(), LLManipTranslate::renderTranslationHandles(), and LLToolGrab::startGrab().

Here is the caller graph for this function:

const LLQuaternion & LLQuaternion::transpose (  )  [inline]

Definition at line 365 of file llquaternion.h.

References mQ, VX, VY, and VZ.

const LLQuaternion & LLQuaternion::transQuat (  )  [inline]

void LLQuaternion::shortestArc ( const LLVector3 a,
const LLVector3 b 
)

const LLQuaternion & LLQuaternion::constrain ( F32  radians  ) 

Definition at line 497 of file llquaternion.cpp.

References cosf, mQ, sinf, sqrtf, VW, VX, VY, and VZ.

Referenced by LLTargetingMotion::onUpdate(), LLEyeMotion::onUpdate(), and LLHeadRotMotion::onUpdate().

Here is the caller graph for this function:

bool LLQuaternion::operator== ( const LLQuaternion b  )  const [inline]

Definition at line 439 of file llquaternion.h.

References mQ, VS, VX, VY, and VZ.

bool LLQuaternion::operator!= ( const LLQuaternion b  )  const [inline]

Definition at line 447 of file llquaternion.h.

References mQ, VS, VX, VY, and VZ.

LLVector3 LLQuaternion::packToVector3 (  )  const

Definition at line 909 of file llquaternion.cpp.

References mQ, VW, VX, VY, and VZ.

Referenced by LLTemplateMessageBuilder::addQuat(), LLSelectMgr::packMultipleUpdate(), LLKeyframeMotion::serialize(), and LLBVHLoader::serialize().

Here is the caller graph for this function:

void LLQuaternion::unpackFromVector3 ( const LLVector3 vec  ) 

Definition at line 922 of file llquaternion.cpp.

References LLVector3::magVecSquared(), mQ, LLVector3::mV, VW, VX, VY, and VZ.

Referenced by LLKeyframeMotion::deserialize(), LLTemplateMessageReader::getQuat(), and LLViewerObject::processUpdateMessage().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLQuaternion::parseQuat ( const char *  buf,
LLQuaternion value 
) [static]

Definition at line 940 of file llquaternion.cpp.

References FALSE, mQ, NULL, S32, set(), and TRUE.

Referenced by LLXmlTreeNode::getFastAttributeQuat().

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const LLQuaternion a 
) [friend]

Definition at line 526 of file llquaternion.cpp.

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

Definition at line 383 of file llquaternion.h.

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

Definition at line 393 of file llquaternion.h.

LLQuaternion operator- ( const LLQuaternion a  )  [friend]

Definition at line 403 of file llquaternion.h.

LLQuaternion operator* ( F32  a,
const LLQuaternion q 
) [friend]

Definition at line 413 of file llquaternion.h.

LLQuaternion operator* ( const LLQuaternion q,
F32  b 
) [friend]

Definition at line 423 of file llquaternion.h.

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

Definition at line 536 of file llquaternion.cpp.

LLQuaternion operator~ ( const LLQuaternion a  )  [friend]

Definition at line 432 of file llquaternion.h.

const LLQuaternion& operator*= ( LLQuaternion a,
const LLQuaternion b 
) [friend]

Definition at line 455 of file llquaternion.h.

LLVector4 operator* ( const LLVector4 a,
const LLQuaternion rot 
) [friend]

Definition at line 559 of file llquaternion.cpp.

LLVector3 operator* ( const LLVector3 a,
const LLQuaternion rot 
) [friend]

Definition at line 573 of file llquaternion.cpp.

LLVector3d operator* ( const LLVector3d a,
const LLQuaternion rot 
) [friend]

Definition at line 587 of file llquaternion.cpp.

F32 dot ( const LLQuaternion a,
const LLQuaternion b 
) [friend]

Definition at line 601 of file llquaternion.cpp.

Referenced by nlerp().

LLQuaternion lerp ( F32  t,
const LLQuaternion p,
const LLQuaternion q 
) [friend]

Definition at line 634 of file llquaternion.cpp.

Referenced by nlerp().

LLQuaternion lerp ( F32  t,
const LLQuaternion q 
) [friend]

Definition at line 623 of file llquaternion.cpp.

LLQuaternion slerp ( F32  t,
const LLQuaternion p,
const LLQuaternion q 
) [friend]

Definition at line 651 of file llquaternion.cpp.

Referenced by nlerp().

LLQuaternion slerp ( F32  t,
const LLQuaternion q 
) [friend]

Definition at line 722 of file llquaternion.cpp.

LLQuaternion nlerp ( F32  t,
const LLQuaternion p,
const LLQuaternion q 
) [friend]

Definition at line 697 of file llquaternion.cpp.

LLQuaternion nlerp ( F32  t,
const LLQuaternion q 
) [friend]

Definition at line 709 of file llquaternion.cpp.

LLQuaternion mayaQ ( F32  x,
F32  y,
F32  z,
LLQuaternion::Order  order 
) [friend]

Definition at line 762 of file llquaternion.cpp.

const char* OrderToString ( const Order  order  )  [friend]

Definition at line 792 of file llquaternion.cpp.

Order StringToOrder ( const char *  str  )  [friend]

Definition at line 820 of file llquaternion.cpp.


Member Data Documentation


The documentation for this class was generated from the following files:

Generated on Fri May 16 09:01:08 2008 for SecondLife by  doxygen 1.5.5