OpenMW
Classes | Public Member Functions | Private Member Functions | Private Attributes
MWWorld::World Class Reference

The game world and its visual representation. More...

#include <worldimp.hpp>

List of all members.

Classes

struct  ProjectileState

Public Member Functions

 World (OEngine::Render::OgreRenderer &renderer, const Files::Collections &fileCollections, const std::vector< std::string > &contentFiles, const boost::filesystem::path &resDir, const boost::filesystem::path &cacheDir, ToUTF8::Utf8Encoder *encoder, const std::map< std::string, std::string > &fallbackMap, int mActivationDistanceOverride)
virtual ~World ()
virtual void startNewGame ()
virtual OEngine::Render::FadergetFader ()
 \ŧodo remove this function. Rendering details should not be exposed.
virtual CellStoregetExterior (int x, int y)
virtual CellStoregetInterior (const std::string &name)
virtual void setWaterHeight (const float height)
virtual void toggleWater ()
virtual void adjustSky ()
virtual void getTriangleBatchCount (unsigned int &triangles, unsigned int &batches)
virtual const FallbackgetFallback () const
virtual PlayergetPlayer ()
virtual const MWWorld::ESMStoregetStore () const
virtual std::vector
< ESM::ESMReader > & 
getEsmReader ()
virtual LocalScriptsgetLocalScripts ()
virtual bool hasCellChanged () const
 Has the player moved to a different cell, since the last frame?
virtual bool isCellExterior () const
virtual bool isCellQuasiExterior () const
virtual Ogre::Vector2 getNorthVector (CellStore *cell)
 get north vector (OGRE coordinates) for given interior cell
virtual void getDoorMarkers (MWWorld::CellStore *cell, std::vector< DoorMarker > &out)
 get a list of teleport door markers for a given cell, to be displayed on the local map
virtual void getInteriorMapPosition (Ogre::Vector2 position, float &nX, float &nY, int &x, int &y)
 see MWRender::LocalMap::getInteriorMapPosition
virtual bool isPositionExplored (float nX, float nY, int x, int y, bool interior)
 see MWRender::LocalMap::isPositionExplored
virtual Globals::DatagetGlobalVariable (const std::string &name)
virtual Globals::Data getGlobalVariable (const std::string &name) const
virtual char getGlobalVariableType (const std::string &name) const
 Return ' ', if there is no global variable with this name.
virtual std::vector< std::string > getGlobals () const
virtual std::string getCurrentCellName () const
virtual void removeRefScript (MWWorld::RefData *ref)
virtual Ptr getPtr (const std::string &name, bool activeOnly)
virtual Ptr getPtrViaHandle (const std::string &handle)
 Return a pointer to a liveCellRef with the given Ogre handle.
virtual Ptr searchPtrViaHandle (const std::string &handle)
 Return a pointer to a liveCellRef with the given Ogre handle or Ptr() if not found.
virtual void adjustPosition (const Ptr &ptr)
 Adjust position after load to be on ground. Must be called after model load.
virtual void enable (const Ptr &ptr)
virtual void disable (const Ptr &ptr)
virtual void advanceTime (double hours)
 Advance in-game time.
virtual void setHour (double hour)
 Set in-game time hour.
virtual void setMonth (int month)
 Set in-game time month.
virtual void setDay (int day)
 Set in-game time day.
virtual int getDay ()
virtual int getMonth ()
virtual TimeStamp getTimeStamp () const
 Return current in-game time stamp.
virtual bool toggleSky ()
virtual void changeWeather (const std::string &region, unsigned int id)
virtual int getCurrentWeather () const
virtual int getMasserPhase () const
virtual int getSecundaPhase () const
virtual void setMoonColour (bool red)
virtual void modRegion (const std::string &regionid, const std::vector< char > &chances)
virtual float getTimeScaleFactor () const
virtual void changeToInteriorCell (const std::string &cellName, const ESM::Position &position)
 Move to interior cell.
virtual void changeToExteriorCell (const ESM::Position &position)
 Move to exterior cell.
virtual const ESM::CellgetExterior (const std::string &cellName) const
 Return a cell matching the given name or a 0-pointer, if there is no such cell.
virtual void markCellAsUnchanged ()
virtual MWWorld::Ptr getFacedObject ()
 Return pointer to the object the player is looking at, if it is within activation range.
