2012-07-03 12:30:50 +02:00
|
|
|
#ifndef GAME_MWWORLD_WORLDIMP_H
|
|
|
|
#define GAME_MWWORLD_WORLDIMP_H
|
2010-07-02 09:38:22 +02:00
|
|
|
|
2014-05-16 13:09:23 +02:00
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
#include <osg/ref_ptr>
|
|
|
|
|
2016-01-06 12:46:06 +01:00
|
|
|
#include <components/settings/settings.hpp>
|
|
|
|
#include <components/fallback/fallback.hpp>
|
|
|
|
|
|
|
|
#include "../mwbase/world.hpp"
|
|
|
|
|
2010-07-03 17:46:55 +02:00
|
|
|
#include "ptr.hpp"
|
2011-07-31 17:07:11 +02:00
|
|
|
#include "scene.hpp"
|
2012-10-01 19:17:04 +04:00
|
|
|
#include "esmstore.hpp"
|
2011-09-08 11:02:55 +02:00
|
|
|
#include "cells.hpp"
|
2011-10-06 12:29:59 +02:00
|
|
|
#include "localscripts.hpp"
|
2012-05-19 09:31:45 +02:00
|
|
|
#include "timestamp.hpp"
|
2013-12-10 15:09:58 +01:00
|
|
|
#include "globals.hpp"
|
2013-09-29 09:11:57 +02:00
|
|
|
#include "contentloader.hpp"
|
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
namespace osg
|
|
|
|
{
|
|
|
|
class Group;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace osgViewer
|
|
|
|
{
|
|
|
|
class Viewer;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Resource
|
|
|
|
{
|
|
|
|
class ResourceSystem;
|
|
|
|
}
|
|
|
|
|
2010-07-22 12:29:23 +02:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
struct Position;
|
|
|
|
}
|
|
|
|
|
2011-05-05 19:32:42 +02:00
|
|
|
namespace Files
|
|
|
|
{
|
|
|
|
class Collections;
|
|
|
|
}
|
|
|
|
|
2010-07-02 09:38:22 +02:00
|
|
|
namespace MWRender
|
|
|
|
{
|
|
|
|
class SkyManager;
|
2013-01-16 09:59:19 -08:00
|
|
|
class Animation;
|
2013-12-16 15:40:47 +02:00
|
|
|
class Camera;
|
2010-07-02 09:38:22 +02:00
|
|
|
}
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2015-07-09 19:22:04 +02:00
|
|
|
namespace ToUTF8
|
|
|
|
{
|
|
|
|
class Utf8Encoder;
|
|
|
|
}
|
|
|
|
|
2013-09-29 09:11:57 +02:00
|
|
|
struct ContentLoader;
|
|
|
|
|
2010-07-03 15:41:20 +02:00
|
|
|
namespace MWWorld
|
2010-07-02 09:38:22 +02:00
|
|
|
{
|
2012-02-21 20:22:46 +01:00
|
|
|
class WeatherManager;
|
2011-01-04 15:58:22 +01:00
|
|
|
class Player;
|
2014-05-16 13:09:23 +02:00
|
|
|
class ProjectileManager;
|
2010-07-27 14:05:05 +02:00
|
|
|
|
2010-07-02 09:38:22 +02:00
|
|
|
/// \brief The game world and its visual representation
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
class World : public MWBase::World
|
2010-07-02 09:38:22 +02:00
|
|
|
{
|
2015-05-12 17:40:42 +02:00
|
|
|
Resource::ResourceSystem* mResourceSystem;
|
|
|
|
|
2016-01-06 12:46:06 +01:00
|
|
|
Fallback::Map mFallback;
|
2012-01-29 20:51:20 +02:00
|
|
|
MWRender::RenderingManager* mRendering;
|
2012-03-08 01:03:46 +04:00
|
|
|
|
2015-04-14 15:55:56 +02:00
|
|
|
MWWorld::WeatherManager* mWeatherManager;
|
2011-11-21 14:08:44 +01:00
|
|
|
|
2011-07-31 17:07:11 +02:00
|
|
|
MWWorld::Scene *mWorldScene;
|
2011-01-04 15:58:22 +01:00
|
|
|
MWWorld::Player *mPlayer;
|
2012-11-10 21:43:41 +01:00
|
|
|
std::vector<ESM::ESMReader> mEsm;
|
2012-10-01 19:17:04 +04:00
|
|
|
MWWorld::ESMStore mStore;
|
2011-10-06 12:29:59 +02:00
|
|
|
LocalScripts mLocalScripts;
|
2013-12-10 15:09:58 +01:00
|
|
|
MWWorld::Globals mGlobalVariables;
|
2015-05-10 01:09:00 +02:00
|
|
|
MWPhysics::PhysicsSystem *mPhysics;
|
2010-07-18 19:48:02 +02:00
|
|
|
bool mSky;
|
2011-09-04 09:48:50 +02:00
|
|
|
|
2015-11-22 22:13:21 +01:00
|
|
|
ESM::Variant* mGameHour;
|
|
|
|
ESM::Variant* mDaysPassed;
|
|
|
|
ESM::Variant* mDay;
|
|
|
|
ESM::Variant* mMonth;
|
|
|
|
ESM::Variant* mYear;
|
|
|
|
ESM::Variant* mTimeScale;
|
|
|
|
|
2011-09-08 11:02:55 +02:00
|
|
|
Cells mCells;
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2014-05-17 05:21:17 +02:00
|
|
|
std::string mCurrentWorldSpace;
|
|
|
|
|
2014-05-16 13:09:23 +02:00
|
|
|
boost::shared_ptr<ProjectileManager> mProjectileManager;
|
|
|
|
|
2013-08-29 20:25:36 -04:00
|
|
|
bool mGodMode;
|
2015-02-10 20:25:57 +01:00
|
|
|
bool mScriptsEnabled;
|
2013-11-25 13:00:05 +01:00
|
|
|
std::vector<std::string> mContentFiles;
|
2013-08-29 20:25:36 -04:00
|
|
|
|
2010-07-02 09:38:22 +02:00
|
|
|
// not implemented
|
|
|
|
World (const World&);
|
|
|
|
World& operator= (const World&);
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2013-01-08 19:52:18 -08:00
|
|
|
int mActivationDistanceOverride;
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2014-05-21 09:25:45 +02:00
|
|
|
std::string mStartupScript;
|
|
|
|
|
2013-04-28 14:59:15 +02:00
|
|
|
std::map<MWWorld::Ptr, int> mDoorStates;
|
2014-05-15 01:58:44 +02:00
|
|
|
///< only holds doors that are currently moving. 1 = opening, 2 = closing
|
2013-04-28 14:59:15 +02:00
|
|
|
|
2014-03-13 13:19:32 +01:00
|
|
|
std::string mStartCell;
|
|
|
|
|
2014-10-10 23:29:51 +13:00
|
|
|
void updateWeather(float duration, bool paused = false);
|
2010-07-22 11:48:27 +02:00
|
|
|
int getDaysPerMonth (int month) const;
|
2011-09-04 09:48:50 +02:00
|
|
|
|
2015-06-03 21:37:21 +02:00
|
|
|
void rotateObjectImp (const Ptr& ptr, const osg::Vec3f& rot, bool adjust);
|
2013-03-31 02:24:44 -07:00
|
|
|
|
2016-02-13 02:56:41 +01:00
|
|
|
Ptr moveObjectImp (const Ptr& ptr, float x, float y, float z, bool movePhysics=true);
|
2014-12-11 19:27:13 +01:00
|
|
|
///< @return an updated Ptr in case the Ptr's cell changes
|
2011-09-04 09:48:50 +02:00
|
|
|
|
2015-12-19 16:47:55 +01:00
|
|
|
Ptr copyObjectToCell(const ConstPtr &ptr, CellStore* cell, ESM::Position pos, int count, bool adjustPos);
|
2012-07-25 10:47:59 +04:00
|
|
|
|
2014-12-08 23:26:09 +01:00
|
|
|
void updateSoundListener();
|
2013-01-07 22:48:24 -08:00
|
|
|
void updateWindowManager ();
|
2015-05-26 16:40:44 +02:00
|
|
|
void updatePlayer(bool paused);
|
2015-05-24 03:36:34 +02:00
|
|
|
MWWorld::Ptr getFacedObject(float maxDistance, bool ignorePlayer=true);
|
2015-12-14 02:57:55 +01:00
|
|
|
public: // FIXME
|
2013-01-20 16:38:56 +00:00
|
|
|
void removeContainerScripts(const Ptr& reference);
|
2015-12-14 02:57:55 +01:00
|
|
|
private:
|
2013-12-05 13:21:26 +01:00
|
|
|
void addContainerScripts(const Ptr& reference, CellStore* cell);
|
2013-01-31 18:45:32 +00:00
|
|
|
void PCDropped (const Ptr& item);
|
2013-01-20 16:38:56 +00:00
|
|
|
|
2013-05-01 12:47:50 +02:00
|
|
|
void processDoors(float duration);
|
2013-04-29 11:00:15 +02:00
|
|
|
///< Run physics simulation and modify \a world accordingly.
|
|
|
|
|
2013-08-17 22:34:38 -07:00
|
|
|
void doPhysics(float duration);
|
|
|
|
///< Run physics simulation and modify \a world accordingly.
|
|
|
|
|
2013-05-01 12:47:50 +02:00
|
|
|
void ensureNeededRecords();
|
|
|
|
|
2015-11-22 22:13:21 +01:00
|
|
|
void fillGlobalVariables();
|
|
|
|
|
2013-09-29 09:11:57 +02:00
|
|
|
/**
|
|
|
|
* @brief loadContentFiles - Loads content files (esm,esp,omwgame,omwaddon)
|
|
|
|
* @param fileCollections- Container which holds content file names and their paths
|
|
|
|
* @param content - Container which holds content file names
|
|
|
|
* @param contentLoader -
|
|
|
|
*/
|
|
|
|
void loadContentFiles(const Files::Collections& fileCollections,
|
|
|
|
const std::vector<std::string>& content, ContentLoader& contentLoader);
|
|
|
|
|
2015-01-31 20:54:08 +01:00
|
|
|
float mSwimHeightScale;
|
2015-12-18 17:56:48 +01:00
|
|
|
bool isUnderwater(const MWWorld::ConstPtr &object, const float heightRatio) const;
|
2015-01-09 21:40:53 +13:00
|
|
|
///< helper function for implementing isSwimming(), isSubmerged(), isWading()
|
|
|
|
|
2013-07-27 00:14:55 -07:00
|
|
|
bool mTeleportEnabled;
|
2013-10-02 15:12:41 +02:00
|
|
|
bool mLevitationEnabled;
|
2014-01-11 06:47:58 +01:00
|
|
|
bool mGoToJail;
|
2014-09-09 00:00:55 +02:00
|
|
|
int mDaysInPrison;
|
2013-07-27 00:14:55 -07:00
|
|
|
|
2014-01-01 23:34:18 +01:00
|
|
|
float feetToGameUnits(float feet);
|
|
|
|
|
2015-12-17 23:59:18 +01:00
|
|
|
MWWorld::ConstPtr getClosestMarker( const MWWorld::Ptr &ptr, const std::string &id );
|
|
|
|
MWWorld::ConstPtr getClosestMarkerFromExteriorPosition( const osg::Vec3f& worldPos, const std::string &id );
|
2015-02-14 15:43:09 -06:00
|
|
|
|
2010-07-02 09:38:22 +02:00
|
|
|
public:
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2015-04-01 17:02:15 +02:00
|
|
|
World (
|
2015-05-14 21:42:04 +02:00
|
|
|
osgViewer::Viewer* viewer,
|
2015-04-12 15:34:50 +02:00
|
|
|
osg::ref_ptr<osg::Group> rootNode,
|
|
|
|
Resource::ResourceSystem* resourceSystem,
|
2011-05-05 19:32:42 +02:00
|
|
|
const Files::Collections& fileCollections,
|
2013-09-29 09:11:57 +02:00
|
|
|
const std::vector<std::string>& contentFiles,
|
2014-03-13 13:19:32 +01:00
|
|
|
ToUTF8::Utf8Encoder* encoder, const std::map<std::string,std::string>& fallbackMap,
|
2015-10-26 21:36:19 +01:00
|
|
|
int activationDistanceOverride, const std::string& startCell, const std::string& startupScript, const std::string& resourcePath);
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual ~World();
|
|
|
|
|
2014-03-13 13:19:32 +01:00
|
|
|
virtual void startNewGame (bool bypass);
|
|
|
|
///< \param bypass Bypass regular game start.
|
2013-05-15 17:54:18 +02:00
|
|
|
|
2016-02-09 01:17:02 +01:00
|
|
|
virtual void preloadCommonAssets();
|
|
|
|
|
2013-12-05 12:49:25 +01:00
|
|
|
virtual void clear();
|
|
|
|
|
2013-12-07 13:17:28 +01:00
|
|
|
virtual int countSavedGameRecords() const;
|
2015-01-11 18:01:06 +01:00
|
|
|
virtual int countSavedGameCells() const;
|
2013-12-07 13:17:28 +01:00
|
|
|
|
2014-04-28 11:29:57 +02:00
|
|
|
virtual void write (ESM::ESMWriter& writer, Loading::Listener& progress) const;
|
2013-12-07 13:17:28 +01:00
|
|
|
|
2015-01-22 19:04:59 +01:00
|
|
|
virtual void readRecord (ESM::ESMReader& reader, uint32_t type,
|
2014-01-27 13:27:42 +01:00
|
|
|
const std::map<int, int>& contentFileMap);
|
2013-12-07 13:17:28 +01:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual CellStore *getExterior (int x, int y);
|
2011-09-04 09:48:50 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual CellStore *getInterior (const std::string& name);
|
2011-09-04 09:48:50 +02:00
|
|
|
|
2014-01-16 12:03:23 +01:00
|
|
|
virtual CellStore *getCell (const ESM::CellId& id);
|
|
|
|
|
2013-12-16 15:40:47 +02:00
|
|
|
//switch to POV before showing player's death animation
|
|
|
|
virtual void useDeathCamera();
|
2013-12-15 18:50:25 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual void setWaterHeight(const float height);
|
2012-03-29 15:49:24 +02:00
|
|
|
|
2014-05-16 09:21:08 +02:00
|
|
|
virtual bool toggleWater();
|
2014-09-30 15:53:27 +02:00
|
|
|
virtual bool toggleWorld();
|
2012-03-30 02:46:05 +04:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual void adjustSky();
|
2011-07-31 17:07:11 +02:00
|
|
|
|
2016-01-06 12:46:06 +01:00
|
|
|
virtual const Fallback::Map *getFallback() const;
|
2012-04-02 20:47:09 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual Player& getPlayer();
|
2014-01-08 18:39:44 +01:00
|
|
|
virtual MWWorld::Ptr getPlayerPtr();
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2012-10-01 19:17:04 +04:00
|
|
|
virtual const MWWorld::ESMStore& getStore() const;
|
2011-09-04 09:48:50 +02:00
|
|
|
|
2012-11-10 21:43:41 +01:00
|
|
|
virtual std::vector<ESM::ESMReader>& getEsmReader();
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual LocalScripts& getLocalScripts();
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual bool hasCellChanged() const;
|
2014-10-02 16:30:23 +02:00
|
|
|
///< Has the set of active cells changed, since the last frame?
|
2012-03-08 01:03:46 +04:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual bool isCellExterior() const;
|
|
|
|
|
|
|
|
virtual bool isCellQuasiExterior() const;
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2016-02-05 00:25:14 +01:00
|
|
|
virtual osg::Vec2f getNorthVector (const CellStore* cell);
|
2014-08-14 19:09:33 +02:00
|
|
|
///< get north vector for given interior cell
|
2012-03-28 03:15:10 +02:00
|
|
|
|
2014-01-01 22:37:52 +01:00
|
|
|
virtual void getDoorMarkers (MWWorld::CellStore* cell, std::vector<DoorMarker>& out);
|
2012-08-28 17:30:34 +02:00
|
|
|
///< get a list of teleport door markers for a given cell, to be displayed on the local map
|
|
|
|
|
2013-11-28 09:10:38 +01:00
|
|
|
virtual void setGlobalInt (const std::string& name, int value);
|
|
|
|
///< Set value independently from real type.
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2013-11-28 09:10:38 +01:00
|
|
|
virtual void setGlobalFloat (const std::string& name, float value);
|
|
|
|
///< Set value independently from real type.
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2013-11-28 09:10:38 +01:00
|
|
|
virtual int getGlobalInt (const std::string& name) const;
|
|
|
|
///< Get value independently from real type.
|
|
|
|
|
|
|
|
virtual float getGlobalFloat (const std::string& name) const;
|
|
|
|
///< Get value independently from real type.
|
2011-04-21 11:00:00 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual char getGlobalVariableType (const std::string& name) const;
|
2010-07-21 15:01:35 +02:00
|
|
|
///< Return ' ', if there is no global variable with this name.
|
2013-03-06 19:57:00 +01:00
|
|
|
|
2013-11-26 11:39:58 +01:00
|
|
|
virtual std::string getCellName (const MWWorld::CellStore *cell = 0) const;
|
|
|
|
///< Return name of the cell.
|
|
|
|
///
|
|
|
|
/// \note If cell==0, the cell the player is currently in will be used instead to
|
|
|
|
/// generate a name.
|
2013-03-06 19:57:00 +01:00
|
|
|
|
2013-01-13 17:05:12 +00:00
|
|
|
virtual void removeRefScript (MWWorld::RefData *ref);
|
|
|
|
//< Remove the script attached to ref from mLocalScripts
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual Ptr getPtr (const std::string& name, bool activeOnly);
|
2010-07-05 12:09:04 +02:00
|
|
|
///< Return a pointer to a liveCellRef with the given name.
|
|
|
|
/// \param activeOnly do non search inactive cells.
|
2010-07-09 16:07:03 +02:00
|
|
|
|
2014-01-11 03:33:17 +01:00
|
|
|
virtual Ptr searchPtr (const std::string& name, bool activeOnly);
|
|
|
|
///< Return a pointer to a liveCellRef with the given name.
|
|
|
|
/// \param activeOnly do non search inactive cells.
|
|
|
|
|
2014-04-29 15:27:49 +02:00
|
|
|
virtual Ptr searchPtrViaActorId (int actorId);
|
|
|
|
///< Search is limited to the active cells.
|
|
|
|
|
2015-12-18 17:56:48 +01:00
|
|
|
virtual MWWorld::Ptr findContainer (const MWWorld::ConstPtr& ptr);
|
2014-10-24 18:49:38 +02:00
|
|
|
///< Return a pointer to a liveCellRef which contains \a ptr.
|
|
|
|
/// \note Search is limited to the active cells.
|
|
|
|
|
2014-07-31 04:24:45 +02:00
|
|
|
virtual void adjustPosition (const Ptr& ptr, bool force);
|
2013-04-03 23:55:57 +02:00
|
|
|
///< Adjust position after load to be on ground. Must be called after model load.
|
2014-07-31 04:24:45 +02:00
|
|
|
/// @param force do this even if the ptr is flying
|
2013-04-03 23:55:57 +02:00
|
|
|
|
2014-06-28 14:59:33 +02:00
|
|
|
virtual void fixPosition (const Ptr& actor);
|
|
|
|
///< Attempt to fix position so that the Ptr is no longer inside collision geometry.
|
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual void enable (const Ptr& ptr);
|
2011-11-21 14:08:44 +01:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual void disable (const Ptr& ptr);
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2015-08-27 14:20:45 -05:00
|
|
|
virtual void advanceTime (double hours, bool incremental = false);
|
2012-01-23 14:55:00 +01:00
|
|
|
///< Advance in-game time.
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual void setHour (double hour);
|
2012-01-23 14:55:00 +01:00
|
|
|
///< Set in-game time hour.
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual void setMonth (int month);
|
2012-01-23 14:55:00 +01:00
|
|
|
///< Set in-game time month.
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual void setDay (int day);
|
2012-01-23 14:55:00 +01:00
|
|
|
///< Set in-game time day.
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2013-11-26 12:47:30 +01:00
|
|
|
virtual int getDay() const;
|
|
|
|
virtual int getMonth() const;
|
2013-11-28 09:27:10 +01:00
|
|
|
virtual int getYear() const;
|
2013-11-26 12:47:30 +01:00
|
|
|
|
|
|
|
virtual std::string getMonthName (int month = -1) const;
|
|
|
|
///< Return name of month (-1: current month)
|
2012-09-18 20:53:32 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual TimeStamp getTimeStamp() const;
|
2012-05-19 09:31:45 +02:00
|
|
|
///< Return current in-game time stamp.
|
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual bool toggleSky();
|
2011-04-26 21:38:21 +02:00
|
|
|
///< \return Resulting mode
|
2012-03-08 01:03:46 +04:00
|
|
|
|
2012-07-07 01:14:18 +02:00
|
|
|
virtual void changeWeather (const std::string& region, unsigned int id);
|
2012-03-08 01:03:46 +04:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual int getCurrentWeather() const;
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual int getMasserPhase() const;
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual int getSecundaPhase() const;
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual void setMoonColour (bool red);
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2013-07-27 07:10:18 -07:00
|
|
|
virtual void modRegion(const std::string ®ionid, const std::vector<char> &chances);
|
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual float getTimeScaleFactor() const;
|
2010-08-03 20:01:52 +02:00
|
|
|
|
2016-03-24 17:18:08 +01:00
|
|
|
virtual void changeToInteriorCell (const std::string& cellName, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent = true);
|
2011-02-10 10:38:45 +01:00
|
|
|
///< Move to interior cell.
|
2016-02-27 12:53:07 +01:00
|
|
|
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
|
2010-08-20 13:33:03 +02:00
|
|
|
|
2016-03-24 17:18:08 +01:00
|
|
|
virtual void changeToExteriorCell (const ESM::Position& position, bool adjustPlayerPos, bool changeEvent = true);
|
2011-02-10 10:38:45 +01:00
|
|
|
///< Move to exterior cell.
|
2016-02-27 12:53:07 +01:00
|
|
|
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
|
2010-08-20 13:33:03 +02:00
|
|
|
|
2016-03-24 17:18:08 +01:00
|
|
|
virtual void changeToCell (const ESM::CellId& cellId, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent=true);
|
2016-02-27 12:53:07 +01:00
|
|
|
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
|
2014-01-16 12:03:23 +01:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual const ESM::Cell *getExterior (const std::string& cellName) const;
|
2010-09-11 11:55:28 +02:00
|
|
|
///< Return a cell matching the given name or a 0-pointer, if there is no such cell.
|
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual void markCellAsUnchanged();
|
2010-08-05 13:29:49 +02:00
|
|
|
|
2013-01-07 23:27:37 -08:00
|
|
|
virtual MWWorld::Ptr getFacedObject();
|
|
|
|
///< Return pointer to the object the player is looking at, if it is within activation range
|
2010-08-07 20:25:17 +02:00
|
|
|
|
2013-08-23 07:01:30 -07: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
|
|
|
|
/// use the "Head" node as a basis.
|
2015-12-18 17:38:21 +01:00
|
|
|
virtual std::pair<MWWorld::Ptr,osg::Vec3f> getHitContact(const MWWorld::ConstPtr &ptr, float distance);
|
2013-07-25 12:58:43 -07:00
|
|
|
|
2015-08-17 00:05:57 +02:00
|
|
|
/// @note No-op for items in containers. Use ContainerStore::removeItem instead.
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual void deleteObject (const Ptr& ptr);
|
2015-08-17 00:05:57 +02:00
|
|
|
|
2014-12-06 21:08:18 +01:00
|
|
|
virtual void undeleteObject (const Ptr& ptr);
|
2010-08-21 12:31:04 +02:00
|
|
|
|
2014-12-11 19:27:13 +01:00
|
|
|
virtual MWWorld::Ptr moveObject (const Ptr& ptr, float x, float y, float z);
|
|
|
|
///< @return an updated Ptr in case the Ptr's cell changes
|
2015-05-17 16:25:13 +02:00
|
|
|
|
2016-02-13 02:56:41 +01:00
|
|
|
virtual MWWorld::Ptr moveObject (const Ptr& ptr, CellStore* newCell, float x, float y, float z, bool movePhysics=true);
|
2015-05-17 16:25:13 +02:00
|
|
|
///< @return an updated Ptr
|
2010-08-22 21:30:48 +02:00
|
|
|
|
2012-07-09 18:47:59 +02:00
|
|
|
virtual void scaleObject (const Ptr& ptr, float scale);
|
2012-07-09 15:23:26 +02:00
|
|
|
|
2015-11-12 01:08:31 +01:00
|
|
|
/// World rotates object, uses radians
|
2015-11-12 01:44:00 +01:00
|
|
|
/// @note Rotations via this method use a different rotation order than the initial rotations in the CS. This
|
|
|
|
/// could be considered a bug, but is needed for MW compatibility.
|
2012-08-11 13:23:54 +04:00
|
|
|
/// \param adjust indicates rotation should be set or adjusted
|
2012-08-09 00:15:52 +04:00
|
|
|
virtual void rotateObject (const Ptr& ptr,float x,float y,float z, bool adjust = false);
|
2012-07-09 15:23:26 +02:00
|
|
|
|
2016-02-29 17:05:18 +01:00
|
|
|
virtual MWWorld::Ptr placeObject(const MWWorld::ConstPtr& ptr, MWWorld::CellStore* cell, ESM::Position pos);
|
2016-02-29 17:16:33 +01: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);
|
|
|
|
///< 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 13:36:48 +02:00
|
|
|
|
2015-02-17 22:51:30 +13:00
|
|
|
virtual float getMaxActivationDistance();
|
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual void indexToPosition (int cellX, int cellY, float &x, float &y, bool centre = false)
|
|
|
|
const;
|
2010-08-22 21:30:48 +02:00
|
|
|
///< Convert cell numbers to position.
|
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual void positionToIndex (float x, float y, int &cellX, int &cellY) const;
|
2010-08-22 21:30:48 +02:00
|
|
|
///< Convert position to cell numbers
|
2011-01-29 17:39:34 +01:00
|
|
|
|
2015-05-12 03:02:15 +02:00
|
|
|
virtual void queueMovement(const Ptr &ptr, const osg::Vec3f &velocity);
|
2013-08-17 22:34:38 -07:00
|
|
|
///< Queues movement for \a ptr (in local space), to be applied in the next call to
|
|
|
|
/// doPhysics.
|
2011-03-13 22:33:55 +01:00
|
|
|
|
2013-05-06 00:46:50 +01:00
|
|
|
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.
|
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual bool toggleCollisionMode();
|
2011-03-13 22:33:55 +01:00
|
|
|
///< Toggle collision mode for player. If disabled player object should ignore
|
|
|
|
/// collisions and gravity.
|
2011-04-26 21:38:21 +02:00
|
|
|
///< \return Resulting mode
|
2011-03-16 09:09:45 +01:00
|
|
|
|
2015-05-02 22:45:27 +02:00
|
|
|
virtual bool toggleRenderMode (MWRender::RenderMode mode);
|
2011-03-16 09:09:45 +01:00
|
|
|
///< Toggle a render mode.
|
2011-04-26 21:38:21 +02:00
|
|
|
///< \return Resulting mode
|
2011-07-22 15:56:54 +02:00
|
|
|
|
2012-11-08 01:52:34 +04:00
|
|
|
virtual const ESM::Potion *createRecord (const ESM::Potion& record);
|
2013-03-28 17:41:00 +01:00
|
|
|
///< Create a new record (of type potion) in the ESM store.
|
2012-11-08 19:01:42 +04:00
|
|
|
/// \return pointer to created record
|
2011-07-22 15:56:54 +02:00
|
|
|
|
2012-11-08 01:52:34 +04:00
|
|
|
virtual const ESM::Spell *createRecord (const ESM::Spell& record);
|
2013-03-28 17:41:00 +01:00
|
|
|
///< Create a new record (of type spell) in the ESM store.
|
2012-11-08 19:01:42 +04:00
|
|
|
/// \return pointer to created record
|
2011-07-22 15:56:54 +02:00
|
|
|
|
2012-11-08 01:52:34 +04:00
|
|
|
virtual const ESM::Class *createRecord (const ESM::Class& record);
|
2013-03-28 17:41:00 +01:00
|
|
|
///< Create a new record (of type class) in the ESM store.
|
2012-11-08 19:01:42 +04:00
|
|
|
/// \return pointer to created record
|
2011-09-26 11:11:30 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual const ESM::Cell *createRecord (const ESM::Cell& record);
|
2013-03-28 17:41:00 +01:00
|
|
|
///< Create a new record (of type cell) in the ESM store.
|
2012-11-08 19:01:42 +04:00
|
|
|
/// \return pointer to created record
|
2011-11-21 14:08:44 +01:00
|
|
|
|
2012-11-08 16:37:57 +04:00
|
|
|
virtual const ESM::NPC *createRecord(const ESM::NPC &record);
|
2013-03-28 17:41:00 +01:00
|
|
|
///< Create a new record (of type npc) in the ESM store.
|
2012-11-08 19:01:42 +04:00
|
|
|
/// \return pointer to created record
|
2012-11-08 16:37:57 +04:00
|
|
|
|
2013-03-28 17:41:00 +01:00
|
|
|
virtual const ESM::Armor *createRecord (const ESM::Armor& record);
|
|
|
|
///< 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);
|
|
|
|
///< 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);
|
|
|
|
///< 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);
|
|
|
|
///< 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);
|
|
|
|
///< Create a new record (of type book) in the ESM store.
|
|
|
|
/// \return pointer to created record
|
2011-11-21 14:08:44 +01:00
|
|
|
|
2014-12-17 01:05:32 +01:00
|
|
|
virtual const ESM::CreatureLevList *createOverrideRecord (const ESM::CreatureLevList& record);
|
|
|
|
///< 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);
|
|
|
|
///< Write this record to the ESM store, allowing it to override a pre-existing record with the same ID.
|
|
|
|
/// \return pointer to created record
|
|
|
|
|
2012-11-03 19:29:55 +00:00
|
|
|
virtual void update (float duration, bool paused);
|
2012-02-19 15:39:12 -05:00
|
|
|
|
2015-12-18 17:42:59 +01:00
|
|
|
virtual MWWorld::Ptr placeObject (const MWWorld::ConstPtr& object, float cursorX, float cursorY, int amount);
|
2013-08-13 01:19:33 +02:00
|
|
|
///< copy and place an object into the gameworld at the specified cursor position
|
2012-05-15 16:47:23 +02:00
|
|
|
/// @param object
|
|
|
|
/// @param cursor X (relative 0-1)
|
|
|
|
/// @param cursor Y (relative 0-1)
|
2013-08-13 01:19:33 +02:00
|
|
|
/// @param number of objects to place
|
2012-05-15 16:47:23 +02:00
|
|
|
|
2015-12-18 17:42:59 +01:00
|
|
|
virtual MWWorld::Ptr dropObjectOnGround (const MWWorld::Ptr& actor, const MWWorld::ConstPtr& object, int amount);
|
2013-08-13 01:19:33 +02: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-05-15 16:47:23 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual bool canPlaceObject(float cursorX, float cursorY);
|
2012-05-15 16:47:23 +02:00
|
|
|
///< @return true if it is possible to place on object at specified cursor location
|
2012-05-23 01:32:36 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual void processChangedSettings(const Settings::CategorySettingVector& settings);
|
2012-08-03 14:42:09 +04:00
|
|
|
|
2013-02-18 22:39:43 -08:00
|
|
|
virtual bool isFlying(const MWWorld::Ptr &ptr) const;
|
2013-10-02 22:53:29 +02:00
|
|
|
virtual bool isSlowFalling(const MWWorld::Ptr &ptr) const;
|
2013-08-07 15:34:11 +02:00
|
|
|
///Is the head of the creature underwater?
|
2015-12-18 17:56:48 +01:00
|
|
|
virtual bool isSubmerged(const MWWorld::ConstPtr &object) const;
|
|
|
|
virtual bool isSwimming(const MWWorld::ConstPtr &object) const;
|
2015-06-01 21:41:13 +02:00
|
|
|
virtual bool isUnderwater(const MWWorld::CellStore* cell, const osg::Vec3f &pos) const;
|
2015-12-18 17:56:48 +01:00
|
|
|
virtual bool isWading(const MWWorld::ConstPtr &object) const;
|
2013-02-14 22:35:15 -08:00
|
|
|
virtual bool isOnGround(const MWWorld::Ptr &ptr) const;
|
2012-08-10 15:15:48 +02:00
|
|
|
|
2015-12-18 17:36:14 +01:00
|
|
|
virtual osg::Matrixf getActorHeadTransform(const MWWorld::ConstPtr& actor) const;
|
2015-12-10 17:48:45 -08:00
|
|
|
|
2015-05-21 23:54:39 +02:00
|
|
|
virtual void togglePOV();
|
2012-08-14 14:37:48 +04:00
|
|
|
|
2015-05-21 23:54:39 +02:00
|
|
|
virtual bool isFirstPerson() const;
|
2014-12-11 20:57:25 +01:00
|
|
|
|
2015-05-21 23:54:39 +02:00
|
|
|
virtual void togglePreviewMode(bool enable);
|
2012-08-14 14:37:48 +04:00
|
|
|
|
2015-05-21 23:54:39 +02:00
|
|
|
virtual bool toggleVanityMode(bool enable);
|
2012-08-14 14:37:48 +04:00
|
|
|
|
2015-05-21 23:54:39 +02:00
|
|
|
virtual void allowVanityMode(bool allow);
|
2012-08-14 20:33:29 +04:00
|
|
|
|
2015-05-21 23:54:39 +02:00
|
|
|
virtual void togglePlayerLooking(bool enable);
|
2012-08-17 13:23:02 +04:00
|
|
|
|
2015-05-21 23:54:39 +02:00
|
|
|
virtual void changeVanityModeScale(float factor);
|
2013-03-08 00:12:56 +01:00
|
|
|
|
2013-04-09 19:24:41 +01:00
|
|
|
virtual bool vanityRotateCamera(float * rot);
|
2013-07-16 18:38:18 +02:00
|
|
|
virtual void setCameraDistance(float dist, bool adjust = false, bool override = true);
|
2013-04-09 19:24:41 +01:00
|
|
|
|
2013-04-29 17:56:16 +02:00
|
|
|
virtual void setupPlayer();
|
2012-08-14 20:33:29 +04:00
|
|
|
virtual void renderPlayer();
|
2012-12-23 23:23:24 +04:00
|
|
|
|
2014-05-15 01:58:44 +02:00
|
|
|
/// open or close a non-teleport door (depending on current state)
|
2013-04-28 14:59:15 +02:00
|
|
|
virtual void activateDoor(const MWWorld::Ptr& door);
|
2014-05-13 03:58:32 -04:00
|
|
|
|
2014-07-22 17:55:54 +02:00
|
|
|
/// update movement state of a non-teleport door as specified
|
|
|
|
/// @param state see MWClass::setDoorState
|
2014-09-11 05:48:46 +02:00
|
|
|
/// @note throws an exception when invoked on a teleport door
|
2014-07-22 17:55:54 +02:00
|
|
|
virtual void activateDoor(const MWWorld::Ptr& door, int state);
|
2013-04-28 14:59:15 +02:00
|
|
|
|
2015-12-18 17:56:48 +01:00
|
|
|
virtual bool getPlayerStandingOn (const MWWorld::ConstPtr& object); ///< @return true if the player is standing on \a object
|
|
|
|
virtual bool getActorStandingOn (const MWWorld::ConstPtr& object); ///< @return true if any actor is standing on \a object
|
|
|
|
virtual bool getPlayerCollidingWith(const MWWorld::ConstPtr& object); ///< @return true if the player is colliding with \a object
|
|
|
|
virtual bool getActorCollidingWith (const MWWorld::ConstPtr& object); ///< @return true if any actor is colliding with \a object
|
|
|
|
virtual void hurtStandingActors (const MWWorld::ConstPtr& object, float dmgPerSecond);
|
2014-07-29 19:01:40 +02:00
|
|
|
///< 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.
|
2015-12-18 17:56:48 +01:00
|
|
|
virtual void hurtCollidingActors (const MWWorld::ConstPtr& object, float dmgPerSecond);
|
2014-07-29 19:01:40 +02:00
|
|
|
///< 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 11:42:24 +02:00
|
|
|
virtual float getWindSpeed();
|
2013-05-01 11:15:43 +02:00
|
|
|
|
2015-12-18 18:00:18 +01:00
|
|
|
virtual void getContainersOwnedBy (const MWWorld::ConstPtr& npc, std::vector<MWWorld::Ptr>& out);
|
2013-05-11 18:38:27 +02:00
|
|
|
///< get all containers in active cells owned by this Npc
|
2015-12-18 18:00:18 +01:00
|
|
|
virtual void getItemsOwnedBy (const MWWorld::ConstPtr& npc, std::vector<MWWorld::Ptr>& out);
|
2013-05-27 02:18:36 +02:00
|
|
|
///< get all items in active cells owned by this Npc
|
2013-05-11 18:38:27 +02:00
|
|
|
|
2015-12-18 18:02:57 +01:00
|
|
|
virtual bool getLOS(const MWWorld::ConstPtr& actor,const MWWorld::ConstPtr& targetActor);
|
2013-09-10 16:16:13 +02:00
|
|
|
///< get Line of Sight (morrowind stupid implementation)
|
|
|
|
|
2016-04-16 16:39:13 -05:00
|
|
|
virtual float getDistToNearestRayHit(const osg::Vec3f& from, const osg::Vec3f& dir, float maxDist, bool includeWater = false);
|
2014-04-20 20:35:07 +04:00
|
|
|
|
2013-06-27 14:11:20 -07:00
|
|
|
virtual void enableActorCollision(const MWWorld::Ptr& actor, bool enable);
|
|
|
|
|
2012-09-19 02:53:06 +02:00
|
|
|
virtual int canRest();
|
|
|
|
///< 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 02:35:50 +02:00
|
|
|
|
2013-01-16 09:59:19 -08:00
|
|
|
/// \todo Probably shouldn't be here
|
|
|
|
virtual MWRender::Animation* getAnimation(const MWWorld::Ptr &ptr);
|
2015-12-19 16:02:47 +01:00
|
|
|
virtual const MWRender::Animation* getAnimation(const MWWorld::ConstPtr &ptr) const;
|
2015-01-28 19:14:57 +01:00
|
|
|
virtual void reattachPlayerCamera();
|
2013-01-16 09:59:19 -08:00
|
|
|
|
2012-09-25 02:35:50 +02:00
|
|
|
/// \todo this does not belong here
|
2015-06-03 16:40:16 +02:00
|
|
|
virtual void screenshot (osg::Image* image, int w, int h);
|
2013-07-07 15:03:06 +04:00
|
|
|
|
|
|
|
/// Find center of exterior cell above land surface
|
|
|
|
/// \return false if exterior with given name not exists, true otherwise
|
|
|
|
virtual bool findExteriorPosition(const std::string &name, ESM::Position &pos);
|
|
|
|
|
|
|
|
/// Find position in interior cell near door entrance
|
|
|
|
/// \return false if interior with given name not exists, true otherwise
|
|
|
|
virtual bool findInteriorPosition(const std::string &name, ESM::Position &pos);
|
2013-07-27 00:14:55 -07:00
|
|
|
|
|
|
|
/// Enables or disables use of teleport spell effects (recall, intervention, etc).
|
|
|
|
virtual void enableTeleporting(bool enable);
|
|
|
|
|
|
|
|
/// Returns true if teleport spell effects are allowed.
|
|
|
|
virtual bool isTeleportingEnabled() const;
|
2013-08-05 23:23:39 +02:00
|
|
|
|
2013-10-02 15:12:41 +02:00
|
|
|
/// Enables or disables use of levitation spell effect.
|
|
|
|
virtual void enableLevitation(bool enable);
|
|
|
|
|
|
|
|
/// Returns true if levitation spell effect is allowed.
|
|
|
|
virtual bool isLevitationEnabled() const;
|
|
|
|
|
2013-09-12 08:30:00 -04:00
|
|
|
virtual bool getGodModeState();
|
|
|
|
|
2013-08-24 21:19:12 -04:00
|
|
|
virtual bool toggleGodMode();
|
2013-11-09 07:51:46 +01:00
|
|
|
|
2015-02-10 20:25:57 +01:00
|
|
|
virtual bool toggleScripts();
|
|
|
|
virtual bool getScriptsEnabled() const;
|
|
|
|
|
2013-12-26 22:06:13 +01: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);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Cast the actual spell, should be called mid-animation
|
|
|
|
* @param actor
|
|
|
|
*/
|
2013-11-09 07:51:46 +01:00
|
|
|
virtual void castSpell (const MWWorld::Ptr& actor);
|
2013-10-25 22:16:52 +02:00
|
|
|
|
2014-05-16 13:09:23 +02:00
|
|
|
virtual void launchMagicBolt (const std::string& model, const std::string& sound, const std::string& spellId,
|
|
|
|
float speed, bool stack, const ESM::EffectList& effects,
|
2015-06-01 21:41:13 +02:00
|
|
|
const MWWorld::Ptr& caster, const std::string& sourceName, const osg::Vec3f& fallbackDirection);
|
2015-12-18 17:13:54 +01:00
|
|
|
virtual void launchProjectile (MWWorld::Ptr actor, MWWorld::ConstPtr projectile,
|
2015-06-26 05:15:07 +02:00
|
|
|
const osg::Vec3f& worldPos, const osg::Quat& orient, MWWorld::Ptr bow, float speed, float attackStrength);
|
2013-12-08 23:36:37 +01:00
|
|
|
|
2014-01-06 00:02:03 +01:00
|
|
|
|
2013-11-25 13:00:05 +01:00
|
|
|
virtual const std::vector<std::string>& getContentFiles() const;
|
2014-01-06 00:02:03 +01:00
|
|
|
|
2013-12-08 23:36:37 +01:00
|
|
|
virtual void breakInvisibility (const MWWorld::Ptr& actor);
|
2013-12-30 17:53:02 +01:00
|
|
|
// Are we in an exterior or pseudo-exterior cell and it's night?
|
|
|
|
virtual bool isDark() const;
|
2013-12-31 18:35:46 +01:00
|
|
|
|
2016-02-05 00:25:47 +01:00
|
|
|
virtual bool findInteriorPositionInWorldSpace(const MWWorld::CellStore* cell, osg::Vec3f& result);
|
2014-01-01 02:22:11 +01:00
|
|
|
|
2014-01-09 01:49:58 +01:00
|
|
|
/// Teleports \a ptr to the closest reference of \a id (e.g. DivineMarker, PrisonMarker, TempleMarker)
|
2014-01-01 02:22:11 +01:00
|
|
|
/// @note id must be lower case
|
|
|
|
virtual void teleportToClosestMarker (const MWWorld::Ptr& ptr,
|
2014-01-09 01:49:58 +01:00
|
|
|
const std::string& id);
|
2014-01-01 22:37:52 +01:00
|
|
|
|
|
|
|
/// 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);
|
2014-01-09 00:40:25 +01: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();
|
2014-01-11 03:29:41 +01:00
|
|
|
|
|
|
|
/// Moves all stolen items from \a ptr to the closest evidence chest.
|
|
|
|
virtual void confiscateStolenItems(const MWWorld::Ptr& ptr);
|
2014-01-11 06:47:58 +01:00
|
|
|
|
|
|
|
virtual void goToJail ();
|
2014-01-14 07:40:17 +01:00
|
|
|
|
|
|
|
/// Spawn a random creature from a levelled list next to the player
|
|
|
|
virtual void spawnRandomCreature(const std::string& creatureList);
|
2014-01-17 10:52:44 +01:00
|
|
|
|
|
|
|
/// Spawn a blood effect for \a ptr at \a worldPosition
|
2015-04-19 17:55:56 +02:00
|
|
|
virtual void spawnBloodEffect (const MWWorld::Ptr& ptr, const osg::Vec3f& worldPosition);
|
2014-01-20 15:48:06 +01:00
|
|
|
|
2015-04-19 17:55:56 +02:00
|
|
|
virtual void spawnEffect (const std::string& model, const std::string& textureOverride, const osg::Vec3f& worldPos);
|
2014-06-15 21:19:37 +02:00
|
|
|
|
2016-01-12 00:31:34 +01:00
|
|
|
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);
|
2014-06-13 00:01:29 +02:00
|
|
|
|
|
|
|
virtual void activate (const MWWorld::Ptr& object, const MWWorld::Ptr& actor);
|
2014-06-24 18:37:38 +02:00
|
|
|
|
|
|
|
/// @see MWWorld::WeatherManager::isInStorm
|
|
|
|
virtual bool isInStorm() const;
|
|
|
|
|
|
|
|
/// @see MWWorld::WeatherManager::getStormDirection
|
2015-05-12 03:02:15 +02:00
|
|
|
virtual osg::Vec3f getStormDirection() const;
|
2014-08-30 17:55:35 +02:00
|
|
|
|
|
|
|
/// Resets all actors in the current active cells to their original location within that cell.
|
|
|
|
virtual void resetActors();
|
2014-10-05 22:24:11 +02:00
|
|
|
|
2015-12-18 17:36:14 +01:00
|
|
|
virtual bool isWalkingOnWater (const MWWorld::ConstPtr& actor);
|
2015-09-17 01:08:16 +02:00
|
|
|
|
|
|
|
/// Return a vector aiming the actor's weapon towards a target.
|
|
|
|
/// @note The length of the vector is the distance between actor and target.
|
2015-12-18 17:36:14 +01:00
|
|
|
virtual osg::Vec3f aimToTarget(const MWWorld::ConstPtr& actor, const MWWorld::ConstPtr& target);
|
2015-11-18 19:00:43 +01:00
|
|
|
|
|
|
|
/// Return the distance between actor's weapon and target's collision box.
|
2015-12-18 17:36:14 +01:00
|
|
|
virtual float getHitDistance(const MWWorld::ConstPtr& actor, const MWWorld::ConstPtr& target);
|
2016-01-05 23:27:42 +01:00
|
|
|
|
|
|
|
virtual bool isPlayerInJail() const;
|
2010-07-02 09:38:22 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|