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