virtual std::pair
< MWWorld::Ptr, Ogre::Vector3 > 
getHitContact (const MWWorld::Ptr &ptr, float distance)
virtual void deleteObject (const Ptr &ptr)
virtual void moveObject (const Ptr &ptr, float x, float y, float z)
virtual void moveObject (const Ptr &ptr, CellStore &newCell, float x, float y, float z)
virtual void scaleObject (const Ptr &ptr, float scale)
virtual void rotateObject (const Ptr &ptr, float x, float y, float z, bool adjust=false)
virtual void localRotateObject (const Ptr &ptr, float x, float y, float z)
virtual MWWorld::Ptr safePlaceObject (const MWWorld::Ptr &ptr, MWWorld::CellStore &Cell, ESM::Position pos)
 place an object in a "safe" location (ie not in the void, etc). Makes a copy of the Ptr.
virtual void indexToPosition (int cellX, int cellY, float &x, float &y, bool centre=false) const
 Convert cell numbers to position.
virtual void positionToIndex (float x, float y, int &cellX, int &cellY) const
 Convert position to cell numbers.
virtual void queueMovement (const Ptr &ptr, const Ogre::Vector3 &velocity)
virtual bool castRay (float x1, float y1, float z1, float x2, float y2, float z2)
 cast a Ray and return true if there is an object in the ray path.
virtual bool toggleCollisionMode ()
virtual bool toggleRenderMode (RenderMode mode)
virtual const ESM::PotioncreateRecord (const ESM::Potion &record)
virtual const ESM::SpellcreateRecord (const ESM::Spell &record)
virtual const ESM::ClasscreateRecord (const ESM::Class &record)
virtual const ESM::CellcreateRecord (const ESM::Cell &record)
virtual const ESM::NPCcreateRecord (const ESM::NPC &record)
virtual const ESM::ArmorcreateRecord (const ESM::Armor &record)
virtual const ESM::WeaponcreateRecord (const ESM::Weapon &record)
virtual const ESM::ClothingcreateRecord (const ESM::Clothing &record)
virtual const ESM::EnchantmentcreateRecord (const ESM::Enchantment &record)
virtual const ESM::BookcreateRecord (const ESM::Book &record)
virtual void update (float duration, bool paused)
virtual bool placeObject (const MWWorld::Ptr &object, float cursorX, float cursorY, int amount)
virtual void dropObjectOnGround (const MWWorld::Ptr &actor, const MWWorld::Ptr &object, int amount)
virtual bool canPlaceObject (float cursorX, float cursorY)
virtual void processChangedSettings (const Settings::CategorySettingVector &settings)
virtual bool isFlying (const MWWorld::Ptr &ptr) const
virtual bool isSlowFalling (const MWWorld::Ptr &ptr) const
virtual bool isSubmerged (const MWWorld::Ptr &object) const
 Is the head of the creature underwater?
virtual bool isSwimming (const MWWorld::Ptr &object) const
virtual bool isUnderwater (const MWWorld::Ptr::CellStore *cell, const Ogre::Vector3 &pos) const
virtual bool isOnGround (const MWWorld::Ptr &ptr) const
virtual void togglePOV ()
virtual void togglePreviewMode (bool enable)
virtual bool toggleVanityMode (bool enable)
virtual void allowVanityMode (bool allow)
virtual void togglePlayerLooking (bool enable)
virtual void changeVanityModeScale (float factor)
virtual bool vanityRotateCamera (float *rot)
virtual void setCameraDistance (float dist, bool adjust=false, bool override=true)
virtual void setupPlayer ()
virtual void renderPlayer ()
virtual bool getOpenOrCloseDoor (const MWWorld::Ptr &door)
 if activated, should this door be opened or closed?
virtual void activateDoor (const MWWorld::Ptr &door)
 activate (open or close) an non-teleport door
virtual bool getPlayerStandingOn (const MWWorld::Ptr &object)
virtual bool getActorStandingOn (const MWWorld::Ptr &object)
virtual float getWindSpeed ()
virtual void getContainersOwnedBy (const MWWorld::Ptr &npc, std::vector< MWWorld::Ptr > &out)
 get all containers in active cells owned by this Npc
virtual void getItemsOwnedBy (const MWWorld::Ptr &npc, std::vector< MWWorld::Ptr > &out)
 get all items in active cells owned by this Npc
virtual bool getLOS (const MWWorld::Ptr &npc, const MWWorld::Ptr &targetNpc)
 get Line of Sight (morrowind stupid implementation)
