1 #ifndef GAME_MWBASE_WORLD_H
2 #define GAME_MWBASE_WORLD_H
10 #include "../mwworld/ptr.hpp"
12 #include "../mwrender/rendermode.hpp"
43 struct CreatureLevList;
66 typedef std::vector<std::pair<MWWorld::Ptr,MWMechanics::Movement> >
PtrMovementList;
103 virtual void clear() = 0;
111 const std::map<int, int>& contentFileMap) = 0;
135 virtual std::vector<ESM::ESMReader>&
getEsmReader() = 0;
195 virtual void advanceTime (
double hours,
bool incremental =
false) = 0;
198 virtual void setHour (
double hour) = 0;
201 virtual void setMonth (
int month) = 0;
204 virtual void setDay (
int day) = 0;
207 virtual int getDay()
const = 0;
209 virtual int getYear()
const = 0;
211 virtual std::string
getMonthName (
int month = -1)
const = 0;
220 virtual void changeWeather(
const std::string& region,
const unsigned int id) = 0;
230 virtual void modRegion(
const std::string ®ionid,
const std::vector<char> &chances) = 0;
290 virtual void indexToPosition (
int cellX,
int cellY,
float &x,
float &y,
bool centre =
false)
294 virtual void positionToIndex (
float x,
float y,
int &cellX,
int &cellY)
const = 0;
301 virtual bool castRay (
float x1,
float y1,
float z1,
float x2,
float y2,
float z2) = 0;
361 virtual void update (
float duration,
bool paused) = 0;
379 virtual void processChangedSettings (
const std::set< std::pair<std::string, std::string> >& settings) = 0;
401 virtual void setCameraDistance(
float dist,
bool adjust =
false,
bool override =
true)=0;
434 virtual float getDistToNearestRayHit(
const osg::Vec3f& from,
const osg::Vec3f& dir,
float maxDist,
bool includeWater =
false) = 0;
451 virtual void screenshot (osg::Image* image,
int w,
int h) = 0;
490 const MWWorld::Ptr& caster,
const std::string& sourceName,
const osg::Vec3f& fallbackDirection) = 0;
492 const osg::Vec3f& worldPos,
const osg::Quat& orient,
MWWorld::Ptr bow,
float speed,
float attackStrength) = 0;
499 virtual bool isDark()
const = 0;
506 const std::string&
id) = 0;
535 virtual void spawnEffect (
const std::string& model,
const std::string& textureOverride,
const osg::Vec3f& worldPos) = 0;
539 const std::string& sourceName,
const bool fromProjectile=
false) = 0;
virtual float getDistToNearestRayHit(const osg::Vec3f &from, const osg::Vec3f &dir, float maxDist, bool includeWater=false)=0
virtual std::string getMonthName(int month=-1) const =0
Return name of month (-1: current month)
virtual bool isSubmerged(const MWWorld::ConstPtr &object) const =0
Is the head of the creature underwater?
virtual bool isSlowFalling(const MWWorld::Ptr &ptr) const =0
virtual bool getPlayerStandingOn(const MWWorld::ConstPtr &object)=0
virtual void removeContainerScripts(const MWWorld::Ptr &reference)=0
virtual MWWorld::Ptr searchPtrViaActorId(int actorId)=0
Search is limited to the active cells.
virtual void queueMovement(const MWWorld::Ptr &ptr, const osg::Vec3f &velocity)=0
virtual void startNewGame(bool bypass)=0
virtual osg::Vec3f aimToTarget(const MWWorld::ConstPtr &actor, const MWWorld::ConstPtr &target)=0
virtual osg::Vec2f getNorthVector(const MWWorld::CellStore *cell)=0
get north vector for given interior cell
virtual osg::Matrixf getActorHeadTransform(const MWWorld::ConstPtr &actor) const =0
virtual void getContainersOwnedBy(const MWWorld::ConstPtr &npc, std::vector< MWWorld::Ptr > &out)=0
get all containers in active cells owned by this Npc
virtual void setGlobalFloat(const std::string &name, float value)=0
Set value independently from real type.
virtual float getGlobalFloat(const std::string &name) const =0
Get value independently from real type.
virtual MWWorld::Ptr findContainer(const MWWorld::ConstPtr &ptr)=0
virtual bool isCellExterior() const =0
virtual void setHour(double hour)=0
Set in-game time hour.
virtual void setupPlayer()=0
virtual bool toggleVanityMode(bool enable)=0
std::string name
Definition: world.hpp:89
virtual int getSecundaPhase() const =0
virtual void togglePreviewMode(bool enable)=0
Definition: animation.hpp:77
virtual void indexToPosition(int cellX, int cellY, float &x, float &y, bool centre=false) const =0
Convert cell numbers to position.
virtual void spawnBloodEffect(const MWWorld::Ptr &ptr, const osg::Vec3f &worldPosition)=0
Spawn a blood effect for ptr at worldPosition.
virtual void rotateObject(const MWWorld::Ptr &ptr, float x, float y, float z, bool adjust=false)=0
virtual void useDeathCamera()=0
virtual void spawnEffect(const std::string &model, const std::string &textureOverride, const osg::Vec3f &worldPos)=0
Interface for the World (implemented in MWWorld)
Definition: world.hpp:77
virtual MWWorld::Ptr safePlaceObject(const MWWorld::ConstPtr &ptr, const MWWorld::ConstPtr &referenceObject, MWWorld::CellStore *referenceCell, int direction, float distance)=0
virtual bool toggleScripts()=0
Definition: esmreader.hpp:21
virtual bool getScriptsEnabled() const =0
virtual bool isInStorm() const =0
virtual void enableTeleporting(bool enable)=0
Enables or disables use of teleport spell effects (recall, intervention, etc).
Definition: loadspel.hpp:14
virtual bool isTeleportingEnabled() const =0
Returns true if teleport spell effects are allowed.
virtual MWWorld::CellStore * getExterior(int x, int y)=0
virtual void changeWeather(const std::string ®ion, const unsigned int id)=0
Definition: loadarmo.hpp:66
virtual bool startSpellCast(const MWWorld::Ptr &actor)=0
startSpellCast attempt to start casting a spell. Might fail immediately if conditions are not met...
virtual bool vanityRotateCamera(float *rot)=0
virtual MWRender::Animation * getAnimation(const MWWorld::Ptr &ptr)=0
virtual bool isLevitationEnabled() const =0
Returns true if levitation spell effect is allowed.
virtual void advanceTime(double hours, bool incremental=false)=0
Advance in-game time.
NPC object representing the player and additional player data.
Definition: player.hpp:30
contains settings imported from the Morrowind INI file.
Definition: fallback.hpp:12
virtual MWWorld::CellStore * getInterior(const std::string &name)=0
virtual void getDoorMarkers(MWWorld::CellStore *cell, std::vector< DoorMarker > &out)=0
get a list of teleport door markers for a given cell, to be displayed on the local map ...
virtual const MWWorld::ESMStore & getStore() const =0
virtual std::pair< MWWorld::Ptr, osg::Vec3f > getHitContact(const MWWorld::ConstPtr &ptr, float distance)=0
virtual bool canPlaceObject(float cursorX, float cursorY)=0
virtual void scaleObject(const MWWorld::Ptr &ptr, float scale)=0
std::vector< std::pair< MWWorld::Ptr, MWMechanics::Movement > > PtrMovementList
Definition: world.hpp:64
virtual void deleteObject(const MWWorld::Ptr &ptr)=0
virtual void modRegion(const std::string ®ionid, const std::vector< char > &chances)=0
virtual osg::Vec3f getStormDirection() const =0
virtual bool getActorStandingOn(const MWWorld::ConstPtr &object)=0
virtual void launchMagicBolt(const std::string &spellId, bool stack, const ESM::EffectList &effects, const MWWorld::Ptr &caster, const std::string &sourceName, const osg::Vec3f &fallbackDirection)=0
virtual void resetActors()=0
Resets all actors in the current active cells to their original location within that cell...
virtual int getDay() const =0
virtual const Fallback::Map * getFallback() const =0
virtual bool getLOS(const MWWorld::ConstPtr &actor, const MWWorld::ConstPtr &targetActor)=0
get Line of Sight (morrowind stupid implementation)
virtual bool toggleGodMode()=0
virtual int getYear() const =0
virtual void breakInvisibility(const MWWorld::Ptr &actor)=0
World & operator=(const World &)
not implemented
virtual void spawnRandomCreature(const std::string &creatureList)=0
Spawn a random creature from a levelled list next to the player.
Definition: world.hpp:512
float y
Definition: world.hpp:90
virtual void setDay(int day)=0
Set in-game time day.
Definition: loadinglistener.hpp:8
virtual MWWorld::Ptr dropObjectOnGround(const MWWorld::Ptr &actor, const MWWorld::ConstPtr &object, int amount)=0
virtual void changeToCell(const ESM::CellId &cellId, const ESM::Position &position, bool adjustPlayerPos, bool changeEvent=true)=0
virtual int getMasserPhase() const =0
virtual void goToJail()=0
virtual bool castRay(float x1, float y1, float z1, float x2, float y2, float z2)=0
cast a Ray and return true if there is an object in the ray path.
virtual bool isWading(const MWWorld::ConstPtr &object) const =0
RangeType
Definition: defs.hpp:27
virtual MWWorld::LocalScripts & getLocalScripts()=0
virtual void positionToIndex(float x, float y, int &cellX, int &cellY) const =0
Convert position to cell numbers.
Definition: refdata.hpp:29
virtual void update(float duration, bool paused)=0
virtual MWWorld::Ptr getPtr(const std::string &name, bool activeOnly)=0
virtual float getDistanceToFacedObject()=0
virtual void preloadCommonAssets()=0
virtual void hurtCollidingActors(const MWWorld::ConstPtr &object, float dmgPerSecond)=0
virtual void renderPlayer()=0
virtual void changeToExteriorCell(const ESM::Position &position, bool adjustPlayerPos, bool changeEvent=true)=0
Definition: esmwriter.hpp:17
virtual MWWorld::Ptr moveObject(const MWWorld::Ptr &ptr, float x, float y, float z)=0
virtual ~World()
Definition: world.hpp:96
virtual void write(ESM::ESMWriter &writer, Loading::Listener &listener) const =0
virtual bool isCellQuasiExterior() const =0
virtual bool findExteriorPosition(const std::string &name, ESM::Position &pos)=0
virtual bool getActorCollidingWith(const MWWorld::ConstPtr &object)=0
Definition: esmstore.hpp:17
virtual bool getPlayerCollidingWith(const MWWorld::ConstPtr &object)=0
virtual const std::vector< std::string > & getContentFiles() const =0
Definition: world.hpp:511
virtual int countSavedGameRecords() const =0
virtual void castSpell(const MWWorld::Ptr &actor)=0
virtual char getGlobalVariableType(const std::string &name) const =0
Return ' ', if there is no global variable with this name.
Definition: loadnpc.hpp:23
virtual bool getGodModeState()=0
virtual void getItemsOwnedBy(const MWWorld::ConstPtr &npc, std::vector< MWWorld::Ptr > &out)=0
get all items in active cells owned by this Npc
ESM::CellId dest
Definition: world.hpp:91
virtual void activateDoor(const MWWorld::Ptr &door)=0
open or close a non-teleport door (depending on current state)
virtual void markCellAsUnchanged()=0
virtual void allowVanityMode(bool allow)=0
Mutable state of a cell.
Definition: cellstore.hpp:53
virtual MWWorld::CellStore * getCell(const ESM::CellId &id)=0
virtual void fixPosition(const MWWorld::Ptr &actor)=0
Attempt to fix position so that the Ptr is no longer inside collision geometry.
virtual bool toggleWater()=0
virtual void setCameraDistance(float dist, bool adjust=false, bool override=true)=0
Pointer to a const LiveCellRef.
Definition: ptr.hpp:90
virtual int countSavedGameCells() const =0
virtual float getTerrainHeightAt(const osg::Vec3f &worldPos) const =0
Return terrain height at worldPos position.
virtual int getCurrentWeather() const =0
virtual bool isWaterWalkingCastableOnTarget(const MWWorld::ConstPtr &target) const =0
virtual const ESM::Potion * createRecord(const ESM::Potion &record)=0
virtual void undeleteObject(const MWWorld::Ptr &ptr)=0
virtual void processChangedSettings(const std::set< std::pair< std::string, std::string > > &settings)=0
Definition: loadlevlist.hpp:46
virtual void setWaterHeight(const float height)=0
float distance(const ESM::Pathgrid::Point &point, float x, float y, float z)
Definition: pathfinding.cpp:69
virtual void activate(const MWWorld::Ptr &object, const MWWorld::Ptr &actor)=0
Definition: loadcell.hpp:64
virtual bool toggleRenderMode(MWRender::RenderMode mode)=0
virtual std::string getCellName(const MWWorld::CellStore *cell=0) const =0
virtual void explodeSpell(const osg::Vec3f &origin, const ESM::EffectList &effects, const MWWorld::Ptr &caster, const MWWorld::Ptr &ignore, ESM::RangeType rangeType, const std::string &id, const std::string &sourceName, const bool fromProjectile=false)=0
In-game time stamp.
Definition: timestamp.hpp:14
virtual void disable(const MWWorld::Ptr &ptr)=0
virtual int getMonth() const =0
virtual float getWindSpeed()=0
virtual bool isSwimming(const MWWorld::ConstPtr &object) const =0
virtual void launchProjectile(MWWorld::Ptr actor, MWWorld::ConstPtr projectile, const osg::Vec3f &worldPos, const osg::Quat &orient, MWWorld::Ptr bow, float speed, float attackStrength)=0
virtual bool isPlayerInJail() const =0
virtual bool toggleWorld()=0
Definition: loadclot.hpp:18
virtual bool isFlying(const MWWorld::Ptr &ptr) const =0
virtual MWWorld::Ptr placeObject(const MWWorld::ConstPtr &ptr, MWWorld::CellStore *cell, ESM::Position pos)=0
Place an object. Makes a copy of the Ptr.
virtual void teleportToClosestMarker(const MWWorld::Ptr &ptr, const std::string &id)=0
Definition: world.hpp:510
virtual bool isWalkingOnWater(const MWWorld::ConstPtr &actor) const =0
virtual void adjustPosition(const MWWorld::Ptr &ptr, bool force)=0
List of active local scripts.
Definition: localscripts.hpp:16
virtual float getTimeScaleFactor() const =0
Definition: loadclas.hpp:18
virtual void changeToInteriorCell(const std::string &cellName, const ESM::Position &position, bool adjustPlayerPos, bool changeEvent=true)=0
virtual MWWorld::Player & getPlayer()=0
virtual void enable(const MWWorld::Ptr &ptr)=0
virtual void updateDialogueGlobals()=0
World()
Definition: world.hpp:94
virtual void togglePlayerLooking(bool enable)=0
virtual void listDetectedReferences(const MWWorld::Ptr &ptr, std::vector< MWWorld::Ptr > &out, DetectionType type)=0
virtual bool findInteriorPositionInWorldSpace(const MWWorld::CellStore *cell, osg::Vec3f &result)=0
virtual bool isUnderwater(const MWWorld::CellStore *cell, const osg::Vec3f &pos) const =0
virtual MWWorld::Ptr searchPtr(const std::string &name, bool activeOnly)=0
virtual std::vector< ESM::ESMReader > & getEsmReader()=0
virtual bool toggleSky()=0
virtual void reattachPlayerCamera()=0
virtual void setGlobalInt(const std::string &name, int value)=0
Set value independently from real type.
virtual void changeVanityModeScale(float factor)=0
virtual void enableLevitation(bool enable)=0
Enables or disables use of levitation spell effect.
Definition: loadlevlist.hpp:66
virtual float getMaxActivationDistance()=0
virtual MWWorld::Ptr getPlayerPtr()=0
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
virtual bool hasCellChanged() const =0
Has the set of active cells changed, since the last frame?
Definition: loadench.hpp:18
virtual void setMoonColour(bool red)=0
virtual void adjustSky()=0
Definition: loadalch.hpp:18
virtual int getGlobalInt(const std::string &name) const =0
Get value independently from real type.
float x
Definition: world.hpp:90
virtual float getHitDistance(const MWWorld::ConstPtr &actor, const MWWorld::ConstPtr &target)=0
Return the distance between actor's weapon and target's collision box.
virtual bool isOnGround(const MWWorld::Ptr &ptr) const =0
virtual MWWorld::TimeStamp getTimeStamp() const =0
Return current in-game time stamp.
virtual void screenshot(osg::Image *image, int w, int h)=0
Definition: cellid.hpp:11
virtual bool isDark() const =0
DetectionType
Definition: world.hpp:508
virtual void enableActorCollision(const MWWorld::Ptr &actor, bool enable)=0
virtual bool findInteriorPosition(const std::string &name, ESM::Position &pos)=0
EffectList, ENAM subrecord.
Definition: effectlist.hpp:33
virtual const ESM::CreatureLevList * createOverrideRecord(const ESM::CreatureLevList &record)=0
virtual void confiscateStolenItems(const MWWorld::Ptr &ptr)=0
Moves all stolen items from ptr to the closest evidence chest.
virtual void removeRefScript(MWWorld::RefData *ref)=0
virtual void togglePOV()=0
virtual void setMonth(int month)=0
Set in-game time month.
Definition: loadbook.hpp:15
virtual bool toggleCollisionMode()=0
virtual MWWorld::Ptr getFacedObject()=0
Return pointer to the object the player is looking at, if it is within activation range...
RenderMode
Definition: rendermode.hpp:7
virtual void readRecord(ESM::ESMReader &reader, uint32_t type, const std::map< int, int > &contentFileMap)=0
virtual bool isFirstPerson() const =0
virtual void hurtStandingActors(const MWWorld::ConstPtr &object, float dmgPerSecond)=0
Definition: loadweap.hpp:16
const char * name
Definition: crashcatcher.cpp:59
virtual osg::Vec3f getHalfExtents(const MWWorld::ConstPtr &actor, bool rendering=false) const =0
Return physical or rendering half extents of the given actor.