LLJoint Class Reference

#include <lljoint.h>

Inheritance diagram for LLJoint:

Inheritance graph
[legend]
Collaboration diagram for LLJoint:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::list< LLJoint * > child_list_t
 USE_MOTION_PRIORITY = -1
 LOW_PRIORITY = 0
 MEDIUM_PRIORITY
 HIGH_PRIORITY
 HIGHER_PRIORITY
 HIGHEST_PRIORITY
 ADDITIVE_PRIORITY = LL_CHARACTER_MAX_PRIORITY
 MATRIX_DIRTY = 0x1 << 0
 ROTATION_DIRTY = 0x1 << 1
 POSITION_DIRTY = 0x1 << 2
 ALL_DIRTY = 0x7
enum  JointPriority {
  USE_MOTION_PRIORITY = -1, LOW_PRIORITY = 0, MEDIUM_PRIORITY, HIGH_PRIORITY,
  HIGHER_PRIORITY, HIGHEST_PRIORITY, ADDITIVE_PRIORITY = LL_CHARACTER_MAX_PRIORITY
}
enum  DirtyFlags { MATRIX_DIRTY = 0x1 << 0, ROTATION_DIRTY = 0x1 << 1, POSITION_DIRTY = 0x1 << 2, ALL_DIRTY = 0x7 }

Public Member Functions

 LLJoint ()
 LLJoint (const std::string &name, LLJoint *parent=NULL)
virtual ~LLJoint ()
void setup (const std::string &name, LLJoint *parent=NULL)
void touch (U32 flags=ALL_DIRTY)
const std::string & getName ()
void setName (const std::string &name)
LLJointgetParent ()
LLJointgetRoot ()
LLJointfindJoint (const std::string &name)
void addChild (LLJoint *joint)
void removeChild (LLJoint *joint)
void removeAllChildren ()
const LLVector3getPosition ()
void setPosition (const LLVector3 &pos)
LLVector3 getWorldPosition ()
LLVector3 getLastWorldPosition ()
void setWorldPosition (const LLVector3 &pos)
const LLQuaterniongetRotation ()
void setRotation (const LLQuaternion &rot)
LLQuaternion getWorldRotation ()
LLQuaternion getLastWorldRotation ()
void setWorldRotation (const LLQuaternion &rot)
const LLVector3getScale ()
void setScale (const LLVector3 &scale)
const LLMatrix4getWorldMatrix ()
void setWorldMatrix (const LLMatrix4 &mat)
void updateWorldMatrixChildren ()
void updateWorldMatrixParent ()
void updateWorldPRSParent ()
void updateWorldMatrix ()
const LLVector3getSkinOffset ()
void setSkinOffset (const LLVector3 &offset)
LLXformMatrixgetXform ()
void clampRotation (LLQuaternion old_rot, LLQuaternion new_rot)
virtual BOOL isAnimatable ()
S32 getJointNum ()
void setJointNum (S32 joint_num)

Public Attributes

U32 mDirtyFlags
BOOL mUpdateXform
LLVector3 mSkinOffset
S32 mJointNum
child_list_t mChildren

Static Public Attributes

static S32 sNumTouches = 0
static S32 sNumUpdates = 0

Protected Attributes

std::string mName
LLJointmParent
LLXformMatrix mXform

Detailed Description

Definition at line 58 of file lljoint.h.


Member Typedef Documentation

typedef std::list<LLJoint*> LLJoint::child_list_t

Definition at line 99 of file lljoint.h.


Member Enumeration Documentation

enum LLJoint::DirtyFlags

Enumerator:
MATRIX_DIRTY 
ROTATION_DIRTY 
POSITION_DIRTY 
ALL_DIRTY 

Definition at line 73 of file lljoint.h.

enum LLJoint::JointPriority

Enumerator:
USE_MOTION_PRIORITY 
LOW_PRIORITY 
MEDIUM_PRIORITY 
HIGH_PRIORITY 
HIGHER_PRIORITY 
HIGHEST_PRIORITY 
ADDITIVE_PRIORITY 

Definition at line 62 of file lljoint.h.


Constructor & Destructor Documentation

LLJoint::LLJoint (  ) 