virtual void enableActorCollision (const MWWorld::Ptr &actor, bool enable)
virtual void setupExternalRendering (MWRender::ExternalRendering &rendering)
virtual int canRest ()
virtual MWRender::AnimationgetAnimation (const MWWorld::Ptr &ptr)
virtual void playVideo (const std::string &name, bool allowSkipping)
virtual void stopVideo ()
virtual void frameStarted (float dt, bool paused)
virtual bool findExteriorPosition (const std::string &name, ESM::Position &pos)
virtual bool findInteriorPosition (const std::string &name, ESM::Position &pos)
virtual void enableTeleporting (bool enable)
 Enables or disables use of teleport spell effects (recall, intervention, etc).
virtual bool isTeleportingEnabled () const
 Returns true if teleport spell effects are allowed.
virtual void enableLevitation (bool enable)
 Enables or disables use of levitation spell effect.
virtual bool isLevitationEnabled () const
 Returns true if levitation spell effect is allowed.
virtual void setWerewolf (const MWWorld::Ptr &actor, bool werewolf)
 Turn actor into werewolf or normal form.
virtual void applyWerewolfAcrobatics (const MWWorld::Ptr &actor)
virtual bool getGodModeState ()
virtual bool toggleGodMode ()
virtual bool startSpellCast (const MWWorld::Ptr &actor)
 startSpellCast attempt to start casting a spell. Might fail immediately if conditions are not met.
virtual void castSpell (const MWWorld::Ptr &actor)
 Cast the actual spell, should be called mid-animation.
virtual void launchProjectile (const std::string &id, bool stack, const ESM::EffectList &effects, const MWWorld::Ptr &actor, const std::string &sourceName)
virtual void breakInvisibility (const MWWorld::Ptr &actor)
virtual bool isDark () const
virtual bool findInteriorPositionInWorldSpace (MWWorld::CellStore *cell, Ogre::Vector3 &result)
virtual void teleportToClosestMarker (const MWWorld::Ptr &ptr, const std::string &id, Ogre::Vector3 worldPos)
virtual void listDetectedReferences (const MWWorld::Ptr &ptr, std::vector< MWWorld::Ptr > &out, DetectionType type)

Private Member Functions

 World (const World &)
Worldoperator= (const World &)
Ptr getPtrViaHandle (const std::string &handle, Ptr::CellStore &cellStore)
void updateWeather (float duration)
int getDaysPerMonth (int month) const
void rotateObjectImp (const Ptr &ptr, Ogre::Vector3 rot, bool adjust)
bool moveObjectImp (const Ptr &ptr, float x, float y, float z)
Ptr copyObjectToCell (const Ptr &ptr, CellStore &cell, const ESM::Position &pos, bool adjustPos=true)
void updateWindowManager ()
void performUpdateSceneQueries ()
void updateFacedHandle ()
float getMaxActivationDistance ()
float getNpcActivationDistance ()
float getObjectActivationDistance ()
void removeContainerScripts (const Ptr &reference)
void addContainerScripts (const Ptr &reference, Ptr::CellStore *cell)
void PCDropped (const Ptr &item)
void processDoors (float duration)
 Run physics simulation and modify world accordingly.
void moveProjectiles (float duration)
void doPhysics (float duration)
 Run physics simulation and modify world accordingly.
void ensureNeededRecords ()
void loadContentFiles (const Files::Collections &fileCollections, const std::vector< std::string > &content, ContentLoader &contentLoader)
 loadContentFiles - Loads content files (esm,esp,omwgame,omwaddon)
void objectLeftActiveCell (MWWorld::Ptr object, MWWorld::Ptr movedPtr)
 Called when object is moved to an inactive cell.
float feetToGameUnits (float feet)

Private Attributes

MWWorld::Fallback mFallback
MWRender::RenderingManagermRendering
MWWorld::WeatherManagermWeatherManager
MWWorld::ScenemWorldScene
MWWorld::PlayermPlayer
std::vector< ESM::ESMReadermEsm
MWWorld::ESMStore mStore
LocalScripts mLocalScripts
MWWorld::GlobalsmGlobalVariables
MWWorld::PhysicsSystemmPhysics
bool mSky
Cells mCells
OEngine::Physic::PhysicEnginemPhysEngine
bool mGodMode
int mActivationDistanceOverride
std::string mFacedHandle
float mFacedDistance
std::map< MWWorld::Ptr, int > mDoorStates
 only holds doors that are currently moving. 0 means closing, 1 opening
std::map< MWWorld::Ptr,
ProjectileState
mProjectiles
int mPlayIntro
bool mTeleportEnabled
bool mLevitationEnabled

Detailed Description

The game world and its visual representation.


Constructor & Destructor Documentation

