2012-07-02 23:06:38 +00:00
|
|
|
#ifndef GAME_MWBASE_WORLD_H
|
|
|
|
#define GAME_MWBASE_WORLD_H
|
|
|
|
|
|
|
|
#include <vector>
|
2014-01-27 12:27:42 +00:00
|
|
|
#include <map>
|
2012-07-02 23:06:38 +00:00
|
|
|
|
|
|
|
#include <components/settings/settings.hpp>
|
|
|
|
|
|
|
|
#include "../mwworld/globals.hpp"
|
2013-01-06 05:12:08 +00:00
|
|
|
#include "../mwworld/ptr.hpp"
|
2012-07-02 23:06:38 +00:00
|
|
|
|
|
|
|
namespace Ogre
|
|
|
|
{
|
|
|
|
class Vector2;
|
|
|
|
class Vector3;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace OEngine
|
|
|
|
{
|
2013-02-04 15:10:14 +00:00
|
|
|
namespace Physic
|
|
|
|
{
|
|
|
|
class PhysicEngine;
|
|
|
|
}
|
2012-07-02 23:06:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
class ESMReader;
|
2013-12-07 12:17:28 +00:00
|
|
|
class ESMWriter;
|
2012-07-02 23:06:38 +00:00
|
|
|
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-01-16 11:03:23 +00:00
|
|
|
struct CellId;
|
2014-02-23 19:11:05 +00:00
|
|
|
struct Armor;
|
|
|
|
struct Weapon;
|
|
|
|
struct Clothing;
|
|
|
|
struct Enchantment;
|
|
|
|
struct Book;
|
|
|
|
struct EffectList;
|
2012-07-02 23:06:38 +00:00
|
|
|
}
|
|
|
|
|
2012-09-14 19:12:16 +00:00
|
|
|
namespace MWRender
|
|
|
|
{
|
2013-01-16 17:59:19 +00:00
|
|
|
class Animation;
|
2012-09-14 19:12:16 +00:00
|
|
|
}
|
|
|
|
|
2013-03-31 07:13:56 +00:00
|
|
|
namespace MWMechanics
|
|
|
|
{
|
|
|
|
class Movement;
|
|
|
|
}
|
|
|
|
|
2012-07-02 23:06:38 +00:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
2013-03-17 12:50:15 +00:00
|
|
|
class Fallback;
|
2012-07-02 23:06:38 +00:00
|
|
|
class CellStore;
|
|
|
|
class Player;
|
|
|
|
class LocalScripts;
|
|
|
|
class TimeStamp;
|
2012-10-01 15:17:04 +00:00
|
|
|
class ESMStore;
|
2013-01-13 17:05:12 +00:00
|
|
|
class RefData;
|
2013-02-05 19:03:39 +00:00
|
|
|
|
2013-03-31 07:13:56 +00:00
|
|
|
typedef std::vector<std::pair<MWWorld::Ptr,MWMechanics::Movement> > PtrMovementList;
|
2012-07-02 23:06:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWBase
|
|
|
|
{
|
2012-08-08 12:54:35 +00:00
|
|
|
/// \brief Interface for the World (implemented in MWWorld)
|
2012-07-02 23:06:38 +00:00
|
|
|
class World
|
|
|
|
{
|
|
|
|
World (const World&);
|
|
|
|
///< not implemented
|
|
|
|
|
|
|
|
World& operator= (const World&);
|
|
|
|
///< not implemented
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum RenderMode
|
|
|
|
{
|
|
|
|
Render_CollisionDebug,
|
|
|
|
Render_Wireframe,
|
|
|
|
Render_Pathgrid,
|
2012-11-20 01:20:54 +00:00
|
|
|
Render_BoundingBoxes
|
2012-07-02 23:06:38 +00:00
|
|
|
};
|
|
|
|
|
2012-08-28 15:30:34 +00:00
|
|
|
struct DoorMarker
|
|
|
|
{
|
|
|
|
std::string name;
|
|
|
|
float x, y; // world position
|
|
|
|
};
|
|
|
|
|
2012-07-02 23:06:38 +00:00
|
|
|
World() {}
|
|
|
|
|
|
|
|
virtual ~World() {}
|
|
|
|
|
2014-03-13 12:19:32 +00:00
|
|
|
virtual void startNewGame (bool bypass) = 0;
|
|
|
|
///< \param bypass Bypass regular game start.
|
2013-05-15 15:54:18 +00:00
|
|
|
|
2013-12-05 11:49:25 +00:00
|
|
|
virtual void clear() = 0;
|
|
|
|
|
2013-12-07 12:17:28 +00:00
|
|
|
virtual int countSavedGameRecords() const = 0;
|
|
|
|
|
2014-04-28 09:29:57 +00:00
|
|
|
virtual void write (ESM::ESMWriter& writer, Loading::Listener& listener) const = 0;
|
2013-12-07 12:17:28 +00:00
|
|
|
|
2014-01-27 12:27:42 +00:00
|
|
|
virtual void readRecord (ESM::ESMReader& reader, int32_t type,
|
|
|
|
const std::map<int, int>& contentFileMap) = 0;
|
2013-12-07 12:17:28 +00:00
|
|
|
|
2012-07-02 23:06:38 +00:00
|
|
|
virtual MWWorld::CellStore *getExterior (int x, int y) = 0;
|
|
|
|
|
|
|
|
virtual MWWorld::CellStore *getInterior (const std::string& name) = 0;
|
|
|
|
|
2014-01-16 11:03:23 +00:00
|
|
|
virtual MWWorld::CellStore *getCell (const ESM::CellId& id) = 0;
|
|
|
|
|
2013-12-16 13:40:47 +00:00
|
|
|
virtual void useDeathCamera() = 0;
|
2013-12-15 16:50:25 +00:00
|
|
|
|
2012-07-02 23:06:38 +00:00
|
|
|
virtual void setWaterHeight(const float height) = 0;
|
|
|
|
|
2014-05-16 07:21:08 +00:00
|
|
|
virtual bool toggleWater() = 0;
|
2012-07-02 23:06:38 +00:00
|
|
|
|
|
|
|
virtual void adjustSky() = 0;
|
|
|
|
|
|
|
|
virtual void getTriangleBatchCount(unsigned int &triangles, unsigned int &batches) = 0;
|
|
|
|
|
2013-03-18 07:29:40 +00:00
|
|
|
virtual const MWWorld::Fallback *getFallback () const = 0;
|
2012-07-02 23:06:38 +00:00
|
|
|
|
|
|
|
virtual MWWorld::Player& getPlayer() = 0;
|
2014-01-08 17:39:44 +00:00
|
|
|
virtual MWWorld::Ptr getPlayerPtr() = 0;
|
2012-07-02 23:06:38 +00:00
|
|
|
|
2012-10-01 15:17:04 +00:00
|
|
|
virtual const MWWorld::ESMStore& getStore() const = 0;
|
2012-07-02 23:06:38 +00:00
|
|
|
|
2012-11-10 20:43:41 +00:00
|
|
|
virtual std::vector<ESM::ESMReader>& getEsmReader() = 0;
|
2012-07-02 23:06:38 +00:00
|
|
|
|
|
|
|
virtual MWWorld::LocalScripts& getLocalScripts() = 0;
|
|
|
|
|
|
|
|
virtual bool hasCellChanged() const = 0;
|
|
|
|
///< Has the player moved to a different cell, since the last frame?
|
|
|
|
|
|
|
|
virtual bool isCellExterior() const = 0;
|
|
|
|
|
|
|
|
virtual bool isCellQuasiExterior() const = 0;
|
|
|
|
|
|
|
|
virtual Ogre::Vector2 getNorthVector (MWWorld::CellStore* cell) = 0;
|
2014-08-14 17:09:33 +00:00
|
|
|
///< get north vector for given interior cell
|
2012-07-02 23:06:38 +00:00
|
|
|
|
2014-01-01 21:37:52 +00:00
|
|
|
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 getInteriorMapPosition (Ogre::Vector2 position, float& nX, float& nY, int &x, int& y) = 0;
|
|
|
|
///< see MWRender::LocalMap::getInteriorMapPosition
|
|
|
|
|
|
|
|
virtual bool isPositionExplored (float nX, float nY, int x, int y, bool interior) = 0;
|
|
|
|
///< see MWRender::LocalMap::isPositionExplored
|
|
|
|
|
2013-11-28 08:10:38 +00:00
|
|
|
virtual void setGlobalInt (const std::string& name, int value) = 0;
|
|
|
|
///< Set value independently from real type.
|
2012-07-02 23:06:38 +00:00
|
|
|
|
2013-11-28 08:10:38 +00:00
|
|
|
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.
|
2012-07-02 23:06:38 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2013-11-26 10:39:58 +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.
|
2012-12-21 18:09:31 +00:00
|
|
|
|
2013-01-13 17:05:12 +00:00
|
|
|
virtual void removeRefScript (MWWorld::RefData *ref) = 0;
|
|
|
|
//< Remove the script attached to ref from mLocalScripts
|
|
|
|
|
2012-07-02 23:06:38 +00:00
|
|
|
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.
|
|
|
|
|
2014-01-11 02:33:17 +00:00
|
|
|
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.
|
|
|
|
|
2012-07-02 23:06:38 +00:00
|
|
|
virtual MWWorld::Ptr getPtrViaHandle (const std::string& handle) = 0;
|
|
|
|
///< Return a pointer to a liveCellRef with the given Ogre handle.
|
|
|
|
|
2012-10-19 17:48:02 +00:00
|
|
|
virtual MWWorld::Ptr searchPtrViaHandle (const std::string& handle) = 0;
|
|
|
|
///< Return a pointer to a liveCellRef with the given Ogre handle or Ptr() if not found
|
|
|
|
|
2014-04-29 13:27:49 +00:00
|
|
|
virtual MWWorld::Ptr searchPtrViaActorId (int actorId) = 0;
|
|
|
|
///< Search is limited to the active cells.
|
|
|
|
|
2012-07-02 23:06:38 +00:00
|
|
|
/// \todo enable reference in the OGRE scene
|
|
|
|
virtual void enable (const MWWorld::Ptr& ptr) = 0;
|
|
|
|
|
|
|
|
/// \todo disable reference in the OGRE scene
|
|
|
|
virtual void disable (const MWWorld::Ptr& ptr) = 0;
|
|
|
|
|
|
|
|
virtual void advanceTime (double hours) = 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.
|
|
|
|
|
2013-11-26 11:47:30 +00:00
|
|
|
virtual int getDay() const = 0;
|
|
|
|
virtual int getMonth() const = 0;
|
2013-11-28 08:27:10 +00:00
|
|
|
virtual int getYear() const = 0;
|
2013-11-26 11:47:30 +00:00
|
|
|
|
|
|
|
virtual std::string getMonthName (int month = -1) const = 0;
|
|
|
|
///< Return name of month (-1: current month)
|
2012-09-18 18:53:32 +00:00
|
|
|
|
2012-07-02 23:06:38 +00:00
|
|
|
virtual MWWorld::TimeStamp getTimeStamp() const = 0;
|
|
|
|
///< Return current in-game time stamp.
|
|
|
|
|
|
|
|
virtual bool toggleSky() = 0;
|
|
|
|
///< \return Resulting mode
|
|
|
|
|
|
|
|
virtual void changeWeather(const std::string& region, unsigned int id) = 0;
|
|
|
|
|
|
|
|
virtual int getCurrentWeather() const = 0;
|
|
|
|
|
|
|
|
virtual int getMasserPhase() const = 0;
|
|
|
|
|
|
|
|
virtual int getSecundaPhase() const = 0;
|
|
|
|
|
|
|
|
virtual void setMoonColour (bool red) = 0;
|
|
|
|
|
2013-07-27 14:10:18 +00:00
|
|
|
virtual void modRegion(const std::string ®ionid, const std::vector<char> &chances) = 0;
|
|
|
|
|
2012-07-02 23:06:38 +00:00
|
|
|
virtual float getTimeScaleFactor() const = 0;
|
|
|
|
|
|
|
|
virtual void changeToInteriorCell (const std::string& cellName,
|
|
|
|
const ESM::Position& position) = 0;
|
|
|
|
///< Move to interior cell.
|
|
|
|
|
|
|
|
virtual void changeToExteriorCell (const ESM::Position& position) = 0;
|
|
|
|
///< Move to exterior cell.
|
|
|
|
|
2014-05-17 03:21:17 +00:00
|
|
|
virtual void changeToCell (const ESM::CellId& cellId, const ESM::Position& position, bool detectWorldSpaceChange=true) = 0;
|
|
|
|
///< @param detectWorldSpaceChange if true, clean up worldspace-specific data when the world space changes
|
2014-01-16 11:03:23 +00:00
|
|
|
|
2012-07-02 23:06:38 +00:00
|
|
|
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;
|
|
|
|
|
2013-01-08 07:27:37 +00:00
|
|
|
virtual MWWorld::Ptr getFacedObject() = 0;
|
|
|
|
///< Return pointer to the object the player is looking at, if it is within activation range
|
2012-07-02 23:06:38 +00:00
|
|
|
|
2013-08-23 14:01:30 +00:00
|
|
|
/// 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
|
2014-01-19 13:02:39 +00:00
|
|
|
/// use the "Head" node, or alternatively the "Bip01 Head" node as a basis.
|
2013-08-23 14:01:30 +00:00
|
|
|
virtual std::pair<MWWorld::Ptr,Ogre::Vector3> getHitContact(const MWWorld::Ptr &ptr, float distance) = 0;
|
2013-07-25 19:58:43 +00:00
|
|
|
|
2014-07-31 02:24:45 +00:00
|
|
|
virtual void adjustPosition (const MWWorld::Ptr& ptr, bool force) = 0;
|
2013-04-03 21:55:57 +00:00
|
|
|
///< Adjust position after load to be on ground. Must be called after model load.
|
2014-07-31 02:24:45 +00:00
|
|
|
/// @param force do this even if the ptr is flying
|
2013-04-03 21:55:57 +00:00
|
|
|
|
2014-06-28 12:59:33 +00:00
|
|
|
virtual void fixPosition (const MWWorld::Ptr& actor) = 0;
|
|
|
|
///< Attempt to fix position so that the Ptr is no longer inside collision geometry.
|
|
|
|
|
2012-07-02 23:06:38 +00:00
|
|
|
virtual void deleteObject (const MWWorld::Ptr& ptr) = 0;
|
|
|
|
|
|
|
|
virtual void moveObject (const MWWorld::Ptr& ptr, float x, float y, float z) = 0;
|
|
|
|
|
2012-08-08 10:51:33 +00:00
|
|
|
virtual void
|
2014-03-07 05:11:00 +00:00
|
|
|
moveObject(const MWWorld::Ptr &ptr, MWWorld::CellStore* newCell, float x, float y, float z) = 0;
|
2012-08-08 10:51:33 +00:00
|
|
|
|
2012-07-09 16:47:59 +00:00
|
|
|
virtual void scaleObject (const MWWorld::Ptr& ptr, float scale) = 0;
|
2012-07-09 13:23:26 +00:00
|
|
|
|
2012-08-08 20:15:52 +00:00
|
|
|
virtual void rotateObject(const MWWorld::Ptr& ptr,float x,float y,float z, bool adjust = false) = 0;
|
2012-07-09 13:23:26 +00:00
|
|
|
|
2013-04-25 17:14:10 +00:00
|
|
|
virtual void localRotateObject (const MWWorld::Ptr& ptr, float x, float y, float z) = 0;
|
2013-04-15 14:45:53 +00:00
|
|
|
|
2014-03-07 05:11:00 +00:00
|
|
|
virtual MWWorld::Ptr safePlaceObject(const MWWorld::Ptr& ptr, MWWorld::CellStore* cell, ESM::Position pos) = 0;
|
2012-09-18 09:06:19 +00:00
|
|
|
///< place an object in a "safe" location (ie not in the void, etc).
|
2012-09-17 11:36:48 +00:00
|
|
|
|
2012-07-02 23:06:38 +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
|
|
|
|
|
2013-08-18 05:34:38 +00:00
|
|
|
virtual void queueMovement(const MWWorld::Ptr &ptr, const Ogre::Vector3 &velocity) = 0;
|
|
|
|
///< Queues movement for \a ptr (in local space), to be applied in the next call to
|
|
|
|
/// doPhysics.
|
2012-07-02 23:06:38 +00:00
|
|
|
|
2013-05-05 23:46:50 +00:00
|
|
|
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.
|
|
|
|
|
2012-07-02 23:06:38 +00:00
|
|
|
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
|
2012-07-02 23:06:38 +00:00
|
|
|
|
|
|
|
virtual bool toggleRenderMode (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
|
2012-07-02 23:06:38 +00:00
|
|
|
|
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
|
2012-07-02 23:06:38 +00:00
|
|
|
|
|
|
|
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-07-02 23:06:38 +00:00
|
|
|
|
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
|
|
|
|
2012-11-03 19:29:55 +00:00
|
|
|
virtual void update (float duration, bool paused) = 0;
|
2012-07-02 23:06:38 +00:00
|
|
|
|
2014-05-16 01:19:38 +00:00
|
|
|
virtual MWWorld::Ptr placeObject (const MWWorld::Ptr& object, float cursorX, float cursorY, int amount) = 0;
|
2013-08-12 23:19:33 +00:00
|
|
|
///< copy and place an object into the gameworld at the specified cursor position
|
2012-07-02 23:06:38 +00:00
|
|
|
/// @param object
|
|
|
|
/// @param cursor X (relative 0-1)
|
|
|
|
/// @param cursor Y (relative 0-1)
|
2013-08-12 23:19:33 +00:00
|
|
|
/// @param number of objects to place
|
2012-07-02 23:06:38 +00:00
|
|
|
|
2014-05-16 01:19:38 +00:00
|
|
|
virtual MWWorld::Ptr dropObjectOnGround (const MWWorld::Ptr& actor, const MWWorld::Ptr& object, int amount) = 0;
|
2013-08-12 23:19:33 +00:00
|
|
|
///< 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
|
2012-07-02 23:06:38 +00:00
|
|
|
|
|
|
|
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 Settings::CategorySettingVector& settings) = 0;
|
2012-08-03 10:42:09 +00:00
|
|
|
|
2013-02-19 06:39:43 +00:00
|
|
|
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;
|
2013-02-15 06:35:15 +00:00
|
|
|
virtual bool isSwimming(const MWWorld::Ptr &object) const = 0;
|
2013-08-07 13:34:11 +00:00
|
|
|
///Is the head of the creature underwater?
|
|
|
|
virtual bool isSubmerged(const MWWorld::Ptr &object) const = 0;
|
2013-12-05 12:21:26 +00:00
|
|
|
virtual bool isUnderwater(const MWWorld::CellStore* cell, const Ogre::Vector3 &pos) const = 0;
|
2013-02-15 06:35:15 +00:00
|
|
|
virtual bool isOnGround(const MWWorld::Ptr &ptr) const = 0;
|
2012-08-12 11:50:37 +00:00
|
|
|
|
|
|
|
virtual void togglePOV() = 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;
|
2012-08-17 09:23:02 +00:00
|
|
|
virtual void togglePlayerLooking(bool enable) = 0;
|
2013-03-07 23:12:56 +00:00
|
|
|
virtual void changeVanityModeScale(float factor) = 0;
|
2013-04-09 18:24:41 +00:00
|
|
|
virtual bool vanityRotateCamera(float * rot) = 0;
|
2013-07-16 16:38:18 +00:00
|
|
|
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
|
|
|
|
2014-05-14 23:58:44 +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;
|
2014-07-22 15:55:54 +00:00
|
|
|
/// update movement state of a non-teleport door as specified
|
|
|
|
/// @param state see MWClass::setDoorState
|
|
|
|
virtual void activateDoor(const MWWorld::Ptr& door, int state) = 0;
|
2013-04-28 12:59:15 +00:00
|
|
|
|
2013-05-01 09:15:43 +00:00
|
|
|
virtual bool getPlayerStandingOn (const MWWorld::Ptr& object) = 0; ///< @return true if the player is standing on \a object
|
|
|
|
virtual bool getActorStandingOn (const MWWorld::Ptr& object) = 0; ///< @return true if any actor is standing on \a object
|
2014-07-29 17:01:40 +00:00
|
|
|
virtual bool getPlayerCollidingWith(const MWWorld::Ptr& object) = 0; ///< @return true if the player is colliding with \a object
|
|
|
|
virtual bool getActorCollidingWith (const MWWorld::Ptr& object) = 0; ///< @return true if any actor is colliding with \a object
|
|
|
|
virtual void hurtStandingActors (const MWWorld::Ptr& 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::Ptr& 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;
|
2013-05-01 09:15:43 +00:00
|
|
|
|
2013-05-11 16:38:27 +00:00
|
|
|
virtual void getContainersOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out) = 0;
|
|
|
|
///< get all containers in active cells owned by this Npc
|
2013-05-27 00:18:36 +00:00
|
|
|
virtual void getItemsOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out) = 0;
|
|
|
|
///< get all items in active cells owned by this Npc
|
2013-05-11 16:38:27 +00:00
|
|
|
|
2014-06-19 02:53:25 +00:00
|
|
|
virtual bool getLOS(const MWWorld::Ptr& actor,const MWWorld::Ptr& targetActor) = 0;
|
2013-09-10 14:16:13 +00:00
|
|
|
///< get Line of Sight (morrowind stupid implementation)
|
|
|
|
|
2014-04-20 16:35:07 +00:00
|
|
|
virtual float getDistToNearestRayHit(const Ogre::Vector3& from, const Ogre::Vector3& dir, float maxDist) = 0;
|
|
|
|
|
2013-06-27 21:11:20 +00:00
|
|
|
virtual void enableActorCollision(const MWWorld::Ptr& actor, bool enable) = 0;
|
|
|
|
|
2012-09-19 00:53:06 +00:00
|
|
|
virtual int canRest() = 0;
|
|
|
|
///< check if the player is allowed to rest \n
|
|
|
|
/// 0 - yes \n
|
|
|
|
/// 1 - only waiting \n
|
|
|
|
/// 2 - player is underwater \n
|
|
|
|
/// 3 - enemies are nearby (not implemented)
|
2012-09-25 00:35:50 +00:00
|
|
|
|
2013-01-16 17:59:19 +00:00
|
|
|
/// \todo Probably shouldn't be here
|
|
|
|
virtual MWRender::Animation* getAnimation(const MWWorld::Ptr &ptr) = 0;
|
|
|
|
|
2012-09-25 00:35:50 +00:00
|
|
|
/// \todo this does not belong here
|
2013-08-19 18:30:22 +00:00
|
|
|
virtual void frameStarted (float dt, bool paused) = 0;
|
2014-01-24 16:49:16 +00:00
|
|
|
virtual void screenshot (Ogre::Image& image, int w, int h) = 0;
|
2013-07-07 11:03:06 +00:00
|
|
|
|
|
|
|
/// 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;
|
2013-07-27 07:14:55 +00:00
|
|
|
|
|
|
|
/// 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;
|
2013-08-05 21:23:39 +00:00
|
|
|
|
2013-10-02 13:12:41 +00:00
|
|
|
/// 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;
|
|
|
|
|
2013-08-05 21:23:39 +00:00
|
|
|
/// Turn actor into werewolf or normal form.
|
|
|
|
virtual void setWerewolf(const MWWorld::Ptr& actor, bool werewolf) = 0;
|
2013-08-13 07:25:39 +00:00
|
|
|
|
|
|
|
/// Sets the NPC's Acrobatics skill to match the fWerewolfAcrobatics GMST.
|
|
|
|
/// It only applies to the current form the NPC is in.
|
|
|
|
virtual void applyWerewolfAcrobatics(const MWWorld::Ptr& actor) = 0;
|
2013-08-25 01:19:12 +00:00
|
|
|
|
2013-09-12 12:30:00 +00:00
|
|
|
virtual bool getGodModeState() = 0;
|
|
|
|
|
2013-08-25 01:19:12 +00:00
|
|
|
virtual bool toggleGodMode() = 0;
|
2013-11-09 06:51:46 +00:00
|
|
|
|
2013-12-26 21:06:13 +00:00
|
|
|
/**
|
|
|
|
* @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;
|
|
|
|
|
2013-11-09 06:51:46 +00:00
|
|
|
virtual void castSpell (const MWWorld::Ptr& actor) = 0;
|
2013-10-25 20:16:52 +00:00
|
|
|
|
2014-05-16 11:09:23 +00:00
|
|
|
virtual void launchMagicBolt (const std::string& model, const std::string& sound, const std::string& spellId,
|
|
|
|
float speed, bool stack, const ESM::EffectList& effects,
|
2014-06-17 23:41:07 +00:00
|
|
|
const MWWorld::Ptr& caster, const std::string& sourceName, const Ogre::Vector3& fallbackDirection) = 0;
|
2014-03-07 05:11:00 +00:00
|
|
|
virtual void launchProjectile (MWWorld::Ptr actor, MWWorld::Ptr projectile,
|
|
|
|
const Ogre::Vector3& worldPos, const Ogre::Quaternion& orient, MWWorld::Ptr bow, float speed) = 0;
|
2013-12-08 22:36:37 +00:00
|
|
|
|
2013-11-25 12:00:05 +00:00
|
|
|
virtual const std::vector<std::string>& getContentFiles() const = 0;
|
2014-01-05 23:02:03 +00:00
|
|
|
|
2013-12-08 22:36:37 +00:00
|
|
|
virtual void breakInvisibility (const MWWorld::Ptr& actor) = 0;
|
2013-12-10 22:48:49 +00:00
|
|
|
|
2013-12-30 16:53:02 +00:00
|
|
|
// Are we in an exterior or pseudo-exterior cell and it's night?
|
|
|
|
virtual bool isDark() const = 0;
|
2013-12-31 17:35:46 +00:00
|
|
|
|
|
|
|
virtual bool findInteriorPositionInWorldSpace(MWWorld::CellStore* cell, Ogre::Vector3& result) = 0;
|
2014-01-01 01:22:11 +00:00
|
|
|
|
2014-01-09 00:49:58 +00:00
|
|
|
/// Teleports \a ptr to the closest reference of \a id (e.g. DivineMarker, PrisonMarker, TempleMarker)
|
2014-01-01 01:22:11 +00:00
|
|
|
/// @note id must be lower case
|
|
|
|
virtual void teleportToClosestMarker (const MWWorld::Ptr& ptr,
|
2014-01-09 00:49:58 +00:00
|
|
|
const std::string& id) = 0;
|
2014-01-01 21:37:52 +00:00
|
|
|
|
|
|
|
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;
|
2014-01-08 23:40:25 +00:00
|
|
|
|
|
|
|
/// 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;
|
2014-01-14 06:40:17 +00:00
|
|
|
|
|
|
|
/// 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
|
|
|
|
virtual void spawnBloodEffect (const MWWorld::Ptr& ptr, const Ogre::Vector3& worldPosition) = 0;
|
2014-01-20 14:48:06 +00:00
|
|
|
|
2014-06-15 19:19:37 +00:00
|
|
|
virtual void spawnEffect (const std::string& model, const std::string& textureOverride, const Ogre::Vector3& worldPos) = 0;
|
|
|
|
|
2014-05-16 11:09:23 +00:00
|
|
|
virtual void explodeSpell (const Ogre::Vector3& origin, const ESM::EffectList& effects,
|
2014-01-20 14:48:06 +00:00
|
|
|
const MWWorld::Ptr& caster, const std::string& id, const std::string& sourceName) = 0;
|
2014-06-12 22:01:29 +00:00
|
|
|
|
|
|
|
virtual void activate (const MWWorld::Ptr& object, const MWWorld::Ptr& actor) = 0;
|
2014-06-24 16:37:38 +00:00
|
|
|
|
|
|
|
/// @see MWWorld::WeatherManager::isInStorm
|
|
|
|
virtual bool isInStorm() const = 0;
|
|
|
|
|
|
|
|
/// @see MWWorld::WeatherManager::getStormDirection
|
|
|
|
virtual Ogre::Vector3 getStormDirection() const = 0;
|
2012-07-02 23:06:38 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|