OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MWMechanics::CharacterController Class Reference

#include <character.hpp>

Inheritance diagram for MWMechanics::CharacterController:
Collaboration diagram for MWMechanics::CharacterController:

Classes

struct  AnimationQueueEntry
 

Public Types

enum  KillResult { Result_DeathAnimStarted, Result_DeathAnimPlaying, Result_DeathAnimJustFinished, Result_DeathAnimFinished }
 

Public Member Functions

 CharacterController (const MWWorld::Ptr &ptr, MWRender::Animation *anim)
 
virtual ~CharacterController ()
 
virtual void handleTextKey (const std::string &groupname, const std::multimap< float, std::string >::const_iterator &key, const std::multimap< float, std::string > &map)
 
void updateContinuousVfx ()
 
void updatePtr (const MWWorld::Ptr &ptr)
 
void update (float duration)
 
void persistAnimationState ()
 
void unpersistAnimationState ()
 
bool playGroup (const std::string &groupname, int mode, int count, bool persist=false)
 
void skipAnim ()
 
bool isAnimPlaying (const std::string &groupName)
 
KillResult kill ()
 
void resurrect ()
 
bool isDead () const
 
void forceStateUpdate ()
 
bool isReadyToBlock () const
 
bool isKnockedOut () const
 
bool isSneaking () const
 
void setAttackingOrSpell (bool attackingOrSpell)
 
void setAIAttackType (std::string attackType)
 
bool readyToPrepareAttack () const
 
bool readyToStartAttack () const
 
float getAttackStrength () const
 
void setActive (bool active)
 
void setHeadTrackTarget (const MWWorld::ConstPtr &target)
 Make this character turn its head towards target. To turn off head tracking, pass an empty Ptr. More...
 
void playSwishSound (float attackStrength)
 

Static Public Member Functions

static void setAttackTypeRandomly (std::string &attackType)
 

Private Types

typedef std::deque
< AnimationQueueEntry
AnimationQueue
 

Private Member Functions

void setAttackTypeBasedOnMovement ()
 
void refreshCurrentAnims (CharacterState idle, CharacterState movement, JumpingState jump, bool force=false)
 
void refreshHitRecoilAnims ()
 
void refreshJumpAnims (const WeaponInfo *weap, JumpingState jump, bool force=false)
 
void refreshMovementAnims (const WeaponInfo *weap, CharacterState movement, bool force=false)
 
void refreshIdleAnims (const WeaponInfo *weap, CharacterState idle, bool force=false)
 
void clearAnimQueue ()
 
bool updateWeaponState ()
 
bool updateCreatureState ()
 
void updateIdleStormState (bool inwater)
 
void updateAnimQueue ()
 
void updateHeadTracking (float duration)
 
void updateMagicEffects ()
 
void playDeath (float startpoint, CharacterState death)
 
CharacterState chooseRandomDeathState () const
 
void playRandomDeath (float startpoint=0.0f)
 
std::string chooseRandomGroup (const std::string &prefix, int *num=NULL) const
 
bool updateCarriedLeftVisible (WeaponType weaptype) const
 

Private Attributes

MWWorld::Ptr mPtr
 
MWRender::AnimationmAnimation
 
AnimationQueue mAnimQueue
 
CharacterState mIdleState
 
std::string mCurrentIdle
 
CharacterState mMovementState
 
std::string mCurrentMovement
 
float mMovementAnimSpeed
 
bool mAdjustMovementAnimSpeed
 
bool mHasMovedInXY
 
bool mMovementAnimationControlled
 
CharacterState mDeathState
 
std::string mCurrentDeath
 
bool mFloatToSurface
 
CharacterState mHitState
 
std::string mCurrentHit
 
UpperBodyCharacterState mUpperBodyState
 
JumpingState mJumpState
 
std::string mCurrentJump
 
WeaponType mWeaponType
 
std::string mCurrentWeapon
 
float mAttackStrength
 
bool mSkipAnim
 
float mSecondsOfSwimming
 
float mSecondsOfRunning
 
MWWorld::ConstPtr mHeadTrackTarget
 
float mTurnAnimationThreshold
 
std::string mAttackType
 
bool mAttackingOrSpell
 

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
Result_DeathAnimStarted 
Result_DeathAnimPlaying 
Result_DeathAnimJustFinished 
Result_DeathAnimFinished 

Constructor & Destructor Documentation

MWMechanics::CharacterController::CharacterController ( const MWWorld::Ptr ptr,
MWRender::Animation anim 
)

Here is the call graph for this function:

MWMechanics::CharacterController::~CharacterController ( )
virtual

Here is the call graph for this function:

Member Function Documentation

CharacterState MWMechanics::CharacterController::chooseRandomDeathState ( ) const
private

Here is the call graph for this function:

Here is the caller graph for this function:

std::string MWMechanics::CharacterController::chooseRandomGroup ( const std::string &  prefix,
int num = NULL 
) const
private

choose a random animation group with prefix and numeric suffix

Parameters
numif non-NULL, the chosen animation number will be written here

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::clearAnimQueue ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::forceStateUpdate ( )

Here is the call graph for this function:

float MWMechanics::CharacterController::getAttackStrength ( ) const

Here is the caller graph for this function:

void MWMechanics::CharacterController::handleTextKey ( const std::string &  groupname,
const std::multimap< float, std::string >::const_iterator &  key,
const std::multimap< float, std::string > &  map 
)
virtual