MWWorld::World::World ( const World ) [private]
MWWorld::World::World ( OEngine::Render::OgreRenderer renderer,
const Files::Collections fileCollections,
const std::vector< std::string > &  contentFiles,
const boost::filesystem::path &  resDir,
const boost::filesystem::path &  cacheDir,
ToUTF8::Utf8Encoder encoder,
const std::map< std::string, std::string > &  fallbackMap,
int  mActivationDistanceOverride 
)
MWWorld::World::~World ( ) [virtual]

Reimplemented from MWBase::World.


Member Function Documentation

void MWWorld::World::activateDoor ( const MWWorld::Ptr door) [virtual]

activate (open or close) an non-teleport door

Implements MWBase::World.

void MWWorld::World::addContainerScripts ( const Ptr reference,
Ptr::CellStore cell 
) [private]
void MWWorld::World::adjustPosition ( const Ptr ptr) [virtual]

Adjust position after load to be on ground. Must be called after model load.

Implements MWBase::World.

void MWWorld::World::adjustSky ( ) [virtual]

Implements MWBase::World.

void MWWorld::World::advanceTime ( double  hours) [virtual]

Advance in-game time.

Implements MWBase::World.

virtual void MWWorld::World::allowVanityMode ( bool  allow) [inline, virtual]

Implements MWBase::World.

void MWWorld::World::applyWerewolfAcrobatics ( const MWWorld::Ptr actor) [virtual]

Sets the NPC's Acrobatics skill to match the fWerewolfAcrobatics GMST. It only applies to the current form the NPC is in.

Implements MWBase::World.

void MWWorld::World::breakInvisibility ( const MWWorld::Ptr actor) [virtual]

Implements MWBase::World.

bool MWWorld::World::canPlaceObject ( float  cursorX,
float  cursorY 
) [virtual]
Returns:
true if it is possible to place on object at specified cursor location
Todo:
also check if the wanted position is on a flat surface, and not e.g. against a vertical wall!

Implements MWBase::World.

int MWWorld::World::canRest ( ) [virtual]

check if the player is allowed to rest
0 - yes
1 - only waiting
2 - player is underwater
3 - enemies are nearby (not implemented)

Implements MWBase::World.

bool MWWorld::World::castRay ( float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2 
) [virtual]

cast a Ray and return true if there is an object in the ray path.

Implements MWBase::World.

void MWWorld::World::castSpell ( const MWWorld::Ptr actor) [virtual]

Cast the actual spell, should be called mid-animation.

Parameters:
actor

Implements MWBase::World.

void MWWorld::World::changeToExteriorCell ( const ESM::Position position) [virtual]

Move to exterior cell.

Implements MWBase::World.

void MWWorld::World::changeToInteriorCell ( const std::string &  cellName,
const ESM::Position position 
) [virtual]

Move to interior cell.

Implements MWBase::World.

virtual void MWWorld::World::changeVanityModeScale ( float  factor) [inline, virtual]

Implements MWBase::World.

void MWWorld::World::changeWeather ( const std::string &  region,
unsigned int  id 
) [virtual]

Implements MWBase::World.

Ptr MWWorld::World::copyObjectToCell ( const Ptr ptr,
CellStore cell,
const ESM::Position pos,
bool  adjustPos = true 
) [private]
Todo:
add searching correct cell for position specified
const ESM::Potion * MWWorld::World::createRecord ( const ESM::Potion record) [virtual]

Create a new record (of type potion) in the ESM store.

Returns:
pointer to created record

Implements MWBase::World.

const ESM::Spell * MWWorld::World::createRecord ( const ESM::Spell record) [virtual]

Create a new record (of type spell) in the ESM store.

Returns:
pointer to created record

Implements MWBase::World.

const ESM::Class * MWWorld::World::createRecord ( const ESM::Class record) [virtual]

Create a new record (of type class) in the ESM store.

Returns:
pointer to created record

Implements MWBase::World.

const ESM::Cell * MWWorld::World::createRecord ( const ESM::Cell record) [virtual]

Create a new record (of type cell) in the ESM store.

Returns:
pointer to created record

Implements MWBase::World.

const ESM::NPC * MWWorld::World::createRecord ( const ESM::NPC record) [virtual]

Create a new record (of type npc) in the ESM store.

Returns:
pointer to created record

Implements MWBase::World.

const ESM::Armor * MWWorld::World::createRecord ( const ESM::Armor record) [virtual]

Create a new record (of type armor) in the ESM store.

Returns:
pointer to created record

Implements MWBase::World.

const ESM::Weapon * MWWorld::World::createRecord ( const ESM::Weapon record) [virtual]

Create a new record (of type weapon) in the ESM store.

