OpenMW
|
#include <actors.hpp>
Public Types | |
typedef std::map< MWWorld::Ptr, Actor * > | PtrActorMap |
Public Member Functions | |
Actors () | |
~Actors () | |
PtrActorMap::const_iterator | begin () |
PtrActorMap::const_iterator | end () |
void | updateMagicEffects (const MWWorld::Ptr &ptr) |
void | addActor (const MWWorld::Ptr &ptr, bool updateImmediately=false) |
void | removeActor (const MWWorld::Ptr &ptr) |
void | updateActor (const MWWorld::Ptr &old, const MWWorld::Ptr &ptr) |
Updates an actor with a new Ptr. More... | |
void | dropActors (const MWWorld::CellStore *cellStore, const MWWorld::Ptr &ignore) |
Deregister all actors (except for ignore) in the given cell. More... | |
void | update (float duration, bool paused) |
Update actor stats and store desired velocity vectors in movement. More... | |
void | updateActor (const MWWorld::Ptr &ptr, float duration) |
void | engageCombat (const MWWorld::Ptr &actor1, const MWWorld::Ptr &actor2, bool againstPlayer) |
void | updateHeadTracking (const MWWorld::Ptr &actor, const MWWorld::Ptr &targetActor, MWWorld::Ptr &headTrackTarget, float &sqrHeadTrackDistance) |
void | rest (bool sleep) |
Update actors while the player is waiting or sleeping. This should be called every hour. More... | |
void | restoreDynamicStats (const MWWorld::Ptr &actor, bool sleep) |
int | getHoursToRest (const MWWorld::Ptr &ptr) const |
Calculate how many hours the given actor needs to rest in order to be fully healed. More... | |
void | fastForwardAi () |
Simulate the passing of time. More... | |
int | countDeaths (const std::string &id) const |
Return the number of deaths for actors with the given ID. More... | |
void | forceStateUpdate (const MWWorld::Ptr &ptr) |
bool | playAnimationGroup (const MWWorld::Ptr &ptr, const std::string &groupName, int mode, int number, bool persist=false) |
void | skipAnimation (const MWWorld::Ptr &ptr) |
bool | checkAnimationPlaying (const MWWorld::Ptr &ptr, const std::string &groupName) |
void | persistAnimationStates () |
void | getObjectsInRange (const osg::Vec3f &position, float radius, std::vector< MWWorld::Ptr > &out) |
void | cleanupSummonedCreature (CreatureStats &casterStats, int creatureActorId) |
std::list< MWWorld::Ptr > | getActorsSidingWith (const MWWorld::Ptr &actor) |
Returns the list of actors which are siding with the given actor in fights. More... | |
std::list< MWWorld::Ptr > | getActorsFollowing (const MWWorld::Ptr &actor) |
void | getActorsFollowing (const MWWorld::Ptr &actor, std::set< MWWorld::Ptr > &out) |
Recursive version of getActorsFollowing. More... | |
void | getActorsSidingWith (const MWWorld::Ptr &actor, std::set< MWWorld::Ptr > &out) |
Recursive version of getActorsSidingWith. More... | |
std::list< int > | getActorsFollowingIndices (const MWWorld::Ptr &actor) |
Get the list of AiFollow::mFollowIndex for all actors following this target. More... | |
std::list< MWWorld::Ptr > | getActorsFighting (const MWWorld::Ptr &actor) |
Returns the list of actors which are fighting the given actor. More... | |
std::list< MWWorld::Ptr > | getEnemiesNearby (const MWWorld::Ptr &actor) |
Unlike getActorsFighting, also returns actors that would fight the given actor if they saw him. More... | |
void | write (ESM::ESMWriter &writer, Loading::Listener &listener) const |
void | readRecord (ESM::ESMReader &reader, uint32_t type) |
void | clear () |
bool | isReadyToBlock (const MWWorld::Ptr &ptr) const |
Private Member Functions | |
void | updateNpc (const MWWorld::Ptr &ptr, float duration) |
void | adjustMagicEffects (const MWWorld::Ptr &creature) |
void | calculateDynamicStats (const MWWorld::Ptr &ptr) |
void | calculateCreatureStatModifiers (const MWWorld::Ptr &ptr, float duration) |
void | calculateNpcStatModifiers (const MWWorld::Ptr &ptr, float duration) |
void | calculateRestoration (const MWWorld::Ptr &ptr, float duration) |
void | updateDrowning (const MWWorld::Ptr &ptr, float duration) |
void | updateEquippedLight (const MWWorld::Ptr &ptr, float duration) |
void | updateCrimePersuit (const MWWorld::Ptr &ptr, float duration) |
void | killDeadActors () |
void | purgeSpellEffects (int casterActorId) |
Private Attributes | |
std::map< std::string, int > | mDeathCount |
PtrActorMap | mActors |
typedef std::map<MWWorld::Ptr,Actor*> MWMechanics::Actors::PtrActorMap |
MWMechanics::Actors::Actors | ( | ) |
MWMechanics::Actors::~Actors | ( | ) |
void MWMechanics::Actors::addActor | ( | const MWWorld::Ptr & | ptr, |
bool | updateImmediately = false |
||
) |
Register an actor for stats management
|
private |
|
inline |
|
private |
|
private |
|
private |
|
private |
bool MWMechanics::Actors::checkAnimationPlaying | ( | const MWWorld::Ptr & | ptr, |
const std::string & | groupName | ||
) |
void MWMechanics::Actors::cleanupSummonedCreature | ( | MWMechanics::CreatureStats & | casterStats, |
int | creatureActorId | ||
) |
void MWMechanics::Actors::clear | ( | ) |
int MWMechanics::Actors::countDeaths | ( | const std::string & | id | ) | const |
Return the number of deaths for actors with the given ID.
void MWMechanics::Actors::dropActors | ( | const MWWorld::CellStore * | cellStore, |
const MWWorld::Ptr & | ignore | ||
) |
Deregister all actors (except for ignore) in the given cell.
|
inline |
void MWMechanics::Actors::engageCombat | ( | const MWWorld::Ptr & | actor1, |
const MWWorld::Ptr & | actor2, | ||
bool | againstPlayer | ||
) |
Start combat between two actors : If againstPlayer = true then actor2 should be the Player. If one of the combatants is creature it should be actor1.
void MWMechanics::Actors::fastForwardAi | ( | ) |
Simulate the passing of time.
void MWMechanics::Actors::forceStateUpdate | ( | const MWWorld::Ptr & | ptr | ) |
std::list< MWWorld::Ptr > MWMechanics::Actors::getActorsFighting | ( | const MWWorld::Ptr & | actor | ) |
Returns the list of actors which are fighting the given actor.
ie AiCombat is active and the target is the actor
std::list< MWWorld::Ptr > MWMechanics::Actors::getActorsFollowing | ( | const MWWorld::Ptr & | actor | ) |
void MWMechanics::Actors::getActorsFollowing | ( | const MWWorld::Ptr & | actor, |
std::set< MWWorld::Ptr > & | out | ||
) |
Recursive version of getActorsFollowing.
std::list< int > MWMechanics::Actors::getActorsFollowingIndices | ( | const MWWorld::Ptr & | actor | ) |
Get the list of AiFollow::mFollowIndex for all actors following this target.
std::list< MWWorld::Ptr > MWMechanics::Actors::getActorsSidingWith | ( | const MWWorld::Ptr & | actor | ) |
void MWMechanics::Actors::getActorsSidingWith | ( | const MWWorld::Ptr & | actor, |
std::set< MWWorld::Ptr > & | out | ||
) |
Recursive version of getActorsSidingWith.
std::list< MWWorld::Ptr > MWMechanics::Actors::getEnemiesNearby | ( | const MWWorld::Ptr & | actor | ) |
Unlike getActorsFighting, also returns actors that would fight the given actor if they saw him.
int MWMechanics::Actors::getHoursToRest | ( | const MWWorld::Ptr & | ptr | ) | const |
Calculate how many hours the given actor needs to rest in order to be fully healed.
void MWMechanics::Actors::getObjectsInRange | ( | const osg::Vec3f & | position, |
float | radius, | ||
std::vector< MWWorld::Ptr > & | out | ||
) |
bool MWMechanics::Actors::isReadyToBlock | ( | const MWWorld::Ptr & | ptr | ) | const |
|
private |
void MWMechanics::Actors::persistAnimationStates | ( | ) |
bool MWMechanics::Actors::playAnimationGroup | ( | const MWWorld::Ptr & | ptr, |
const std::string & | groupName, | ||
int | mode, | ||
int | number, | ||
bool | persist = false |
||
) |
|
private |
void MWMechanics::Actors::readRecord | ( | ESM::ESMReader & | reader, |
uint32_t | type | ||
) |
void MWMechanics::Actors::removeActor | ( | const MWWorld::Ptr & | ptr | ) |
Deregister an actor for stats management
void MWMechanics::Actors::rest | ( | bool | sleep | ) |
Update actors while the player is waiting or sleeping. This should be called every hour.
void MWMechanics::Actors::restoreDynamicStats | ( | const MWWorld::Ptr & | actor, |
bool | sleep | ||
) |
void MWMechanics::Actors::skipAnimation | ( | const MWWorld::Ptr & | ptr | ) |
void MWMechanics::Actors::update | ( | float | duration, |
bool | paused | ||
) |
void MWMechanics::Actors::updateActor | ( | const MWWorld::Ptr & | old, |
const MWWorld::Ptr & | ptr | ||
) |
Updates an actor with a new Ptr.
void MWMechanics::Actors::updateActor | ( | const MWWorld::Ptr & | ptr, |
float | duration | ||
) |
This function is normally called automatically during the update process, but it can also be called explicitly at any time to force an update.
|
private |
|
private |
|
private |
Automatically equip NPCs torches at night and unequip them at day
void MWMechanics::Actors::updateHeadTracking | ( | const MWWorld::Ptr & | actor, |
const MWWorld::Ptr & | targetActor, | ||
MWWorld::Ptr & | headTrackTarget, | ||
float & | sqrHeadTrackDistance | ||
) |
void MWMechanics::Actors::updateMagicEffects | ( | const MWWorld::Ptr & | ptr | ) |
Update magic effects for an actor. Usually done automatically once per frame, but if we're currently paused we may want to do it manually (after equipping permanent enchantment)
|
private |
void MWMechanics::Actors::write | ( | ESM::ESMWriter & | writer, |
Loading::Listener & | listener | ||
) | const |
|
private |
|
private |