Definition at line 48 of file lljoint.cpp.

References f, MATRIX_DIRTY, mDirtyFlags, mJointNum, mName, mParent, mUpdateXform, mXform, NULL, POSITION_DIRTY, ROTATION_DIRTY, LLXform::setScale(), LLXform::setScaleChildOffset(), touch(), and TRUE.

LLJoint::LLJoint ( const std::string &  name,
LLJoint parent = NULL 
)

Definition at line 65 of file lljoint.cpp.

References addChild(), f, MATRIX_DIRTY, mDirtyFlags, mJointNum, mName, mParent, mXform, NULL, POSITION_DIRTY, ROTATION_DIRTY, setName(), LLXform::setScale(), LLXform::setScaleChildOffset(), touch(), and TRUE.

LLJoint::~LLJoint (  )  [virtual]

Definition at line 86 of file lljoint.cpp.

References mParent, removeAllChildren(), and removeChild().


Member Function Documentation

void LLJoint::addChild ( LLJoint joint  ) 

Definition at line 172 of file lljoint.cpp.

References mChildren, mParent, mXform, removeChild(), LLXform::setParent(), and touch().

Referenced by LLEditingMotion::LLEditingMotion(), LLJoint(), LLKeyframeStandMotion::LLKeyframeStandMotion(), LLVOAvatar::loadSkeletonNode(), setup(), and LLVOAvatar::setupBone().

void LLJoint::clampRotation ( LLQuaternion  old_rot,
LLQuaternion  new_rot 
)

Definition at line 495 of file lljoint.cpp.

References f, mChildren, and LLVector3::normVec().

LLJoint * LLJoint::findJoint ( const std::string &  name  ) 

Definition at line 149 of file lljoint.cpp.

References findJoint(), getName(), mChildren, and NULL.

Referenced by LLVOAvatar::buildCharacter(), findJoint(), LLVOAvatar::getJoint(), LLCharacter::getJoint(), LLVOAvatar::loadSkeletonNode(), and LLViewerJointMesh::setMesh().

S32 LLJoint::getJointNum (  )  [inline]

Definition at line 178 of file lljoint.h.

References mJointNum.

Referenced by LLMotion::addJointState(), and LLKeyframeMotion::applyConstraint().

LLVector3 LLJoint::getLastWorldPosition (  ) 

Definition at line 252 of file lljoint.cpp.

References LLXform::getWorldPosition(), and mXform.

LLQuaternion LLJoint::getLastWorldRotation (  ) 

Definition at line 325 of file lljoint.cpp.

References LLXform::getWorldRotation(), and mXform.

const std::string& LLJoint::getName (  )  [inline]

Definition at line 118 of file lljoint.h.

References mName.

Referenced by LLPose::addJointState(), LLVOAvatar::buildCharacter(), LLKeyframeMotion::deserialize(), LLCharacter::dumpCharacter(), findJoint(), LLPose::findJointState(), LLPose::removeJointState(), LLKeyframeMotion::serialize(), and LLPolySkeletalDistortion::setInfo().

LLJoint* LLJoint::getParent (  )  [inline]

Definition at line 122 of file lljoint.h.

References mParent.

Referenced by LLKeyframeMotion::applyConstraint(), LLKeyframeMotion::deserialize(), LLCharacter::dumpCharacter(), getRoot(), LLKeyframeMotion::initializeConstraint(), LLEditingMotion::onInitialize(), LLKeyframeStandMotion::onUpdate(), LLHeadRotMotion::onUpdate(), LLViewerJointMesh::setupJoint(), LLSkinJoint::setupSkinJoint(), LLJointSolverRP3::solve(), updateWorldMatrixParent(), updateWorldPRSParent(), LLVOAvatar::writeCAL3D(), and LLViewerJointMesh::writeCAL3D().

const LLVector3 & LLJoint::getPosition (  ) 

Definition at line 221 of file lljoint.cpp.

References LLXform::getPosition(), and mXform.