Returns:
pointer to created record

Implements MWBase::World.

const ESM::Clothing * MWWorld::World::createRecord ( const ESM::Clothing record) [virtual]

Create a new record (of type clothing) in the ESM store.

Returns:
pointer to created record

Implements MWBase::World.

const ESM::Enchantment * MWWorld::World::createRecord ( const ESM::Enchantment record) [virtual]

Create a new record (of type enchantment) in the ESM store.

Returns:
pointer to created record

Implements MWBase::World.

const ESM::Book * MWWorld::World::createRecord ( const ESM::Book record) [virtual]

Create a new record (of type book) in the ESM store.

Returns:
pointer to created record

Implements MWBase::World.

void MWWorld::World::deleteObject ( const Ptr ptr) [virtual]

Implements MWBase::World.

void MWWorld::World::disable ( const Ptr ptr) [virtual]
Todo:
disable reference in the OGRE scene

Implements MWBase::World.

void MWWorld::World::doPhysics ( float  duration) [private]

Run physics simulation and modify world accordingly.

void MWWorld::World::dropObjectOnGround ( const MWWorld::Ptr actor,
const MWWorld::Ptr object,
int  amount 
) [virtual]

copy and place an object into the gameworld at the given actor's position

Parameters:
actorgiving the dropped object position
object
numberof objects to place

Implements MWBase::World.

void MWWorld::World::enable ( const Ptr ptr) [virtual]
Todo:
enable reference in the OGRE scene

Implements MWBase::World.

void MWWorld::World::enableActorCollision ( const MWWorld::Ptr actor,
bool  enable 
) [virtual]

Implements MWBase::World.

void MWWorld::World::enableLevitation ( bool  enable) [virtual]

Enables or disables use of levitation spell effect.

Implements MWBase::World.

void MWWorld::World::enableTeleporting ( bool  enable) [virtual]

Enables or disables use of teleport spell effects (recall, intervention, etc).

Implements MWBase::World.

float MWWorld::World::feetToGameUnits ( float  feet) [private]
bool MWWorld::World::findExteriorPosition ( const std::string &  name,
ESM::Position pos 
) [virtual]

Find center of exterior cell above land surface

Returns:
false if exterior with given name not exists, true otherwise

Implements MWBase::World.

bool MWWorld::World::findInteriorPosition ( const std::string &  name,
ESM::Position pos 
) [virtual]

Find position in interior cell near door entrance

Returns:
false if interior with given name not exists, true otherwise
Note:
Using _any_ door pointed to the interior, not the one pointed to current door.

Implements MWBase::World.

bool MWWorld::World::findInteriorPositionInWorldSpace ( MWWorld::CellStore cell,
Ogre::Vector3 &  result 
) [virtual]

Implements MWBase::World.

void MWWorld::World::frameStarted ( float  dt,
bool  paused 
) [virtual]

Implements MWBase::World.

bool MWWorld::World::getActorStandingOn ( const MWWorld::Ptr object) [virtual]
Returns:
true if any actor is standing on object

Implements MWBase::World.

Todo:
Probably shouldn't be here

Implements MWBase::World.

void MWWorld::World::getContainersOwnedBy ( const MWWorld::Ptr npc,
std::vector< MWWorld::Ptr > &  out 
) [virtual]

get all containers in active cells owned by this Npc

std::string MWWorld::World::getCurrentCellName ( ) const [virtual]

Implements MWBase::World.

int MWWorld::World::getCurrentWeather ( ) const [virtual]

Implements MWBase::World.

int MWWorld::World::getDay ( ) [virtual]

Implements MWBase::World.

int MWWorld::World::getDaysPerMonth ( int  month) const [private]
virtual void MWWorld::World::getDoorMarkers ( MWWorld::CellStore cell,
std::vector< DoorMarker > &  out 
) [virtual]

get a list of teleport door markers for a given cell, to be displayed on the local map

Implements MWBase::World.

std::vector< ESM::ESMReader > & MWWorld::World::getEsmReader ( ) [virtual]

Implements MWBase::World.

Ptr::CellStore * MWWorld::World::getExterior ( int  x,
int  y 
) [virtual]

Implements MWBase::World.

const ESM::Cell * MWWorld::World::getExterior ( const std::string &  cellName) const [virtual]

Return a cell matching the given name or a 0-pointer, if there is no such cell.

Implements MWBase::World.

Return pointer to the object the player is looking at, if it is within activation range.

Implements MWBase::World.

\ŧodo remove this function. Rendering details should not be exposed.

Implements MWBase::World.

