LLMotionController Class Reference

#include <llmotioncontroller.h>

Collaboration diagram for LLMotionController:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::list< LLMotion * > motion_list_t
typedef std::set< LLMotion * > motion_set_t

Public Member Functions

 LLMotionController ()
virtual ~LLMotionController ()
void setCharacter (LLCharacter *character)
BOOL addMotion (const LLUUID &id, LLMotionConstructor create)
LLMotioncreateMotion (const LLUUID &id)
void removeMotion (const LLUUID &id)
BOOL startMotion (const LLUUID &id, F32 start_offset)
BOOL stopMotionLocally (const LLUUID &id, BOOL stop_immediate)
void updateMotion ()
void flushAllMotions ()
void deactivateAllMotions ()
void pause ()
void unpause ()
BOOL isPaused ()
void setTimeStep (F32 step)
void setTimeFactor (F32 time_factor)
F32 getTimeFactor ()
motion_list_tgetActiveMotions ()
bool isMotionActive (LLMotion *motion)
bool isMotionLoading (LLMotion *motion)
LLMotionfindMotion (const LLUUID &id)

Protected Types

typedef std::map< LLUUID,
LLMotion * > 
motion_map_t

Protected Member Functions

void deleteAllMotions ()
void addLoadedMotion (LLMotion *motion)
BOOL activateMotionInstance (LLMotion *motion, F32 time)
BOOL deactivateMotionInstance (LLMotion *motion)
void deprecateMotionInstance (LLMotion *motion)
BOOL stopMotionInstance (LLMotion *motion, BOOL stop_imemdiate)
void removeMotionInstance (LLMotion *motion)
void updateRegularMotions ()
void updateAdditiveMotions ()
void resetJointSignatures ()
void updateMotionsByType (LLMotion::LLMotionBlendType motion_type)

Protected Attributes

F32 mTimeFactor
LLPoseBlender mPoseBlender
LLCharactermCharacter
motion_map_t mAllMotions
motion_set_t mLoadingMotions
motion_list_t mLoadedMotions
motion_list_t mActiveMotions
motion_set_t mDeprecatedMotions
LLFrameTimer mTimer
F32 mTime
F32 mTimeOffset
F32 mLastTime
BOOL mHasRunOnce
BOOL mPaused
F32 mTimeStep
S32 mTimeStepCount
F32 mLastInterp
F32 mPauseTime
U8 mJointSignature [2][LL_CHARACTER_MAX_JOINTS]

Static Protected Attributes

static LLMotionRegistry sRegistry

Detailed Description

Definition at line 112 of file llmotioncontroller.h.


Member Typedef Documentation

typedef std::list<LLMotion*> LLMotionController::motion_list_t

Definition at line 115 of file llmotioncontroller.h.

typedef std::map<LLUUID, LLMotion*> LLMotionController::motion_map_t [protected]

Definition at line 214 of file llmotioncontroller.h.

typedef std::set<LLMotion*> LLMotionController::motion_set_t

Definition at line 116 of file llmotioncontroller.h.


Constructor & Destructor Documentation

LLMotionController::LLMotionController (  ) 

Definition at line 158 of file llmotioncontroller.cpp.

References FALSE, mHasRunOnce, mLastInterp, mLastTime, mPaused, mPauseTime, mTime, mTimeFactor, mTimeOffset, mTimeStep, and mTimeStepCount.

LLMotionController::~LLMotionController (  )  [virtual]

Definition at line 177 of file llmotioncontroller.cpp.

References deleteAllMotions().


Member Function Documentation

BOOL LLMotionController::activateMotionInstance ( LLMotion motion,
F32  time 
) [protected]

Definition at line 825 of file llmotioncontroller.cpp.

