OpenMW
|
#include <npcanimation.hpp>
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::NPC * | mNpc |
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() |
typedef std::map<ESM::PartReferenceType,std::string> MWRender::NpcAnimation::PartBoneMap |
MWRender::NpcAnimation::NpcAnimation | ( | const MWWorld::Ptr & | ptr, |
Ogre::SceneNode * | node, | ||
int | visibilityFlags, | ||
bool | disableListener = false , |
||
ViewMode | viewMode = VM_Normal |
||
) |
ptr | |
node | |
visibilityFlags | |
disableListener | Don'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 |
MWRender::NpcAnimation::~NpcAnimation | ( | ) | [virtual] |
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] |
effect | |
isNew | Is 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. |
playSound | Play 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.
void MWRender::NpcAnimation::rebuild | ( | ) |
Rebuilds the NPC, updating their root model, animation sources, and equipment.
void MWRender::NpcAnimation::removeIndividualPart | ( | ESM::PartReferenceType | type | ) | [private] |
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::setViewMode | ( | NpcAnimation::ViewMode | viewMode | ) |
void MWRender::NpcAnimation::showCarriedLeft | ( | bool | showa | ) | [virtual] |
Reimplemented from MWRender::Animation.
void MWRender::NpcAnimation::showWeapons | ( | bool | showWeapon | ) | [virtual] |
Reimplemented from MWRender::Animation.
void MWRender::NpcAnimation::updateNpcBase | ( | ) | [private] |
void MWRender::NpcAnimation::updateParts | ( | ) |
float MWRender::NpcAnimation::mAlpha [private] |
Ogre::Vector3 MWRender::NpcAnimation::mFirstPersonOffset [private] |
std::string MWRender::NpcAnimation::mHairModel [private] |
std::string MWRender::NpcAnimation::mHeadModel [private] |
bool MWRender::NpcAnimation::mListenerDisabled [private] |
const ESM::NPC* MWRender::NpcAnimation::mNpc [private] |
int MWRender::NpcAnimation::mPartPriorities[ESM::PRT_Count] [private] |
int MWRender::NpcAnimation::mPartslots[ESM::PRT_Count] [private] |
Ogre::SharedPtr<SayAnimationValue> MWRender::NpcAnimation::mSayAnimationValue [private] |
bool MWRender::NpcAnimation::mShowCarriedLeft [private] |
bool MWRender::NpcAnimation::mShowWeapons [private] |
ViewMode MWRender::NpcAnimation::mViewMode [private] |
int MWRender::NpcAnimation::mVisibilityFlags [private] |
const NpcAnimation::PartBoneMap MWRender::NpcAnimation::sPartList = createPartListMap() [static, private] |