const MWWorld::Fallback * MWWorld::World::getFallback ( ) const [virtual]

Implements MWBase::World.

std::vector< std::string > MWWorld::World::getGlobals ( ) const [virtual]

Implements MWBase::World.

Globals::Data & MWWorld::World::getGlobalVariable ( const std::string &  name) [virtual]

Implements MWBase::World.

Globals::Data MWWorld::World::getGlobalVariable ( const std::string &  name) const [virtual]

Implements MWBase::World.

char MWWorld::World::getGlobalVariableType ( const std::string &  name) const [virtual]

Return ' ', if there is no global variable with this name.

Implements MWBase::World.

bool MWWorld::World::getGodModeState ( ) [virtual]

Implements MWBase::World.

std::pair< MWWorld::Ptr, Ogre::Vector3 > MWWorld::World::getHitContact ( const MWWorld::Ptr ptr,
float  distance 
) [virtual]

Returns a pointer to the object the provided object would hit (if within the specified distance), and the point where the hit occurs. This will attempt to use the "Head" node as a basis.

Implements MWBase::World.

Ptr::CellStore * MWWorld::World::getInterior ( const std::string &  name) [virtual]

Implements MWBase::World.

void MWWorld::World::getInteriorMapPosition ( Ogre::Vector2  position,
float &  nX,
float &  nY,
int &  x,
int &  y 
) [virtual]
void MWWorld::World::getItemsOwnedBy ( const MWWorld::Ptr npc,
std::vector< MWWorld::Ptr > &  out 
) [virtual]

get all items in active cells owned by this Npc

Implements MWBase::World.

bool MWWorld::World::getLOS ( const MWWorld::Ptr npc,
const MWWorld::Ptr targetNpc 
) [virtual]

get Line of Sight (morrowind stupid implementation)

Implements MWBase::World.

int MWWorld::World::getMasserPhase ( ) const [virtual]

Implements MWBase::World.

int MWWorld::World::getMonth ( ) [virtual]

Implements MWBase::World.

Ogre::Vector2 MWWorld::World::getNorthVector ( CellStore cell) [virtual]

get north vector (OGRE coordinates) for given interior cell

Implements MWBase::World.

bool MWWorld::World::getOpenOrCloseDoor ( const MWWorld::Ptr door) [virtual]

if activated, should this door be opened or closed?

Implements MWBase::World.

Implements MWBase::World.

bool MWWorld::World::getPlayerStandingOn ( const MWWorld::Ptr object) [virtual]
Returns:
true if the player is standing on object

Implements MWBase::World.

Ptr MWWorld::World::getPtr ( const std::string &  name,
bool  activeOnly 
) [virtual]

Return a pointer to a liveCellRef with the given name.

Parameters:
activeOnlydo non search inactive cells.

Implements MWBase::World.

Ptr MWWorld::World::getPtrViaHandle ( const std::string &  handle,
Ptr::CellStore cellStore 
) [private]
Ptr MWWorld::World::getPtrViaHandle ( const std::string &  handle) [virtual]

Return a pointer to a liveCellRef with the given Ogre handle.

Implements MWBase::World.

int MWWorld::World::getSecundaPhase ( ) const [virtual]

Implements MWBase::World.

const MWWorld::ESMStore & MWWorld::World::getStore ( ) const [virtual]

Implements MWBase::World.

float MWWorld::World::getTimeScaleFactor ( ) const [virtual]

Implements MWBase::World.

Return current in-game time stamp.

Implements MWBase::World.

void MWWorld::World::getTriangleBatchCount ( unsigned int &  triangles,
unsigned int &  batches 
) [virtual]

Implements MWBase::World.

float MWWorld::World::getWindSpeed ( ) [virtual]

Implements MWBase::World.

bool MWWorld::World::hasCellChanged ( ) const [virtual]

Has the player moved to a different cell, since the last frame?

Implements MWBase::World.

void MWWorld::World::indexToPosition ( int  cellX,
int  cellY,
float &  x,
float &  y,
bool  centre = false 
) const [virtual]

Convert cell numbers to position.

Implements MWBase::World.

bool MWWorld::World::isCellExterior ( ) const [virtual]

Implements MWBase::World.

bool MWWorld::World::isCellQuasiExterior ( ) const [virtual]

Implements MWBase::World.

bool MWWorld::World::isDark ( ) const [virtual]

Implements MWBase::World.

bool MWWorld::World::isFlying ( const MWWorld::Ptr ptr) const [virtual]

Implements MWBase::World.

bool MWWorld::World::isLevitationEnabled ( ) const [virtual]