Referenced by LLPolySkeletalDistortion::apply(), LLKeyframeMotion::applyConstraint(), LLJointStateBlender::blendJointStates(), LLVOAvatar::computeBodySize(), LLViewerJoint::drawBone(), LLJointStateBlender::interpolate(), LLEditingMotion::onActivate(), LLEditingMotion::onInitialize(), LLWalkAdjustMotion::onUpdate(), LLKeyframeStandMotion::onUpdate(), LLEditingMotion::onUpdate(), LLDrawPoolAvatar::renderAvatars(), LLJointStateBlender::resetCachedJoint(), LLJointSolverRP3::setupJoints(), and LLAgent::updateCamera().

LLJoint * LLJoint::getRoot (  ) 

Definition at line 136 of file lljoint.cpp.

References getParent(), getRoot(), and NULL.

Referenced by getRoot(), and LLViewerJointMesh::setMesh().

const LLQuaternion & LLJoint::getRotation (  ) 

Definition at line 290 of file lljoint.cpp.

References LLXform::getRotation(), and mXform.

Referenced by LLKeyframeMotion::applyConstraint(), LLJointStateBlender::blendJointStates(), LLJointStateBlender::interpolate(), LLEditingMotion::onActivate(), LLEditingMotion::onInitialize(), LLTargetingMotion::onUpdate(), LLKeyframeStandMotion::onUpdate(), LLEditingMotion::onUpdate(), LLJointStateBlender::resetCachedJoint(), and LLJointSolverRP3::setupJoints().

const LLVector3 & LLJoint::getScale (  ) 

Definition at line 359 of file lljoint.cpp.

References LLXform::getScale(), and mXform.

Referenced by LLPolySkeletalDistortion::apply(), LLJointStateBlender::blendJointStates(), LLVOAvatar::computeBodySize(), LLViewerJointShape::drawShape(), LLViewerJointCollisionVolume::getVolumePos(), LLJointStateBlender::interpolate(), LLKeyframeStandMotion::onUpdate(), LLJointStateBlender::resetCachedJoint(), LLAgent::updateCamera(), LLViewerJointMesh::writeCAL3D(), and LLViewerJoint::writeCAL3D().

const LLVector3 & LLJoint::getSkinOffset (  ) 

Definition at line 477 of file lljoint.cpp.

References mSkinOffset.

Referenced by LLSkinJoint::setupSkinJoint(), LLVOAvatar::writeCAL3D(), and LLViewerJointMesh::writeCAL3D().

const LLMatrix4 & LLJoint::getWorldMatrix (  ) 

Definition at line 382 of file lljoint.cpp.

References LLXformMatrix::getWorldMatrix(), mXform, and updateWorldMatrixParent().

Referenced by LLViewerJointMesh::drawShape(), LLKeyframeStandMotion::onUpdate(), LLViewerJoint::renderSkeleton(), LLViewerJointMesh::setupJoint(), setWorldPosition(), setWorldRotation(), LLJointSolverRP3::solve(), and LLVOAvatar::updateCharacter().

LLVector3 LLJoint::getWorldPosition (  ) 

Definition at line 243 of file lljoint.cpp.

References LLXform::getWorldPosition(), mXform, and updateWorldPRSParent().

Referenced by LLKeyframeMotion::activateConstraint(), LLKeyframeMotion::applyConstraint(), LLHUDEffectLookAt::calcTargetPosition(), LLViewerJointCollisionVolume::getVolumePos(), LLVOAvatar::idleUpdate(), LLKeyframeMotion::initializeConstraint(), LLWalkAdjustMotion::onActivate(), LLEditingMotion::onActivate(), LLEditingMotion::onInitialize(), LLWalkAdjustMotion::onUpdate(), LLKeyframeStandMotion::onUpdate(), LLEyeMotion::onUpdate(), LLEditingMotion::onUpdate(), LLVisualParamHint::render(), LLImagePreviewAvatar::render(), LLPreviewAnimation::render(), LLDrawPoolAvatar::renderAvatars(), LLHUDEffectBeam::setSourceObject(), LLViewerJointAttachment::setupDrawable(), LLHUDEffectBeam::setupParticle(), LLJointSolverRP3::solve(), LLDebugText::update(), LLViewerPartSourceBeam::update(), LLMorphView::updateCamera(), LLVOAvatar::updateCharacter(), LLVOAvatar::updateHeadOffset(), and LLVOAvatar::updateShadowFaces().

