OpenMW
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
MWRender::NpcAnimation Class Reference

#include <npcanimation.hpp>

List of all members.

Public Types

enum  ViewMode { VM_Normal, VM_FirstPerson, VM_HeadOnly }
typedef std::map
< ESM::PartReferenceType,
std::string > 
PartBoneMap

Public Member Functions

virtual void equipmentChanged ()
virtual void permanentEffectAdded (const ESM::MagicEffect *magicEffect, bool isNew, bool playSound)
 NpcAnimation (const MWWorld::Ptr &ptr, Ogre::SceneNode *node, int visibilityFlags, bool disableListener=false, ViewMode viewMode=VM_Normal)
virtual ~NpcAnimation ()
virtual Ogre::Vector3 runAnimation (float timepassed)
virtual void showWeapons (bool showWeapon)
virtual void showCarriedLeft (bool showa)
void setViewMode (ViewMode viewMode)
void updateParts ()
void addFirstPersonOffset (const Ogre::Vector3 &offset)
 Applies a translation to the arms and hands. This may be called multiple times before the animation is updated to add additional offsets.
void rebuild ()
 Rebuilds the NPC, updating their root model, animation sources, and equipment.
virtual void setAlpha (float alpha)
 Make the NPC only partially visible.
virtual void preRender (Ogre::Camera *camera)
 Prepare this animation for being rendered with camera (rotates billboard nodes)

Private Member Functions

void updateNpcBase ()
NifOgre::ObjectScenePtr insertBoundedPart (const std::string &model, int group, const std::string &bonename, bool enchantedGlow, Ogre::Vector3 *glowColor=NULL)
void removeIndividualPart (ESM::PartReferenceType type)
void reserveIndividualPart (ESM::PartReferenceType type, int group, int priority)
bool addOrReplaceIndividualPart (ESM::PartReferenceType type, int group, int priority, const std::string &mesh, bool enchantedGlow=false, Ogre::Vector3 *glowColor=NULL)
void removePartGroup (int group)
void addPartGroup (int group, int priority, const std::vector< ESM::PartReference > &parts, bool enchantedGlow=false, Ogre::Vector3 *glowColor=NULL)
void applyAlpha (float alpha, Ogre::Entity *ent, NifOgre::ObjectScenePtr scene)

Private Attributes

bool mListenerDisabled
NifOgre::ObjectScenePtr mObjectParts [ESM::PRT_Count]
const ESM::NPCmNpc
std::string mHeadModel
std::string mHairModel
ViewMode mViewMode
bool mShowWeapons
bool mShowCarriedLeft
int mVisibilityFlags
int mPartslots [ESM::PRT_Count]
int mPartPriorities [ESM::PRT_Count]
Ogre::Vector3 mFirstPersonOffset
Ogre::SharedPtr
< SayAnimationValue
mSayAnimationValue
float mAlpha

Static Private Attributes

static const PartBoneMap sPartList = createPartListMap()

Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
VM_Normal 
VM_FirstPerson 
VM_HeadOnly 

Constructor & Destructor Documentation

MWRender::NpcAnimation::NpcAnimation ( const MWWorld::Ptr ptr,
Ogre::SceneNode *  node,
int  visibilityFlags,
bool  disableListener = false,
ViewMode  viewMode = VM_Normal 
)
Parameters:
ptr
node
visibilityFlags
disableListenerDon't listen for equipment changes and magic effects. InventoryStore only supports one listener at a time, so you shouldn't do this if creating several NpcAnimations for the same Ptr, eg preview dolls for the player. Those need to be manually rendered anyway.
viewMode

Member Function Documentation

void MWRender::NpcAnimation::addFirstPersonOffset ( const Ogre::Vector3 &  offset)

Applies a translation to the arms and hands. This may be called multiple times before the animation is updated to add additional offsets.

bool MWRender::NpcAnimation::addOrReplaceIndividualPart ( ESM::PartReferenceType  type,
int  group,
int  priority,
const std::string &  mesh,
bool  enchantedGlow = false,
Ogre::Vector3 *  glowColor = NULL 
) [private]
void MWRender::NpcAnimation::addPartGroup ( int  group,
int  priority,
const std::vector< ESM::PartReference > &  parts,
bool  enchantedGlow = false,
Ogre::Vector3 *  glowColor = NULL 
) [private]
void MWRender::NpcAnimation::applyAlpha ( float  alpha,
Ogre::Entity *  ent,
NifOgre::ObjectScenePtr  scene 
) [private]
virtual void MWRender::NpcAnimation::equipmentChanged ( ) [inline, virtual]

Fired when items are equipped or unequipped

Reimplemented from MWWorld::InventoryStoreListener.

NifOgre::ObjectScenePtr MWRender::NpcAnimation::insertBoundedPart ( const std::string &  model,
int  group,
const std::string &  bonename,
bool  enchantedGlow,
Ogre::Vector3 *  glowColor = NULL 
) [private]
void MWRender::NpcAnimation::permanentEffectAdded ( const ESM::MagicEffect magicEffect,
bool  isNew,
bool  playSound 
) [virtual]
Parameters:
effect
isNewIs this effect new (e.g. the item for it was just now manually equipped) or was it loaded from a savegame / initial game state?
If it isn't new, non-looping VFX should not be played.
playSoundPlay effect sound?

Reimplemented from MWWorld::InventoryStoreListener.

void MWRender::NpcAnimation::preRender ( Ogre::Camera *  camera) [virtual]

Prepare this animation for being rendered with camera (rotates billboard nodes)

Reimplemented from MWRender::Animation.

Rebuilds the NPC, updating their root model, animation sources, and equipment.

void MWRender::NpcAnimation::removePartGroup ( int  group) [private]
void MWRender::NpcAnimation::reserveIndividualPart ( ESM::PartReferenceType  type,
int  group,
int  priority 
) [private]
Ogre::Vector3 MWRender::NpcAnimation::runAnimation ( float  timepassed) [virtual]

Reimplemented from MWRender::Animation.

void MWRender::NpcAnimation::setAlpha ( float  alpha) [virtual]

Make the NPC only partially visible.

Reimplemented from MWRender::Animation.

void MWRender::NpcAnimation::showCarriedLeft ( bool  showa) [virtual]

Reimplemented from MWRender::Animation.

void MWRender::NpcAnimation::showWeapons ( bool  showWeapon) [virtual]

Reimplemented from MWRender::Animation.


Member Data Documentation

std::string MWRender::NpcAnimation::mHairModel [private]
std::string MWRender::NpcAnimation::mHeadModel [private]

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