References LLMotion::activate(), f, F32_MAX, FALSE, LLMotion::getDuration(), LLMotion::getEaseOutDuration(), LLMotion::getLoop(), LLMotion::getPose(), LLPose::getWeight(), llmax(), LLMotion::mActivationTimestamp, mActiveMotions, mJointSignature, mLoadingMotions, LLMotion::mResidualWeight, LLMotion::mSendStopTimestamp, LLMotion::onUpdate(), LLMotion::setStopped(), and TRUE.

Referenced by startMotion(), and updateMotion().

void LLMotionController::addLoadedMotion ( LLMotion motion  )  [protected]

Definition at line 198 of file llmotioncontroller.cpp.

References LLPoseBlender::clearBlenders(), findMotion(), isMotionActive(), MAX_MOTION_INSTANCES, mLoadedMotions, mPoseBlender, and removeMotion().

Referenced by createMotion(), and updateMotion().

BOOL LLMotionController::addMotion ( const LLUUID id,
LLMotionConstructor  create 
)

Definition at line 285 of file llmotioncontroller.cpp.

References LLMotionRegistry::addMotion(), and sRegistry.

Referenced by LLCharacter::addMotion().

LLMotion * LLMotionController::createMotion ( const LLUUID id  ) 

Definition at line 321 of file llmotioncontroller.cpp.

References addLoadedMotion(), LLAnimationLibrary::animStateToString(), LLMotionRegistry::createMotion(), findMotion(), gAnimLibrary, llendl, llerrs, llinfos, mAllMotions, LLMotionRegistry::markBad(), mCharacter, mLoadingMotions, NULL, LLMotion::onInitialize(), LLMotion::setName(), sRegistry, LLMotion::STATUS_FAILURE, LLMotion::STATUS_HOLD, and LLMotion::STATUS_SUCCESS.

Referenced by LLCharacter::createMotion(), and startMotion().

void LLMotionController::deactivateAllMotions (  ) 

Definition at line 928 of file llmotioncontroller.cpp.

References deleteAllMotions(), and mAllMotions.

Referenced by LLCharacter::deactivateAllMotions().

BOOL LLMotionController::deactivateMotionInstance ( LLMotion motion  )  [protected]

Definition at line 870 of file llmotioncontroller.cpp.

References LLMotion::deactivate(), mActiveMotions, mDeprecatedMotions, removeMotionInstance(), and TRUE.

Referenced by stopMotionInstance(), and updateMotionsByType().

void LLMotionController::deleteAllMotions (  )  [protected]

Definition at line 185 of file llmotioncontroller.cpp.

References mActiveMotions, mAllMotions, mLoadedMotions, and mLoadingMotions.

Referenced by deactivateAllMotions(), flushAllMotions(), and ~LLMotionController().

void LLMotionController::deprecateMotionInstance ( LLMotion motion  )  [protected]

Definition at line 890 of file llmotioncontroller.cpp.

References FALSE, LLMotion::getID(), mAllMotions, mDeprecatedMotions, and stopMotionInstance().

Referenced by startMotion().

LLMotion * LLMotionController::findMotion ( const LLUUID id  ) 

Definition at line 920 of file llmotioncontroller.cpp.

References mAllMotions, and NULL.

Referenced by addLoadedMotion(), createMotion(), LLVOAvatar::findMotion(), LLCharacter::isMotionActive(), removeMotion(), startMotion(), and stopMotionLocally().

void LLMotionController::flushAllMotions (  ) 

Definition at line 946 of file llmotioncontroller.cpp.

References LLMotion::deactivate(), deleteAllMotions(), LLMotion::getID(), LLMotion::mActivationTimestamp, mActiveMotions, mCharacter, mTime, LLCharacter::removeAnimationData(), and startMotion().

Referenced by LLCharacter::flushAllMotions().

motion_list_t& LLMotionController::getActiveMotions (  )  [inline]

Definition at line 177 of file llmotioncontroller.h.

References mActiveMotions.

Referenced by LLVOAvatar::updateCharacter().

F32 LLMotionController::getTimeFactor (  )  [inline]