Returns true if levitation spell effect is allowed.

Implements MWBase::World.

bool MWWorld::World::isOnGround ( const MWWorld::Ptr ptr) const [virtual]

Implements MWBase::World.

bool MWWorld::World::isPositionExplored ( float  nX,
float  nY,
int  x,
int  y,
bool  interior 
) [virtual]
bool MWWorld::World::isSlowFalling ( const MWWorld::Ptr ptr) const [virtual]

Implements MWBase::World.

bool MWWorld::World::isSubmerged ( const MWWorld::Ptr object) const [virtual]

Is the head of the creature underwater?

Implements MWBase::World.

bool MWWorld::World::isSwimming ( const MWWorld::Ptr object) const [virtual]
Todo:
add check ifActor() - only actors can swim

3/4ths submerged?

Implements MWBase::World.

bool MWWorld::World::isTeleportingEnabled ( ) const [virtual]

Returns true if teleport spell effects are allowed.

Implements MWBase::World.

bool MWWorld::World::isUnderwater ( const MWWorld::Ptr::CellStore cell,
const Ogre::Vector3 &  pos 
) const [virtual]

Implements MWBase::World.

void MWWorld::World::launchProjectile ( const std::string &  id,
bool  stack,
const ESM::EffectList effects,
const MWWorld::Ptr actor,
const std::string &  sourceName 
) [virtual]

Implements MWBase::World.

void MWWorld::World::listDetectedReferences ( const MWWorld::Ptr ptr,
std::vector< MWWorld::Ptr > &  out,
DetectionType  type 
) [virtual]

List all references (filtered by type) detected by ptr. The range is determined by the current magnitude of the "Detect X" magic effect belonging to type.

Note:
This also works for references in containers.
void MWWorld::World::loadContentFiles ( const Files::Collections fileCollections,
const std::vector< std::string > &  content,
ContentLoader contentLoader 
) [private]

loadContentFiles - Loads content files (esm,esp,omwgame,omwaddon)

Parameters:
fileCollections-Container which holds content file names and their paths
content- Container which holds content file names
contentLoader-
void MWWorld::World::localRotateObject ( const Ptr ptr,
float  x,
float  y,
float  z 
) [virtual]

Implements MWBase::World.

Implements MWBase::World.

void MWWorld::World::modRegion ( const std::string &  regionid,
const std::vector< char > &  chances 
) [virtual]

Implements MWBase::World.

void MWWorld::World::moveObject ( const Ptr ptr,
float  x,
float  y,
float  z 
) [virtual]

Implements MWBase::World.

void MWWorld::World::moveObject ( const Ptr ptr,
CellStore newCell,
float  x,
float  y,
float  z 
) [virtual]

Implements MWBase::World.

bool MWWorld::World::moveObjectImp ( const Ptr ptr,
float  x,
float  y,
float  z 
) [private]
Returns:
true if the active cell (cell player is in) changed
void MWWorld::World::moveProjectiles ( float  duration) [private]
void MWWorld::World::objectLeftActiveCell ( MWWorld::Ptr  object,
MWWorld::Ptr  movedPtr 
) [private]

Called when object is moved to an inactive cell.

World& MWWorld::World::operator= ( const World ) [private]
void MWWorld::World::PCDropped ( const Ptr item) [private]
bool MWWorld::World::placeObject ( const MWWorld::Ptr object,
float  cursorX,
float  cursorY,
int  amount 
) [virtual]

copy and place an object into the gameworld at the specified cursor position

Parameters:
object
cursorX (relative 0-1)
cursorY (relative 0-1)
numberof objects to place
Returns:
true if the object was placed, or false if it was rejected because the position is too far away

Implements MWBase::World.

void MWWorld::World::playVideo ( const std::string &  name,
bool  allowSkipping 
) [virtual]
Todo:
this does not belong here

Implements MWBase::World.

void MWWorld::World::positionToIndex ( float  x,
float  y,
int &  cellX,
int &  cellY 
) const [virtual]

Convert position to cell numbers.

Implements MWBase::World.

Implements MWBase::World.

void MWWorld::World::processDoors ( float  duration) [private]

Run physics simulation and modify world accordingly.

Todo:
should use convexSweepTest here
virtual void MWWorld::World::queueMovement ( const Ptr ptr,
const Ogre::Vector3 &  velocity 
) [virtual]

Queues movement for ptr (in local space), to be applied in the next call to doPhysics.

Implements MWBase::World.

void MWWorld::World::removeContainerScripts ( const Ptr reference) [private]

