LLQuaternion Class Reference

#include <llquaternion.h>

Collaboration diagram for LLQuaternion:

Collaboration graph
[legend]
List of all members.

Public Types

 XYZ = 0
 YZX = 1
 ZXY = 2
 XZY = 3
 YXZ = 4
 ZYX = 5
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 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 normQuat ()
const LLQuaternionconjQuat (void)
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

enum LLQuaternion::Order

Enumerator:
XYZ 
YZX 
ZXY 
XZY 
YXZ 
ZYX 

Definition at line 128 of file llquaternion.h.


Constructor & Destructor Documentation

LLQuaternion::LLQuaternion (  )  [inline]

Definition at line 176 of file llquaternion.h.

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

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

Definition at line 51 of file llquaternion.cpp.

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

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

Definition at line 57 of file llquaternion.cpp.

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

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

Definition at line 184 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 c, cosf, f, mQ, LLVector4::mV, normQuat(), s, sinf, v, VW, VX, VY, and VZ.

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

Definition at line 79 of file llquaternion.cpp.

References c, cosf, f, mQ, normQuat(), s, sinf, v, VW, VX, VY, and VZ.

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

Definition at line 201 of file llquaternion.h.

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

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

Definition at line 95 of file llquaternion.cpp.

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


Member Function Documentation

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

Definition at line 279 of file llquaternion.h.

References mQ, VX, VY, and VZ.

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

const LLQuaternion & LLQuaternion::constrain ( F32  radians  ) 

Definition at line 399 of file llquaternion.cpp.

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

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

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

Definition at line 759 of file llquaternion.cpp.

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

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

Definition at line 260 of file llquaternion.h.

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

Referenced by LLVolumeImplFlexible::doFlexibleUpdate(), LLManipTranslate::highlightIntersection(), hud_render_text(), LLManipScale::render(), LLManipRotate::render(), LLManip::renderGuidelines(), LLManipTranslate::renderSnapGuides(), LLManipRotate::renderSnapGuides(), LLManipTranslate::renderTranslationHandles(), LLDrawPoolTree::renderTree(), rotate_quat(), LLFollowCam::updateBehindnessConstraint(), and LLViewerCamera::updateCameraLocation().

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

Definition at line 780 of file llquaternion.cpp.

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

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

LLMatrix3 LLQuaternion::getMatrix3 ( void   )  const

Definition at line 259 of file llquaternion.cpp.

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

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

LLMatrix4 LLQuaternion::getMatrix4 ( void   )  const

Definition at line 291 of file llquaternion.cpp.

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

BOOL LLQuaternion::isFinite (  )  const [inline]

Definition at line 151 of file llquaternion.h.

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

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

BOOL LLQuaternion::isIdentity (  )  const [inline]

Definition at line 156 of file llquaternion.h.

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

Referenced by run_jumpif(), and run_jumpnif().

BOOL LLQuaternion::isNotIdentity (  )  const [inline]

Definition at line 165 of file llquaternion.h.

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

void LLQuaternion::loadIdentity (  )  [inline]

Definition at line 218 of file llquaternion.h.

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

Referenced by LLSelectMgr::getGrid(), LLTemplateMessageReader::getQuat(), LLXform::init(), LLPrimitive::LLPrimitive(), LLKeyframeStandMotion::onActivate(), LLHeadRotMotion::onInitialize(), LLEyeMotion::onUpdate(), LLPath::PathPt::PathPt(), LLBVHLoader::serialize(), LLXform::setRotation(), and shortestArc().

F32 LLQuaternion::normQuat (  )  [inline]

Definition at line 385 of file llquaternion.h.

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

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

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

Definition at line 361 of file llquaternion.h.

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

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

Definition at line 353 of file llquaternion.h.

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

LLVector3 LLQuaternion::packToVector3 (  )  const

Definition at line 807 of file llquaternion.cpp.

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

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

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

Definition at line 838 of file llquaternion.cpp.

References count, FALSE, mQ, NULL, S32, setQuat(), and TRUE.

Referenced by LLXmlTreeNode::getFastAttributeQuat().

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

Definition at line 106 of file llquaternion.cpp.

References F32_to_U16_ROUND(), mQ, normQuat(), s, U16_to_F32(), VS, VX, VY, VZ, x, y, and z.

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.

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

Definition at line 197 of file llquaternion.cpp.

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

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

Definition at line 179 of file llquaternion.cpp.

References c, cosf, f, mQ, LLVector4::mV, normQuat(), s, sinf, v, VW, VX, VY, and VZ.

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

Definition at line 160 of file llquaternion.cpp.

References c, cosf, mQ, normQuat(), s, sinf, v, VW, VX, VY, and VZ.

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

Definition at line 141 of file llquaternion.cpp.

References c, cosf, mQ, LLVector3::mV, normQuat(), LLVector3::normVec(), s, sinf, VW, VX, VY, and VZ.

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

Definition at line 752 of file llquaternion.cpp.

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

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

Definition at line 745 of file llquaternion.cpp.

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

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

Definition at line 247 of file llquaternion.h.

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

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

Definition at line 237 of file llquaternion.h.

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