Definition at line 175 of file llmotioncontroller.h.

References mTimeFactor.

bool LLMotionController::isMotionActive ( LLMotion motion  ) 

Definition at line 903 of file llmotioncontroller.cpp.

References LLMotion::isActive().

Referenced by addLoadedMotion(), LLCharacter::isMotionActive(), startMotion(), and stopMotionInstance().

bool LLMotionController::isMotionLoading ( LLMotion motion  ) 

Definition at line 911 of file llmotioncontroller.cpp.

References mLoadingMotions.

Referenced by stopMotionInstance().

BOOL LLMotionController::isPaused (  )  [inline]

Definition at line 170 of file llmotioncontroller.h.

References mPaused.

Referenced by LLCharacter::areAnimationsPaused(), and LLCharacter::updateMotion().

void LLMotionController::pause (  ) 

Definition at line 978 of file llmotioncontroller.cpp.

References LLFrameTimer::getElapsedTimeF32(), mPaused, mPauseTime, mTimer, and TRUE.

Referenced by LLCharacter::requestPause(), and LLCharacter::updateMotion().

void LLMotionController::removeMotion ( const LLUUID id  ) 

Definition at line 293 of file llmotioncontroller.cpp.

References findMotion(), mAllMotions, and removeMotionInstance().

Referenced by addLoadedMotion(), and LLCharacter::removeMotion().

void LLMotionController::removeMotionInstance ( LLMotion motion  )  [protected]

Definition at line 305 of file llmotioncontroller.cpp.

References mActiveMotions, mLoadedMotions, mLoadingMotions, stopMotionInstance(), and TRUE.

Referenced by deactivateMotionInstance(), and removeMotion().

void LLMotionController::resetJointSignatures (  )  [protected]

Definition at line 472 of file llmotioncontroller.cpp.

References LL_CHARACTER_MAX_JOINTS, and mJointSignature.

Referenced by updateMotion().

void LLMotionController::setCharacter ( LLCharacter character  ) 

Definition at line 276 of file llmotioncontroller.cpp.

References mCharacter.

Referenced by LLCharacter::LLCharacter().

void LLMotionController::setTimeFactor ( F32  time_factor  ) 

Definition at line 267 of file llmotioncontroller.cpp.

References LLFrameTimer::getElapsedTimeAndResetF32(), mTimeFactor, mTimeOffset, and mTimer.

Referenced by LLCharacter::setAnimTimeFactor().

void LLMotionController::setTimeStep ( F32  step  ) 

Definition at line 244 of file llmotioncontroller.cpp.

References f, llfloor(), mActiveMotions, and mTimeStep.

Referenced by LLCharacter::setTimeStep(), and LLVOAvatar::updateCharacter().

BOOL LLMotionController::startMotion ( const LLUUID id,
F32  start_offset 
)

Definition at line 372 of file llmotioncontroller.cpp.

References activateMotionInstance(), LLMotion::canDeprecate(), createMotion(), deprecateMotionInstance(), FALSE, findMotion(), LLMotion::getFadeWeight(), LLMotion::getStopTime(), LLMotion::isBlending(), isMotionActive(), mTime, NULL, and TRUE.

Referenced by flushAllMotions(), and LLCharacter::startMotion().

BOOL LLMotionController::stopMotionInstance ( LLMotion motion,
BOOL  stop_imemdiate 
) [protected]

Definition at line 421 of file llmotioncontroller.cpp.

References deactivateMotionInstance(), f, FALSE, LLFrameTimer::getElapsedTimeF32(), isMotionActive(), isMotionLoading(), LLMotion::isStopped(), mPaused, mTime, mTimeFactor, mTimeOffset, mTimer, mTimeStep, LLMotion::setStopped(), LLMotion::setStopTime(), and TRUE.

Referenced by deprecateMotionInstance(), removeMotionInstance(), stopMotionLocally(), and updateMotionsByType().