Implements MWBase::World.

void MWWorld::World::renderPlayer ( ) [virtual]

Implements MWBase::World.

void MWWorld::World::rotateObject ( const Ptr ptr,
float  x,
float  y,
float  z,
bool  adjust = false 
) [virtual]

Rotates object, uses degrees

Parameters:
adjustindicates rotation should be set or adjusted

Implements MWBase::World.

void MWWorld::World::rotateObjectImp ( const Ptr ptr,
Ogre::Vector3  rot,
bool  adjust 
) [private]

place an object in a "safe" location (ie not in the void, etc). Makes a copy of the Ptr.

Implements MWBase::World.

void MWWorld::World::scaleObject ( const Ptr ptr,
float  scale 
) [virtual]

Implements MWBase::World.

Ptr MWWorld::World::searchPtrViaHandle ( const std::string &  handle) [virtual]

Return a pointer to a liveCellRef with the given Ogre handle or Ptr() if not found.

Implements MWBase::World.

void MWWorld::World::setCameraDistance ( float  dist,
bool  adjust = false,
bool  override = true 
) [virtual]

Implements MWBase::World.

void MWWorld::World::setDay ( int  day) [virtual]

Set in-game time day.

Implements MWBase::World.

void MWWorld::World::setHour ( double  hour) [virtual]

Set in-game time hour.

Implements MWBase::World.

void MWWorld::World::setMonth ( int  month) [virtual]

Set in-game time month.

Implements MWBase::World.

void MWWorld::World::setMoonColour ( bool  red) [virtual]

Implements MWBase::World.

Implements MWBase::World.

void MWWorld::World::setupPlayer ( ) [virtual]

Implements MWBase::World.

void MWWorld::World::setWaterHeight ( const float  height) [virtual]

Implements MWBase::World.

void MWWorld::World::setWerewolf ( const MWWorld::Ptr actor,
bool  werewolf 
) [virtual]

Turn actor into werewolf or normal form.

Implements MWBase::World.

void MWWorld::World::startNewGame ( ) [virtual]

Implements MWBase::World.

bool MWWorld::World::startSpellCast ( const MWWorld::Ptr actor) [virtual]

startSpellCast attempt to start casting a spell. Might fail immediately if conditions are not met.

Parameters:
actor
Returns:
true if the spell can be casted (i.e. the animation should start)

Implements MWBase::World.

void MWWorld::World::stopVideo ( ) [virtual]

Implements MWBase::World.

void MWWorld::World::teleportToClosestMarker ( const MWWorld::Ptr ptr,
const std::string &  id,
Ogre::Vector3  worldPos 
) [virtual]

Teleports ptr to the reference of id (e.g. DivineMarker, PrisonMarker, TempleMarker) closest to worldPos.

Note:
id must be lower case

Implements MWBase::World.

Toggle collision mode for player. If disabled player object should ignore collisions and gravity.

Returns:
Resulting mode

Implements MWBase::World.

bool MWWorld::World::toggleGodMode ( ) [virtual]

Implements MWBase::World.

virtual void MWWorld::World::togglePlayerLooking ( bool  enable) [inline, virtual]

Implements MWBase::World.

virtual void MWWorld::World::togglePOV ( ) [inline, virtual]

Implements MWBase::World.

virtual void MWWorld::World::togglePreviewMode ( bool  enable) [inline, virtual]

Implements MWBase::World.

bool MWWorld::World::toggleRenderMode ( RenderMode  mode) [virtual]

Toggle a render mode.

Returns:
Resulting mode

Implements MWBase::World.

bool MWWorld::World::toggleSky ( ) [virtual]
Returns:
Resulting mode

Implements MWBase::World.

virtual bool MWWorld::World::toggleVanityMode ( bool  enable) [inline, virtual]

Implements MWBase::World.

void MWWorld::World::toggleWater ( ) [virtual]

Implements MWBase::World.

void MWWorld::World::update ( float  duration,
bool  paused 
) [virtual]

Implements MWBase::World.

void MWWorld::World::updateWeather ( float  duration) [private]
bool MWWorld::World::vanityRotateCamera ( float *  rot) [virtual]

Implements MWBase::World.


Member Data Documentation

std::map<MWWorld::Ptr, int> MWWorld::World::mDoorStates [private]

only holds doors that are currently moving. 0 means closing, 1 opening

std::vector<ESM::ESMReader> MWWorld::World::mEsm [private]
std::string MWWorld::World::mFacedHandle [private]
bool MWWorld::World::mGodMode [private]
bool MWWorld::World::mSky [private]

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