1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 20:19:56 +00:00
openmw-tes3mp/apps/openmw/mwbase/world.hpp

626 lines
28 KiB
C++
Raw Normal View History

#ifndef GAME_MWBASE_WORLD_H
#define GAME_MWBASE_WORLD_H
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <components/esm/cellid.hpp>
#include "../mwworld/ptr.hpp"
2015-05-02 20:45:27 +00:00
#include "../mwrender/rendermode.hpp"
2015-04-19 15:55:56 +00:00
namespace osg
{
class Vec3f;
class Matrixf;
2015-05-30 23:07:43 +00:00
class Quat;
2015-06-03 14:40:16 +00:00
class Image;
2015-04-19 15:55:56 +00:00
}
2015-01-31 22:27:34 +00:00
namespace Loading
{
2015-01-31 22:27:34 +00:00
class Listener;
}
namespace ESM
{
class ESMReader;
2013-12-07 12:17:28 +00:00
class ESMWriter;
struct Position;
struct Cell;
struct Class;
struct Potion;
2012-10-15 19:54:19 +00:00
struct Spell;
2012-11-08 12:37:57 +00:00
struct NPC;
2014-02-23 19:11:05 +00:00
struct Armor;
struct Weapon;
struct Clothing;
struct Enchantment;
struct Book;
struct EffectList;
struct CreatureLevList;
struct ItemLevList;
}
namespace MWRender
{
class Animation;
}
namespace MWMechanics
{
struct Movement;
}
2018-03-13 22:49:08 +00:00
namespace DetourNavigator
{
2019-02-16 12:27:02 +00:00
struct Navigator;
2018-03-13 22:49:08 +00:00
}
namespace MWWorld
{
class CellStore;
class Player;
class LocalScripts;
class TimeStamp;
2012-10-01 15:17:04 +00:00
class ESMStore;
class RefData;
typedef std::vector<std::pair<MWWorld::Ptr,MWMechanics::Movement> > PtrMovementList;
}
2016-01-06 11:46:06 +00:00
namespace Fallback
{
class Map;
}
namespace MWBase
{
/// \brief Interface for the World (implemented in MWWorld)
class World
{
World (const World&);
///< not implemented
World& operator= (const World&);
///< not implemented
public:
2012-08-28 15:30:34 +00:00
struct DoorMarker
{
std::string name;
float x, y; // world position
ESM::CellId dest;
2012-08-28 15:30:34 +00:00
};
World() {}
virtual ~World() {}
virtual void startNewGame (bool bypass) = 0;
///< \param bypass Bypass regular game start.
2013-05-15 15:54:18 +00:00
virtual void clear() = 0;
2013-12-07 12:17:28 +00:00
virtual int countSavedGameRecords() const = 0;
virtual int countSavedGameCells() const = 0;
2013-12-07 12:17:28 +00:00
virtual void write (ESM::ESMWriter& writer, Loading::Listener& listener) const = 0;
2013-12-07 12:17:28 +00:00
2015-01-22 18:04:59 +00:00
virtual void readRecord (ESM::ESMReader& reader, uint32_t type,
const std::map<int, int>& contentFileMap) = 0;
2013-12-07 12:17:28 +00:00
virtual MWWorld::CellStore *getExterior (int x, int y) = 0;
virtual MWWorld::CellStore *getInterior (const std::string& name) = 0;
virtual MWWorld::CellStore *getCell (const ESM::CellId& id) = 0;
virtual void useDeathCamera() = 0;
virtual void setWaterHeight(const float height) = 0;
virtual bool toggleWater() = 0;
2014-09-30 13:53:27 +00:00
virtual bool toggleWorld() = 0;
2018-06-12 23:48:31 +00:00
virtual bool toggleBorders() = 0;
virtual void adjustSky() = 0;
2016-01-06 11:46:06 +00:00
virtual const Fallback::Map *getFallback () const = 0;
virtual MWWorld::Player& getPlayer() = 0;
virtual MWWorld::Ptr getPlayerPtr() = 0;
virtual MWWorld::ConstPtr getPlayerConstPtr() const = 0;
2012-10-01 15:17:04 +00:00
virtual const MWWorld::ESMStore& getStore() const = 0;
virtual std::vector<ESM::ESMReader>& getEsmReader() = 0;
virtual MWWorld::LocalScripts& getLocalScripts() = 0;
virtual bool hasCellChanged() const = 0;
///< Has the set of active cells changed, since the last frame?
virtual bool isCellExterior() const = 0;
virtual bool isCellQuasiExterior() const = 0;
virtual osg::Vec2f getNorthVector (const MWWorld::CellStore* cell) = 0;
///< get north vector for given interior cell
virtual void getDoorMarkers (MWWorld::CellStore* cell, std::vector<DoorMarker>& out) = 0;
2012-08-28 15:30:34 +00:00
///< get a list of teleport door markers for a given cell, to be displayed on the local map
virtual void setGlobalInt (const std::string& name, int value) = 0;
///< Set value independently from real type.
virtual void setGlobalFloat (const std::string& name, float value) = 0;
///< Set value independently from real type.
virtual int getGlobalInt (const std::string& name) const = 0;
///< Get value independently from real type.
virtual float getGlobalFloat (const std::string& name) const = 0;
///< Get value independently from real type.
virtual char getGlobalVariableType (const std::string& name) const = 0;
///< Return ' ', if there is no global variable with this name.
2013-03-18 07:29:40 +00:00
virtual std::string getCellName (const MWWorld::CellStore *cell = 0) const = 0;
///< Return name of the cell.
///
/// \note If cell==0, the cell the player is currently in will be used instead to
/// generate a name.
virtual void removeRefScript (MWWorld::RefData *ref) = 0;
//< Remove the script attached to ref from mLocalScripts
virtual MWWorld::Ptr getPtr (const std::string& name, bool activeOnly) = 0;
///< Return a pointer to a liveCellRef with the given name.
/// \param activeOnly do non search inactive cells.
virtual MWWorld::Ptr searchPtr (const std::string& name, bool activeOnly) = 0;
///< Return a pointer to a liveCellRef with the given name.
/// \param activeOnly do non search inactive cells.
2014-04-29 13:27:49 +00:00
virtual MWWorld::Ptr searchPtrViaActorId (int actorId) = 0;
///< Search is limited to the active cells.
virtual MWWorld::Ptr findContainer (const MWWorld::ConstPtr& ptr) = 0;
///< Return a pointer to a liveCellRef which contains \a ptr.
/// \note Search is limited to the active cells.
virtual void enable (const MWWorld::Ptr& ptr) = 0;
virtual void disable (const MWWorld::Ptr& ptr) = 0;
virtual void advanceTime (double hours, bool incremental = false) = 0;
///< Advance in-game time.
virtual void setHour (double hour) = 0;
///< Set in-game time hour.
virtual void setMonth (int month) = 0;
///< Set in-game time month.
virtual void setDay (int day) = 0;
///< Set in-game time day.
virtual int getDay() const = 0;
virtual int getMonth() const = 0;
2013-11-28 08:27:10 +00:00
virtual int getYear() const = 0;
virtual std::string getMonthName (int month = -1) const = 0;
///< Return name of month (-1: current month)
2012-09-18 18:53:32 +00:00
virtual MWWorld::TimeStamp getTimeStamp() const = 0;
///< Return current in-game time stamp.
virtual bool toggleSky() = 0;
///< \return Resulting mode
2016-10-05 14:32:26 +00:00
virtual void changeWeather(const std::string& region, const unsigned int id) = 0;
virtual int getCurrentWeather() const = 0;
virtual unsigned int getNightDayMode() const = 0;
virtual int getMasserPhase() const = 0;
virtual int getSecundaPhase() const = 0;
virtual void setMoonColour (bool red) = 0;
virtual void modRegion(const std::string &regionid, const std::vector<char> &chances) = 0;
virtual float getTimeScaleFactor() const = 0;
virtual void changeToInteriorCell (const std::string& cellName, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent=true) = 0;
///< Move to interior cell.
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
virtual void changeToExteriorCell (const ESM::Position& position, bool adjustPlayerPos, bool changeEvent=true) = 0;
///< Move to exterior cell.
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
virtual void changeToCell (const ESM::CellId& cellId, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent=true) = 0;
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
virtual const ESM::Cell *getExterior (const std::string& cellName) const = 0;
///< Return a cell matching the given name or a 0-pointer, if there is no such cell.
virtual void markCellAsUnchanged() = 0;
virtual MWWorld::Ptr getFacedObject() = 0;
///< Return pointer to the object the player is looking at, if it is within activation range
virtual float getDistanceToFacedObject() = 0;
virtual float getMaxActivationDistance() = 0;
/// 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, or alternatively the "Bip01 Head" node as a basis.
virtual std::pair<MWWorld::Ptr,osg::Vec3f> getHitContact(const MWWorld::ConstPtr &ptr, float distance, std::vector<MWWorld::Ptr> &targets) = 0;
virtual void adjustPosition (const MWWorld::Ptr& ptr, bool force) = 0;
///< Adjust position after load to be on ground. Must be called after model load.
/// @param force do this even if the ptr is flying
2018-10-23 22:40:57 +00:00
virtual void fixPosition () = 0;
///< Attempt to fix position so that the player is not stuck inside the geometry.
/// @note No-op for items in containers. Use ContainerStore::removeItem instead.
virtual void deleteObject (const MWWorld::Ptr& ptr) = 0;
virtual void undeleteObject (const MWWorld::Ptr& ptr) = 0;
virtual MWWorld::Ptr moveObject (const MWWorld::Ptr& ptr, float x, float y, float z, bool moveToActive=false) = 0;
///< @return an updated Ptr in case the Ptr's cell changes
virtual MWWorld::Ptr moveObject(const MWWorld::Ptr &ptr, MWWorld::CellStore* newCell, float x, float y, float z, bool movePhysics=true) = 0;
///< @return an updated Ptr
2012-07-09 16:47:59 +00:00
virtual void scaleObject (const MWWorld::Ptr& ptr, float scale) = 0;
virtual void rotateObject(const MWWorld::Ptr& ptr,float x,float y,float z, bool adjust = false) = 0;
2016-02-29 16:05:18 +00:00
virtual MWWorld::Ptr placeObject(const MWWorld::ConstPtr& ptr, MWWorld::CellStore* cell, ESM::Position pos) = 0;
2016-02-29 16:16:33 +00:00
///< Place an object. Makes a copy of the Ptr.
virtual MWWorld::Ptr safePlaceObject (const MWWorld::ConstPtr& ptr, const MWWorld::ConstPtr& referenceObject, MWWorld::CellStore* referenceCell, int direction, float distance) = 0;
///< Place an object in a safe place next to \a referenceObject. \a direction and \a distance specify the wanted placement
/// relative to \a referenceObject (but the object may be placed somewhere else if the wanted location is obstructed).
2012-09-17 11:36:48 +00:00
virtual void indexToPosition (int cellX, int cellY, float &x, float &y, bool centre = false)
const = 0;
///< Convert cell numbers to position.
virtual void positionToIndex (float x, float y, int &cellX, int &cellY) const = 0;
///< Convert position to cell numbers
virtual void queueMovement(const MWWorld::Ptr &ptr, const osg::Vec3f &velocity) = 0;
///< Queues movement for \a ptr (in local space), to be applied in the next call to
/// doPhysics.
virtual void updateAnimatedCollisionShape(const MWWorld::Ptr &ptr) = 0;
virtual bool castRay (float x1, float y1, float z1, float x2, float y2, float z2, int mask) = 0;
///< cast a Ray and return true if there is an object in the ray path.
virtual bool castRay (float x1, float y1, float z1, float x2, float y2, float z2) = 0;
virtual void setActorCollisionMode(const MWWorld::Ptr& ptr, bool internal, bool external) = 0;
virtual bool isActorCollisionEnabled(const MWWorld::Ptr& ptr) = 0;
virtual bool toggleCollisionMode() = 0;
///< Toggle collision mode for player. If disabled player object should ignore
/// collisions and gravity.
2012-09-18 09:06:19 +00:00
/// \return Resulting mode
2015-05-02 20:45:27 +00:00
virtual bool toggleRenderMode (MWRender::RenderMode mode) = 0;
///< Toggle a render mode.
///< \return Resulting mode
2013-03-28 16:41:00 +00:00
virtual const ESM::Potion *createRecord (const ESM::Potion& record) = 0;
///< Create a new record (of type potion) in the ESM store.
2012-11-08 15:01:42 +00:00
/// \return pointer to created record
2013-03-28 16:41:00 +00:00
virtual const ESM::Spell *createRecord (const ESM::Spell& record) = 0;
///< Create a new record (of type spell) in the ESM store.
2012-11-08 15:01:42 +00:00
/// \return pointer to created record
2012-10-15 19:54:19 +00:00
2013-03-28 16:41:00 +00:00
virtual const ESM::Class *createRecord (const ESM::Class& record) = 0;
///< Create a new record (of type class) in the ESM store.
2012-11-08 15:01:42 +00:00
/// \return pointer to created record
virtual const ESM::Cell *createRecord (const ESM::Cell& record) = 0;
2013-03-28 16:41:00 +00:00
///< Create a new record (of type cell) in the ESM store.
2012-11-08 15:01:42 +00:00
/// \return pointer to created record
2012-11-08 12:37:57 +00:00
virtual const ESM::NPC *createRecord(const ESM::NPC &record) = 0;
2013-03-28 16:41:00 +00:00
///< Create a new record (of type npc) in the ESM store.
/// \return pointer to created record
virtual const ESM::Armor *createRecord (const ESM::Armor& record) = 0;
///< Create a new record (of type armor) in the ESM store.
/// \return pointer to created record
virtual const ESM::Weapon *createRecord (const ESM::Weapon& record) = 0;
///< Create a new record (of type weapon) in the ESM store.
/// \return pointer to created record
virtual const ESM::Clothing *createRecord (const ESM::Clothing& record) = 0;
///< Create a new record (of type clothing) in the ESM store.
/// \return pointer to created record
virtual const ESM::Enchantment *createRecord (const ESM::Enchantment& record) = 0;
///< Create a new record (of type enchantment) in the ESM store.
/// \return pointer to created record
virtual const ESM::Book *createRecord (const ESM::Book& record) = 0;
///< Create a new record (of type book) in the ESM store.
2012-11-08 15:01:42 +00:00
/// \return pointer to created record
2012-11-08 12:37:57 +00:00
virtual const ESM::CreatureLevList *createOverrideRecord (const ESM::CreatureLevList& record) = 0;
///< Write this record to the ESM store, allowing it to override a pre-existing record with the same ID.
/// \return pointer to created record
virtual const ESM::ItemLevList *createOverrideRecord (const ESM::ItemLevList& record) = 0;
///< Write this record to the ESM store, allowing it to override a pre-existing record with the same ID.
/// \return pointer to created record
virtual void update (float duration, bool paused) = 0;
virtual void updatePhysics (float duration, bool paused) = 0;
virtual void updateWindowManager () = 0;
2015-12-18 16:42:59 +00:00
virtual MWWorld::Ptr placeObject (const MWWorld::ConstPtr& object, float cursorX, float cursorY, int amount) = 0;
///< copy and place an object into the gameworld at the specified cursor position
/// @param object
/// @param cursor X (relative 0-1)
/// @param cursor Y (relative 0-1)
/// @param number of objects to place
2015-12-18 16:42:59 +00:00
virtual MWWorld::Ptr dropObjectOnGround (const MWWorld::Ptr& actor, const MWWorld::ConstPtr& object, int amount) = 0;
///< copy and place an object into the gameworld at the given actor's position
/// @param actor giving the dropped object position
/// @param object
/// @param number of objects to place
virtual bool canPlaceObject (float cursorX, float cursorY) = 0;
///< @return true if it is possible to place on object at specified cursor location
virtual void processChangedSettings (const std::set< std::pair<std::string, std::string> >& settings) = 0;
virtual bool isFlying(const MWWorld::Ptr &ptr) const = 0;
2013-10-02 20:53:29 +00:00
virtual bool isSlowFalling(const MWWorld::Ptr &ptr) const = 0;
virtual bool isSwimming(const MWWorld::ConstPtr &object) const = 0;
virtual bool isWading(const MWWorld::ConstPtr &object) const = 0;
///Is the head of the creature underwater?
virtual bool isSubmerged(const MWWorld::ConstPtr &object) const = 0;
2015-06-01 19:41:13 +00:00
virtual bool isUnderwater(const MWWorld::CellStore* cell, const osg::Vec3f &pos) const = 0;
virtual bool isUnderwater(const MWWorld::ConstPtr &object, const float heightRatio) const = 0;
virtual bool isWaterWalkingCastableOnTarget(const MWWorld::ConstPtr &target) const = 0;
virtual bool isOnGround(const MWWorld::Ptr &ptr) const = 0;
2012-08-12 11:50:37 +00:00
virtual osg::Matrixf getActorHeadTransform(const MWWorld::ConstPtr& actor) const = 0;
2012-08-12 11:50:37 +00:00
virtual void togglePOV() = 0;
virtual bool isFirstPerson() const = 0;
2012-08-14 10:37:48 +00:00
virtual void togglePreviewMode(bool enable) = 0;
2013-04-27 08:24:36 +00:00
virtual bool toggleVanityMode(bool enable) = 0;
2012-08-14 10:37:48 +00:00
virtual void allowVanityMode(bool allow) = 0;
virtual void togglePlayerLooking(bool enable) = 0;
virtual void changeVanityModeScale(float factor) = 0;
virtual bool vanityRotateCamera(float * rot) = 0;
virtual void setCameraDistance(float dist, bool adjust = false, bool override = true)=0;
2012-08-14 16:33:29 +00:00
2013-04-29 15:56:16 +00:00
virtual void setupPlayer() = 0;
2012-08-14 16:33:29 +00:00
virtual void renderPlayer() = 0;
2013-03-18 07:29:40 +00:00
/// open or close a non-teleport door (depending on current state)
2013-04-28 12:59:15 +00:00
virtual void activateDoor(const MWWorld::Ptr& door) = 0;
/// update movement state of a non-teleport door as specified
/// @param state see MWClass::setDoorState
/// @note throws an exception when invoked on a teleport door
virtual void activateDoor(const MWWorld::Ptr& door, int state) = 0;
2013-04-28 12:59:15 +00:00
virtual void getActorsStandingOn (const MWWorld::ConstPtr& object, std::vector<MWWorld::Ptr> &actors) = 0; ///< get a list of actors standing on \a object
virtual bool getPlayerStandingOn (const MWWorld::ConstPtr& object) = 0; ///< @return true if the player is standing on \a object
virtual bool getActorStandingOn (const MWWorld::ConstPtr& object) = 0; ///< @return true if any actor is standing on \a object
virtual bool getPlayerCollidingWith(const MWWorld::ConstPtr& object) = 0; ///< @return true if the player is colliding with \a object
virtual bool getActorCollidingWith (const MWWorld::ConstPtr& object) = 0; ///< @return true if any actor is colliding with \a object
virtual void hurtStandingActors (const MWWorld::ConstPtr& object, float dmgPerSecond) = 0;
///< Apply a health difference to any actors standing on \a object.
/// To hurt actors, healthPerSecond should be a positive value. For a negative value, actors will be healed.
virtual void hurtCollidingActors (const MWWorld::ConstPtr& object, float dmgPerSecond) = 0;
///< Apply a health difference to any actors colliding with \a object.
/// To hurt actors, healthPerSecond should be a positive value. For a negative value, actors will be healed.
2013-05-01 09:42:24 +00:00
virtual float getWindSpeed() = 0;
virtual void getContainersOwnedBy (const MWWorld::ConstPtr& npc, std::vector<MWWorld::Ptr>& out) = 0;
2013-05-11 16:38:27 +00:00
///< get all containers in active cells owned by this Npc
virtual void getItemsOwnedBy (const MWWorld::ConstPtr& npc, std::vector<MWWorld::Ptr>& out) = 0;
2013-05-27 00:18:36 +00:00
///< get all items in active cells owned by this Npc
2013-05-11 16:38:27 +00:00
2015-12-18 17:02:57 +00:00
virtual bool getLOS(const MWWorld::ConstPtr& actor,const MWWorld::ConstPtr& targetActor) = 0;
///< get Line of Sight (morrowind stupid implementation)
virtual float getDistToNearestRayHit(const osg::Vec3f& from, const osg::Vec3f& dir, float maxDist, bool includeWater = false) = 0;
2014-04-20 16:35:07 +00:00
2013-06-27 21:11:20 +00:00
virtual void enableActorCollision(const MWWorld::Ptr& actor, bool enable) = 0;
enum RestPermitted
{
Rest_Allowed = 0,
Rest_OnlyWaiting = 1,
Rest_PlayerIsUnderwater = 2,
Rest_EnemiesAreNearby = 3
};
/// check if the player is allowed to rest
2018-09-23 03:25:20 +00:00
virtual RestPermitted canRest() const = 0;
2012-09-25 00:35:50 +00:00
/// \todo Probably shouldn't be here
virtual MWRender::Animation* getAnimation(const MWWorld::Ptr &ptr) = 0;
virtual const MWRender::Animation* getAnimation(const MWWorld::ConstPtr &ptr) const = 0;
virtual void reattachPlayerCamera() = 0;
2012-09-25 00:35:50 +00:00
/// \todo this does not belong here
2015-06-03 14:40:16 +00:00
virtual void screenshot (osg::Image* image, int w, int h) = 0;
virtual bool screenshot360 (osg::Image* image, std::string settingStr) = 0;
/// Find default position inside exterior cell specified by name
/// \return false if exterior with given name not exists, true otherwise
virtual bool findExteriorPosition(const std::string &name, ESM::Position &pos) = 0;
/// Find default position inside interior cell specified by name
/// \return false if interior with given name not exists, true otherwise
virtual bool findInteriorPosition(const std::string &name, ESM::Position &pos) = 0;
/// Enables or disables use of teleport spell effects (recall, intervention, etc).
virtual void enableTeleporting(bool enable) = 0;
/// Returns true if teleport spell effects are allowed.
virtual bool isTeleportingEnabled() const = 0;
/// Enables or disables use of levitation spell effect.
virtual void enableLevitation(bool enable) = 0;
/// Returns true if levitation spell effect is allowed.
virtual bool isLevitationEnabled() const = 0;
virtual bool getGodModeState() = 0;
virtual bool toggleGodMode() = 0;
2015-02-10 19:25:57 +00:00
virtual bool toggleScripts() = 0;
virtual bool getScriptsEnabled() const = 0;
/**
* @brief startSpellCast attempt to start casting a spell. Might fail immediately if conditions are not met.
* @param actor
* @return true if the spell can be casted (i.e. the animation should start)
*/
virtual bool startSpellCast (const MWWorld::Ptr& actor) = 0;
virtual void castSpell (const MWWorld::Ptr& actor, bool manualSpell=false) = 0;
2013-10-25 20:16:52 +00:00
virtual void launchMagicBolt (const std::string& spellId, const MWWorld::Ptr& caster, const osg::Vec3f& fallbackDirection) = 0;
virtual void launchProjectile (MWWorld::Ptr& actor, MWWorld::Ptr& projectile,
const osg::Vec3f& worldPos, const osg::Quat& orient, MWWorld::Ptr& bow, float speed, float attackStrength) = 0;
2013-12-08 22:36:37 +00:00
virtual void applyLoopingParticles(const MWWorld::Ptr& ptr) = 0;
virtual const std::vector<std::string>& getContentFiles() const = 0;
2013-12-08 22:36:37 +00:00
virtual void breakInvisibility (const MWWorld::Ptr& actor) = 0;
// Allow NPCs to use torches?
virtual bool useTorches() const = 0;
virtual bool findInteriorPositionInWorldSpace(const MWWorld::CellStore* cell, osg::Vec3f& result) = 0;
/// Teleports \a ptr to the closest reference of \a id (e.g. DivineMarker, PrisonMarker, TempleMarker)
/// @note id must be lower case
virtual void teleportToClosestMarker (const MWWorld::Ptr& ptr,
const std::string& id) = 0;
enum DetectionType
{
Detect_Enchantment,
Detect_Key,
Detect_Creature
};
/// List all references (filtered by \a type) detected by \a ptr. The range
/// is determined by the current magnitude of the "Detect X" magic effect belonging to \a type.
/// @note This also works for references in containers.
virtual void listDetectedReferences (const MWWorld::Ptr& ptr, std::vector<MWWorld::Ptr>& out,
DetectionType type) = 0;
/// Update the value of some globals according to the world state, which may be used by dialogue entries.
/// This should be called when initiating a dialogue.
virtual void updateDialogueGlobals() = 0;
2014-01-11 02:29:41 +00:00
/// Moves all stolen items from \a ptr to the closest evidence chest.
virtual void confiscateStolenItems(const MWWorld::Ptr& ptr) = 0;
2014-01-11 05:47:58 +00:00
virtual void goToJail () = 0;
/// Spawn a random creature from a levelled list next to the player
virtual void spawnRandomCreature(const std::string& creatureList) = 0;
2014-01-17 09:52:44 +00:00
/// Spawn a blood effect for \a ptr at \a worldPosition
2015-04-19 15:55:56 +00:00
virtual void spawnBloodEffect (const MWWorld::Ptr& ptr, const osg::Vec3f& worldPosition) = 0;
2018-07-15 08:44:25 +00:00
virtual void spawnEffect (const std::string& model, const std::string& textureOverride, const osg::Vec3f& worldPos, float scale = 1.f, bool isMagicVFX = true) = 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;
virtual void activate (const MWWorld::Ptr& object, const MWWorld::Ptr& actor) = 0;
/// @see MWWorld::WeatherManager::isInStorm
virtual bool isInStorm() const = 0;
/// @see MWWorld::WeatherManager::getStormDirection
virtual osg::Vec3f getStormDirection() const = 0;
/// Resets all actors in the current active cells to their original location within that cell.
virtual void resetActors() = 0;
2014-10-05 20:24:11 +00:00
virtual bool isWalkingOnWater (const MWWorld::ConstPtr& actor) const = 0;
/// Return a vector aiming the actor's weapon towards a target.
/// @note The length of the vector is the distance between actor and target.
virtual osg::Vec3f aimToTarget(const MWWorld::ConstPtr& actor, const MWWorld::ConstPtr& target) = 0;
/// Return the distance between actor's weapon and target's collision box.
virtual float getHitDistance(const MWWorld::ConstPtr& actor, const MWWorld::ConstPtr& target) = 0;
virtual void removeContainerScripts(const MWWorld::Ptr& reference) = 0;
virtual bool isPlayerInJail() const = 0;
2016-11-16 19:15:25 +00:00
virtual void rest(double hours) = 0;
virtual void setPlayerTraveling(bool traveling) = 0;
virtual bool isPlayerTraveling() const = 0;
virtual void rotateWorldObject (const MWWorld::Ptr& ptr, osg::Quat rotate) = 0;
2016-11-16 19:15:25 +00:00
/// Return terrain height at \a worldPos position.
virtual float getTerrainHeightAt(const osg::Vec3f& worldPos) const = 0;
/// Return physical or rendering half extents of the given actor.
virtual osg::Vec3f getHalfExtents(const MWWorld::ConstPtr& actor, bool rendering=false) const = 0;
/// Export scene graph to a file and return the filename.
/// \param ptr object to export scene graph for (if empty, export entire scene graph)
virtual std::string exportSceneGraph(const MWWorld::Ptr& ptr) = 0;
/// Preload VFX associated with this effect list
virtual void preloadEffects(const ESM::EffectList* effectList) = 0;
2018-03-13 22:49:08 +00:00
virtual DetourNavigator::Navigator* getNavigator() const = 0;
virtual void updateActorPath(const MWWorld::ConstPtr& actor, const std::deque<osg::Vec3f>& path,
const osg::Vec3f& halfExtents, const osg::Vec3f& start, const osg::Vec3f& end) const = 0;
virtual void removeActorPath(const MWWorld::ConstPtr& actor) const = 0;
virtual void setNavMeshNumberToRender(const std::size_t value) = 0;
/// Return physical half extents of the given actor to be used in pathfinding
virtual osg::Vec3f getPathfindingHalfExtents(const MWWorld::ConstPtr& actor) const = 0;
};
}
#endif