BOOL LLMotionController::stopMotionLocally ( const LLUUID id,
BOOL  stop_immediate 
)

Definition at line 413 of file llmotioncontroller.cpp.

References findMotion(), and stopMotionInstance().

Referenced by LLCharacter::stopMotion().

void LLMotionController::unpause (  ) 

Definition at line 992 of file llmotioncontroller.cpp.

References FALSE, mPaused, mPauseTime, mTimer, LLFrameTimer::reset(), and LLFrameTimer::setAge().

Referenced by LLCharacter::updateMotion().

void LLMotionController::updateAdditiveMotions (  )  [protected]

Definition at line 464 of file llmotioncontroller.cpp.

References LLMotion::ADDITIVE_BLEND, and updateMotionsByType().

Referenced by updateMotion().

void LLMotionController::updateMotion (  ) 

Definition at line 720 of file llmotioncontroller.cpp.

References activateMotionInstance(), addLoadedMotion(), LLPoseBlender::blendAndApply(), LLPoseBlender::blendAndCache(), LLPoseBlender::clearBlenders(), f, LLFrameTimer::getElapsedTimeF32(), LLMotion::getID(), LLPoseBlender::interpolate(), LLMotion::isStopped(), llendl, llfloor(), llinfos, llmax(), mAllMotions, LLMotionRegistry::markBad(), mCharacter, mHasRunOnce, mLastInterp, mLastTime, mLoadingMotions, mPaused, mPoseBlender, mTime, mTimeFactor, mTimeOffset, mTimer, mTimeStep, mTimeStepCount, LLMotion::onInitialize(), resetJointSignatures(), S32, sRegistry, LLMotion::STATUS_FAILURE, LLMotion::STATUS_SUCCESS, TRUE, updateAdditiveMotions(), and updateRegularMotions().

Referenced by LLCharacter::updateMotion().

void LLMotionController::updateMotionsByType ( LLMotion::LLMotionBlendType  motion_type  )  [protected]

Definition at line 481 of file llmotioncontroller.cpp.

References LLPoseBlender::addMotion(), cubic_step(), deactivateMotionInstance(), f, LLMotion::fadeIn(), LLMotion::fadeOut(), FALSE, LLMotion::getBlendType(), LLMotion::getEaseInDuration(), LLMotion::getEaseOutDuration(), LLMotion::getFadeWeight(), LLMotion::getMinPixelArea(), LLCharacter::getPixelArea(), LLMotion::getPose(), LLMotion::getStopTime(), LLPose::getWeight(), i, LLMotion::isStopped(), LL_CHARACTER_MAX_JOINTS, LLMotion::mActivationTimestamp, mActiveMotions, mCharacter, mHasRunOnce, LLMotion::mJointSignature, mJointSignature, mPoseBlender, LLMotion::mResidualWeight, LLMotion::mSendStopTimestamp, mTime, NUM_JOINT_SIGNATURE_STRIDES, LLMotion::onUpdate(), LLCharacter::requestStopMotion(), S32, LLPose::setWeight(), stopMotionInstance(), and TRUE.

Referenced by updateAdditiveMotions(), and updateRegularMotions().

void LLMotionController::updateRegularMotions (  )  [protected]

Definition at line 456 of file llmotioncontroller.cpp.

References LLMotion::NORMAL_BLEND, and updateMotionsByType().

Referenced by updateMotion().


Member Data Documentation

motion_list_t LLMotionController::mActiveMotions [protected]

Definition at line 219 of file llmotioncontroller.h.

Referenced by activateMotionInstance(), deactivateMotionInstance(), deleteAllMotions(), flushAllMotions(), getActiveMotions(), removeMotionInstance(), setTimeStep(), and updateMotionsByType().

motion_map_t LLMotionController::mAllMotions [protected]

Definition at line 215 of file llmotioncontroller.h.