LLQuaternion LLJoint::getWorldRotation (  ) 

Definition at line 315 of file lljoint.cpp.

References LLXform::getWorldRotation(), mXform, and updateWorldPRSParent().

Referenced by LLKeyframeMotion::activateConstraint(), LLKeyframeMotion::applyConstraint(), LLViewerJointCollisionVolume::getVolumePos(), LLVOAvatar::idleUpdate(), LLEditingMotion::onActivate(), LLEditingMotion::onInitialize(), LLTargetingMotion::onUpdate(), LLWalkAdjustMotion::onUpdate(), LLKeyframeStandMotion::onUpdate(), LLEyeMotion::onUpdate(), LLHeadRotMotion::onUpdate(), LLEditingMotion::onUpdate(), LLVisualParamHint::render(), LLImagePreviewAvatar::render(), LLPreviewAnimation::render(), LLViewerJointAttachment::setupDrawable(), LLJointSolverRP3::solve(), LLMorphView::updateCamera(), LLAgent::updateCamera(), and LLVOAvatar::updateCharacter().

LLXformMatrix* LLJoint::getXform (  )  [inline]

Definition at line 172 of file lljoint.h.

References mXform.

Referenced by LLVOAvatar::getOffObject(), LLVOAvatar::sitOnObject(), and LLVOAvatar::updateCharacter().

virtual BOOL LLJoint::isAnimatable (  )  [inline, virtual]

Reimplemented in LLViewerJointAttachment, LLViewerJointMesh, and LLViewerJointShape.

Definition at line 176 of file lljoint.h.

References TRUE.

void LLJoint::removeAllChildren (  ) 

Definition at line 203 of file lljoint.cpp.

References mChildren, mParent, mXform, NULL, LLXform::setParent(), and touch().

Referenced by LLVOAvatar::buildCharacter(), ~LLJoint(), and LLVOAvatar::~LLVOAvatar().

void LLJoint::removeChild ( LLJoint joint  ) 

Definition at line 187 of file lljoint.cpp.

References mChildren, mParent, mXform, NULL, LLXform::setParent(), and touch().

Referenced by addChild(), and ~LLJoint().

void LLJoint::setJointNum ( S32  joint_num  )  [inline]

Definition at line 179 of file lljoint.h.

References mJointNum.

void LLJoint::setName ( const std::string &  name  )  [inline]

Definition at line 119 of file lljoint.h.

References mName.

Referenced by LLJoint(), LLVOAvatar::LLVOAvatar(), LLVOAvatar::loadSkeletonNode(), setup(), and LLVOAvatar::setupBone().

void LLJoint::setPosition ( const LLVector3 pos  ) 

Definition at line 230 of file lljoint.cpp.

References MATRIX_DIRTY, mXform, POSITION_DIRTY, LLXform::setPosition(), and touch().

Referenced by LLPolySkeletalDistortion::apply(), LLJointStateBlender::blendJointStates(), LLVOAvatar::buildCharacter(), LLVOAvatar::getOffObject(), LLJointStateBlender::interpolate(), LLEditingMotion::onActivate(), LLEditingMotion::onInitialize(), LLKeyframeStandMotion::onUpdate(), LLEditingMotion::onUpdate(), LLDrawPoolAvatar::renderAvatars(), LLJointStateBlender::resetCachedJoint(), LLViewerJointMesh::setMesh(), LLViewerJointAttachment::setOriginalPosition(), LLVOAvatar::setupBone(), setWorldPosition(), LLVOAvatar::sitOnObject(), and LLVOAvatar::updateCharacter().

void LLJoint::setRotation ( const LLQuaternion rot  ) 

Definition at line 299 of file lljoint.cpp.

References LLQuaternion::isFinite(), MATRIX_DIRTY, mXform, ROTATION_DIRTY, LLXform::setRotation(), and touch().