Implements MWRender::Animation::TextKeyListener.

Here is the call graph for this function:

bool MWMechanics::CharacterController::isAnimPlaying ( const std::string &  groupName)

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWMechanics::CharacterController::isDead ( ) const
inline
bool MWMechanics::CharacterController::isKnockedOut ( ) const

Here is the caller graph for this function:

bool MWMechanics::CharacterController::isReadyToBlock ( ) const

Here is the call graph for this function:

bool MWMechanics::CharacterController::isSneaking ( ) const

Here is the caller graph for this function:

CharacterController::KillResult MWMechanics::CharacterController::kill ( )

Here is the call graph for this function:

void MWMechanics::CharacterController::persistAnimationState ( )

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::playDeath ( float  startpoint,
CharacterState  death 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWMechanics::CharacterController::playGroup ( const std::string &  groupname,
int  mode,
int  count,
bool  persist = false 
)

Here is the call graph for this function:

void MWMechanics::CharacterController::playRandomDeath ( float  startpoint = 0.0f)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::playSwishSound ( float  attackStrength)

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWMechanics::CharacterController::readyToPrepareAttack ( ) const

Here is the caller graph for this function:

bool MWMechanics::CharacterController::readyToStartAttack ( ) const

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::refreshCurrentAnims ( CharacterState  idle,
CharacterState  movement,
JumpingState  jump,
bool  force = false 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::refreshHitRecoilAnims ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::refreshIdleAnims ( const WeaponInfo weap,
CharacterState  idle,
bool  force = false 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::refreshJumpAnims ( const WeaponInfo weap,
JumpingState  jump,
bool  force = false 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::refreshMovementAnims ( const WeaponInfo weap,
CharacterState  movement,
bool  force = false 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::resurrect ( )

Here is the call graph for this function:

void MWMechanics::CharacterController::setActive ( bool  active)
See Also
Animation::setActive

Here is the call graph for this function:

void MWMechanics::CharacterController::setAIAttackType ( std::string  attackType)

Here is the caller graph for this function:

void MWMechanics::CharacterController::setAttackingOrSpell ( bool  attackingOrSpell)

Here is the caller graph for this function:

void MWMechanics::CharacterController::setAttackTypeBasedOnMovement ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::setAttackTypeRandomly ( std::string &  attackType)
static

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::setHeadTrackTarget ( const MWWorld::ConstPtr target)

Make this character turn its head towards target. To turn off head tracking, pass an empty Ptr.

void MWMechanics::CharacterController::skipAnim ( )

Here is the caller graph for this function:

void MWMechanics::CharacterController::unpersistAnimationState ( )

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::update ( float  duration)

Here is the caller graph for this function:

void MWMechanics::CharacterController::updateAnimQueue ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWMechanics::CharacterController::updateCarriedLeftVisible ( WeaponType  weaptype) const
private

Here is the caller graph for this function:

void MWMechanics::CharacterController::updateContinuousVfx ( )

Here is the call graph for this function:

bool MWMechanics::CharacterController::updateCreatureState ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::updateHeadTracking ( float  duration)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::updateIdleStormState ( bool  inwater)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::updateMagicEffects ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CharacterController::updatePtr ( const MWWorld::Ptr ptr)

Here is the caller graph for this function:

bool MWMechanics::CharacterController::updateWeaponState ( )
private

Here is the caller graph for this function:

Member Data Documentation

bool MWMechanics::CharacterController::mAdjustMovementAnimSpeed
private
MWRender::Animation* MWMechanics::CharacterController::mAnimation
private
AnimationQueue MWMechanics::CharacterController::mAnimQueue
private
bool MWMechanics::CharacterController::mAttackingOrSpell
private
float MWMechanics::CharacterController::mAttackStrength
private
std::string MWMechanics::CharacterController::mAttackType
private
std::string MWMechanics::CharacterController::mCurrentDeath
private
std::string MWMechanics::CharacterController::mCurrentHit
private
std::string MWMechanics::CharacterController::mCurrentIdle
private
std::string MWMechanics::CharacterController::mCurrentJump
private
std::string MWMechanics::CharacterController::mCurrentMovement
private
std::string MWMechanics::CharacterController::mCurrentWeapon
private
CharacterState MWMechanics::CharacterController::mDeathState
private
bool MWMechanics::CharacterController::mFloatToSurface
private
bool MWMechanics::CharacterController::mHasMovedInXY
private
MWWorld::ConstPtr MWMechanics::CharacterController::mHeadTrackTarget
private
CharacterState MWMechanics::CharacterController::mHitState
private
CharacterState MWMechanics::CharacterController::mIdleState
private
JumpingState MWMechanics::CharacterController::mJumpState
private
bool MWMechanics::CharacterController::mMovementAnimationControlled
private
float MWMechanics::CharacterController::mMovementAnimSpeed
private
CharacterState MWMechanics::CharacterController::mMovementState
private
MWWorld::Ptr MWMechanics::CharacterController::mPtr
private
float MWMechanics::CharacterController::mSecondsOfRunning
private
float MWMechanics::CharacterController::mSecondsOfSwimming
private
bool MWMechanics::CharacterController::mSkipAnim
private
float MWMechanics::CharacterController::mTurnAnimationThreshold
private
UpperBodyCharacterState MWMechanics::CharacterController::mUpperBodyState
private
WeaponType MWMechanics::CharacterController::mWeaponType
private

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