Referenced by createMotion(), deactivateAllMotions(), deleteAllMotions(), deprecateMotionInstance(), findMotion(), removeMotion(), and updateMotion().

LLCharacter* LLMotionController::mCharacter [protected]

Definition at line 204 of file llmotioncontroller.h.

Referenced by createMotion(), flushAllMotions(), setCharacter(), updateMotion(), and updateMotionsByType().

motion_set_t LLMotionController::mDeprecatedMotions [protected]

Definition at line 220 of file llmotioncontroller.h.

Referenced by deactivateMotionInstance(), and deprecateMotionInstance().

BOOL LLMotionController::mHasRunOnce [protected]

Definition at line 226 of file llmotioncontroller.h.

Referenced by LLMotionController(), updateMotion(), and updateMotionsByType().

U8 LLMotionController::mJointSignature[2][LL_CHARACTER_MAX_JOINTS] [protected]

Definition at line 233 of file llmotioncontroller.h.

Referenced by activateMotionInstance(), resetJointSignatures(), and updateMotionsByType().

F32 LLMotionController::mLastInterp [protected]

Definition at line 230 of file llmotioncontroller.h.

Referenced by LLMotionController(), and updateMotion().

F32 LLMotionController::mLastTime [protected]

Definition at line 225 of file llmotioncontroller.h.

Referenced by LLMotionController(), and updateMotion().

motion_list_t LLMotionController::mLoadedMotions [protected]

Definition at line 218 of file llmotioncontroller.h.

Referenced by addLoadedMotion(), deleteAllMotions(), and removeMotionInstance().

motion_set_t LLMotionController::mLoadingMotions [protected]

Definition at line 217 of file llmotioncontroller.h.

Referenced by activateMotionInstance(), createMotion(), deleteAllMotions(), isMotionLoading(), removeMotionInstance(), and updateMotion().

BOOL LLMotionController::mPaused [protected]

Definition at line 227 of file llmotioncontroller.h.

Referenced by isPaused(), LLMotionController(), pause(), stopMotionInstance(), unpause(), and updateMotion().

F32 LLMotionController::mPauseTime [protected]

Definition at line 231 of file llmotioncontroller.h.

Referenced by LLMotionController(), pause(), and unpause().

LLPoseBlender LLMotionController::mPoseBlender [protected]

Definition at line 202 of file llmotioncontroller.h.

Referenced by addLoadedMotion(), updateMotion(), and updateMotionsByType().

F32 LLMotionController::mTime [protected]

Definition at line 223 of file llmotioncontroller.h.

Referenced by flushAllMotions(), LLMotionController(), startMotion(), stopMotionInstance(), updateMotion(), and updateMotionsByType().

F32 LLMotionController::mTimeFactor [protected]

Definition at line 200 of file llmotioncontroller.h.

Referenced by getTimeFactor(), LLMotionController(), setTimeFactor(), stopMotionInstance(), and updateMotion().

F32 LLMotionController::mTimeOffset [protected]

Definition at line 224 of file llmotioncontroller.h.

Referenced by LLMotionController(), setTimeFactor(), stopMotionInstance(), and updateMotion().

LLFrameTimer LLMotionController::mTimer [protected]

Definition at line 222 of file llmotioncontroller.h.

Referenced by pause(), setTimeFactor(), stopMotionInstance(), unpause(), and updateMotion().

F32 LLMotionController::mTimeStep [protected]

Definition at line 228 of file llmotioncontroller.h.

Referenced by LLMotionController(), setTimeStep(), stopMotionInstance(), and updateMotion().

S32 LLMotionController::mTimeStepCount [protected]

Definition at line 229 of file llmotioncontroller.h.

Referenced by LLMotionController(), and updateMotion().

LLMotionRegistry LLMotionController::sRegistry [static, protected]

Definition at line 201 of file llmotioncontroller.h.

Referenced by addMotion(), createMotion(), and updateMotion().


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