Referenced by LLKeyframeMotion::applyConstraint(), LLJointStateBlender::blendJointStates(), LLVOAvatar::getOffObject(), LLJointStateBlender::interpolate(), LLVOAvatar::loadSkeletonNode(), LLEditingMotion::onActivate(), LLEyeMotion::onDeactivate(), LLEditingMotion::onInitialize(), LLKeyframeStandMotion::onUpdate(), LLEditingMotion::onUpdate(), LLJointStateBlender::resetCachedJoint(), LLViewerJointMesh::setMesh(), LLVOAvatar::setupBone(), setWorldRotation(), LLJointSolverRP3::solve(), and LLVOAvatar::updateCharacter().

void LLJoint::setScale ( const LLVector3 scale  ) 

Definition at line 367 of file lljoint.cpp.

References mXform, LLXform::setScale(), and touch().

Referenced by LLPolySkeletalDistortion::apply(), LLJointStateBlender::blendJointStates(), LLVOAvatar::buildSkeleton(), LLJointStateBlender::interpolate(), LLKeyframeStandMotion::onUpdate(), LLJointStateBlender::resetCachedJoint(), LLViewerJointMesh::setMesh(), LLVOAvatar::setupBone(), LLAgent::updateCamera(), and LLVOAvatar::updateCharacter().

void LLJoint::setSkinOffset ( const LLVector3 offset  ) 

Definition at line 486 of file lljoint.cpp.

References mSkinOffset.

Referenced by LLVOAvatar::setupBone().

void LLJoint::setup ( const std::string &  name,
LLJoint parent = NULL 
)

Definition at line 99 of file lljoint.cpp.

References addChild(), and setName().

void LLJoint::setWorldMatrix ( const LLMatrix4 mat  ) 

Definition at line 393 of file lljoint.cpp.

References llendl, llinfos, LLMatrix4::mMatrix, setWorldPosition(), setWorldRotation(), VW, VX, VY, and VZ.

void LLJoint::setWorldPosition ( const LLVector3 pos  ) 

Definition at line 261 of file lljoint.cpp.

References getWorldMatrix(), LLMatrix4::invert(), LLMatrix4::mMatrix, mParent, LLVector3::mV, NULL, setPosition(), VW, VX, VY, and VZ.

Referenced by LLVOAvatar::buildSkeleton(), setWorldMatrix(), LLVOAvatar::slamPosition(), and LLVOAvatar::updateCharacter().

void LLJoint::setWorldRotation ( const LLQuaternion rot  ) 

Definition at line 333 of file lljoint.cpp.

References getWorldMatrix(), LLMatrix4::invert(), LLMatrix4::mMatrix, mParent, NULL, setRotation(), VW, VX, VY, and VZ.

Referenced by LLKeyframeStandMotion::onUpdate(), setWorldMatrix(), LLJointSolverRP3::solve(), and LLVOAvatar::updateCharacter().

void LLJoint::touch ( U32  flags = ALL_DIRTY  ) 

Definition at line 112 of file lljoint.cpp.

References mChildren, mDirtyFlags, POSITION_DIRTY, ROTATION_DIRTY, and sNumTouches.

Referenced by addChild(), LLJoint(), removeAllChildren(), removeChild(), setPosition(), setRotation(), setScale(), and LLVOAvatar::updateCharacter().

void LLJoint::updateWorldMatrix (  ) 

Definition at line 464 of file lljoint.cpp.

References FALSE, MATRIX_DIRTY, mDirtyFlags, mXform, sNumUpdates, and LLXformMatrix::updateMatrix().

Referenced by LLViewerJointCollisionVolume::render(), updateWorldMatrixChildren(), and updateWorldMatrixParent().

void LLJoint::updateWorldMatrixChildren (  ) 

Definition at line 445 of file lljoint.cpp.

References MATRIX_DIRTY, mChildren, mDirtyFlags, and updateWorldMatrix().

Referenced by LLPreviewAnimation::render(), LLDrawPoolAvatar::renderAvatars(), LLVOAvatar::sitOnObject(), LLVOAvatar::slamPosition(), LLVOAvatar::updateCharacter(), and LLVOAvatar::updateVisualParams().

void LLJoint::updateWorldMatrixParent (  ) 

Definition at line 411 of file lljoint.cpp.