Referenced by add_object(), LLVOVolume::animateTextures(), LLViewerObject::applyAngularVelocity(), LLVolumeImplFlexible::doFlexibleUpdate(), LLPath::genNGon(), LLViewerObject::idleUpdate(), LLVOAvatar::loadSkeletonNode(), LLViewerWindow::mouseDirectionCamera(), LLBodyNoiseMotion::onUpdate(), LLEyeMotion::onUpdate(), parseQuat(), LLMatrix4::quaternion(), LLMatrix3::quaternion(), LLPanelObject::sendRotation(), LLVolumeImplFlexible::setAttributesOfAllSections(), LLXform::setRotation(), shortestArc(), LLJointSolverRP3::solve(), and LLViewerPartSourceScript::update().

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

Definition at line 227 of file llquaternion.h.

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

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

Definition at line 332 of file llquaternion.cpp.

References a, b, f, F_APPROXIMATELY_ZERO, loadIdentity(), mQ, LLVector3::mV, LLVector3::normVec(), setQuat(), LLVector3::setVec(), VW, VX, VY, and VZ.

Referenced by LLKeyframeMotion::applyConstraint(), LLVolumeImplFlexible::doFlexibleUpdate(), LLManipRotate::renderSnapGuides(), LLBVHLoader::serialize(), LLJointSolverRP3::solve(), LLFollowCam::updateBehindnessConstraint(), and LLViewerCamera::updateCameraLocation().

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

Definition at line 288 of file llquaternion.h.

References mQ, VX, VY, and VZ.

Referenced by LLKeyframeFallMotion::onActivate(), LLEyeMotion::onUpdate(), LLViewerObject::setPositionEdit(), and LLViewerObject::setPositionGlobal().

void LLQuaternion::unpackFromVector3 ( const LLVector3 vec  ) 

Definition at line 820 of file llquaternion.cpp.

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

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


Friends And Related Function Documentation

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

Definition at line 503 of file llquaternion.cpp.

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

Definition at line 525 of file llquaternion.cpp.

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

Definition at line 536 of file llquaternion.cpp.

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

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

Definition at line 611 of file llquaternion.cpp.

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

Definition at line 599 of file llquaternion.cpp.

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

Definition at line 489 of file llquaternion.cpp.

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

Definition at line 475 of file llquaternion.cpp.

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

Definition at line 461 of file llquaternion.cpp.

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

Definition at line 438 of file llquaternion.cpp.

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

Definition at line 337 of file llquaternion.h.

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

Definition at line 327 of file llquaternion.h.

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

Definition at line 369 of file llquaternion.h.

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

Definition at line 297 of file llquaternion.h.

LLQuaternion operator- ( const LLQuaternion a  )  [friend]

Definition at line 317 of file llquaternion.h.

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

Definition at line 307 of file llquaternion.h.

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

Definition at line 428 of file llquaternion.cpp.

LLQuaternion operator~ ( const LLQuaternion a  )  [friend]

Definition at line 346 of file llquaternion.h.

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

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

Definition at line 624 of file llquaternion.cpp.

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

Definition at line 553 of file llquaternion.cpp.

Order StringToOrder ( const char *  str  )  [friend]

Definition at line 722 of file llquaternion.cpp.


Member Data Documentation

const LLQuaternion LLQuaternion::DEFAULT [static]

Definition at line 55 of file llquaternion.h.

Referenced by LLHUDEffectLookAt::calcTargetPosition(), LLManipRotate::dragConstrained(), LLManipRotate::dragUnconstrained(), LLAgent::getHeadRotation(), LLVOAvatar::getOffObject(), LLKeyframeMotion::RotationCurve::getValue(), LLManipTranslate::highlightManipulators(), LLManipScale::highlightManipulators(), LLFollowCam::LLFollowCam(), LLFlyAdjustMotion::onActivate(), LLEyeMotion::onDeactivate(), LLEyeMotion::onUpdate(), LLHeadRotMotion::onUpdate(), LLEditingMotion::onUpdate(), run_cast(), and LLFollowCam::updateBehindnessConstraint().

F32 LLQuaternion::mQ[LENGTHOFQUAT]

Definition at line 53 of file llquaternion.h.

Referenced by bytestream2quaternion(), conjQuat(), constrain(), getAngleAxis(), LLXMLNode::getAttributeQuat(), getMatrix3(), getMatrix4(), LLMatrix4::initAll(), isFinite(), isIdentity(), isNotIdentity(), lerp(), ll_quaternion_from_sd(), ll_sd_from_quaternion(), LLQuaternion(), loadIdentity(), lsa_fprint_heap(), lsa_print_heap(), nlerp(), normQuat(), operator *(), operator *=(), operator!=(), operator==(), packToVector3(), parseQuat(), LLScriptLibData::print(), print_pushargq(), LLScriptLibData::print_separator(), LLScriptLSOParse::printGlobals(), LLViewerObject::processUpdateMessage(), quantize16(), quantize8(), LLMatrix4::quaternion(), LLMatrix3::quaternion(), quaternion2bytestream(), run_cast(), run_print(), run_pushargq(), setQuat(), setQuatInit(), LLXform::setRotation(), shortestArc(), slerp(), transQuat(), unpackFromVector3(), LLViewerJoint::writeCAL3D(), and LLKeyframeMotion::writeCAL3D().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:40 2010 for Second Life Viewer by  doxygen 1.4.7