References getParent(), MATRIX_DIRTY, mDirtyFlags, updateWorldMatrix(), and updateWorldMatrixParent().

Referenced by getWorldMatrix(), and updateWorldMatrixParent().

void LLJoint::updateWorldPRSParent (  ) 

Definition at line 427 of file lljoint.cpp.

References getParent(), mDirtyFlags, mXform, POSITION_DIRTY, ROTATION_DIRTY, LLXformMatrix::update(), and updateWorldPRSParent().

Referenced by getWorldPosition(), getWorldRotation(), and updateWorldPRSParent().


Member Data Documentation

child_list_t LLJoint::mChildren

Definition at line 100 of file lljoint.h.

Referenced by addChild(), clampRotation(), LLViewerJoint::dump(), LLCharacter::dumpCharacter(), findJoint(), removeAllChildren(), removeChild(), LLViewerJoint::render(), LLViewerJoint::renderSkeleton(), LLPolySkeletalDistortion::setInfo(), LLViewerJoint::setSkeletonComponents(), LLViewerJoint::setValid(), LLViewerJoint::setVisible(), touch(), LLViewerJoint::updateFaceData(), LLViewerJoint::updateFaceSizes(), LLViewerJoint::updateGeometry(), LLViewerJoint::updateLOD(), updateWorldMatrixChildren(), and LLViewerJoint::writeCAL3D().

U32 LLJoint::mDirtyFlags

Definition at line 90 of file lljoint.h.

Referenced by LLJoint(), touch(), updateWorldMatrix(), updateWorldMatrixChildren(), updateWorldMatrixParent(), and updateWorldPRSParent().

S32 LLJoint::mJointNum

Definition at line 96 of file lljoint.h.

Referenced by getJointNum(), LLJoint(), setJointNum(), LLViewerJointMesh::writeCAL3D(), and LLViewerJoint::writeCAL3D().

std::string LLJoint::mName [protected]

Definition at line 81 of file lljoint.h.

Referenced by LLViewerJointMesh::dump(), getName(), LLJoint(), setName(), and LLViewerJoint::writeCAL3D().

LLJoint* LLJoint::mParent [protected]

Definition at line 84 of file lljoint.h.

Referenced by addChild(), LLViewerJoint::drawBone(), getParent(), LLJoint(), removeAllChildren(), removeChild(), setWorldPosition(), setWorldRotation(), LLViewerJoint::writeCAL3D(), and ~LLJoint().

LLVector3 LLJoint::mSkinOffset

Definition at line 94 of file lljoint.h.

Referenced by getSkinOffset(), and setSkinOffset().

BOOL LLJoint::mUpdateXform

Definition at line 91 of file lljoint.h.

Referenced by LLViewerJointAttachment::addObject(), LLKeyframeMotion::deactivateConstraint(), LLViewerJointCollisionVolume::getVolumePos(), LLJoint(), LLViewerJoint::LLViewerJoint(), LLViewerJointAttachment::LLViewerJointAttachment(), LLViewerJointCollisionVolume::LLViewerJointCollisionVolume(), LLViewerJointMesh::LLViewerJointMesh(), LLVOAvatar::loadSkeletonNode(), and LLViewerJointAttachment::removeObject().

LLXformMatrix LLJoint::mXform [protected]

Definition at line 87 of file lljoint.h.

Referenced by addChild(), getLastWorldPosition(), getLastWorldRotation(), getPosition(), getRotation(), getScale(), getWorldMatrix(), getWorldPosition(), getWorldRotation(), getXform(), LLJoint(), removeAllChildren(), removeChild(), LLViewerJointCollisionVolume::render(), setPosition(), setRotation(), setScale(), LLViewerJointAttachment::setupDrawable(), updateWorldMatrix(), updateWorldPRSParent(), and LLViewerJoint::writeCAL3D().

S32 LLJoint::sNumTouches = 0 [static]

Definition at line 103 of file lljoint.h.

Referenced by LLVOAvatar::idleUpdate(), and touch().

S32 LLJoint::sNumUpdates = 0 [static]

Definition at line 104 of file lljoint.h.

Referenced by LLVOAvatar::idleUpdate(), and updateWorldMatrix().


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