2012-07-03 01:06:38 +02:00
|
|
|
#ifndef GAME_MWBASE_WORLD_H
|
|
|
|
#define GAME_MWBASE_WORLD_H
|
|
|
|
|
2019-11-30 12:29:31 +01:00
|
|
|
#include "rotationflags.hpp"
|
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
#include <deque>
|
2014-01-27 13:27:42 +01:00
|
|
|
#include <map>
|
2015-02-03 00:53:30 +01:00
|
|
|
#include <set>
|
2022-08-01 00:28:14 +02:00
|
|
|
#include <span>
|
2022-05-21 10:48:32 +02:00
|
|
|
#include <string_view>
|
2020-11-20 13:11:53 +01:00
|
|
|
#include <vector>
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2022-03-06 20:02:03 +02:00
|
|
|
#include <components/misc/rng.hpp>
|
2015-01-31 17:50:19 +01:00
|
|
|
|
2019-08-25 15:20:14 +02:00
|
|
|
#include "../mwworld/doorstate.hpp"
|
2023-02-07 00:37:55 +01:00
|
|
|
#include "../mwworld/globalvariablename.hpp"
|
2013-01-05 21:12:08 -08:00
|
|
|
#include "../mwworld/ptr.hpp"
|
2022-07-29 16:00:25 +03:00
|
|
|
#include "../mwworld/spellcaststate.hpp"
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2015-05-02 22:45:27 +02:00
|
|
|
#include "../mwrender/rendermode.hpp"
|
|
|
|
|
2015-04-19 17:55:56 +02:00
|
|
|
namespace osg
|
|
|
|
{
|
|
|
|
class Vec3f;
|
2015-12-10 17:48:45 -08:00
|
|
|
class Matrixf;
|
2015-05-31 01:07:43 +02:00
|
|
|
class Quat;
|
2015-06-03 16:40:16 +02:00
|
|
|
class Image;
|
2020-05-22 00:11:23 +02:00
|
|
|
class Stats;
|
2015-04-19 17:55:56 +02:00
|
|
|
}
|
|
|
|
|
2015-01-31 23:27:34 +01:00
|
|
|
namespace Loading
|
2012-07-03 01:06:38 +02:00
|
|
|
{
|
2015-01-31 23:27:34 +01:00
|
|
|
class Listener;
|
2012-07-03 01:06:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
class ESMReader;
|
2013-12-07 13:17:28 +01:00
|
|
|
class ESMWriter;
|
2012-07-03 01:06:38 +02:00
|
|
|
struct Position;
|
|
|
|
struct Cell;
|
|
|
|
struct Class;
|
2020-10-20 09:22:43 +00:00
|
|
|
struct Container;
|
2020-06-02 21:59:37 +02:00
|
|
|
struct Creature;
|
2012-07-03 01:06:38 +02:00
|
|
|
struct Potion;
|
2012-10-15 21:54:19 +02:00
|
|
|
struct Spell;
|
2012-11-08 16:37:57 +04:00
|
|
|
struct NPC;
|
2014-02-23 20:11:05 +01:00
|
|
|
struct Armor;
|
|
|
|
struct Weapon;
|
|
|
|
struct Clothing;
|
|
|
|
struct Enchantment;
|
|
|
|
struct Book;
|
|
|
|
struct EffectList;
|
2014-12-17 01:05:32 +01:00
|
|
|
struct CreatureLevList;
|
|
|
|
struct ItemLevList;
|
2020-06-03 11:32:28 +04:00
|
|
|
struct TimeStamp;
|
2023-02-15 23:19:51 +01:00
|
|
|
class RefId;
|
2023-05-12 13:24:59 +02:00
|
|
|
struct ExteriorCellLocation;
|
2012-07-03 01:06:38 +02:00
|
|
|
}
|
|
|
|
|
2020-07-25 21:12:50 +02:00
|
|
|
namespace MWPhysics
|
|
|
|
{
|
2022-03-18 00:27:16 +01:00
|
|
|
class RayCastingResult;
|
2020-08-03 22:44:16 +02:00
|
|
|
class RayCastingInterface;
|
2020-07-25 21:12:50 +02:00
|
|
|
}
|
|
|
|
|
2012-09-14 21:12:16 +02:00
|
|
|
namespace MWRender
|
|
|
|
{
|
2013-01-16 09:59:19 -08:00
|
|
|
class Animation;
|
2021-06-14 19:58:04 +02:00
|
|
|
class Camera;
|
2022-04-03 20:42:19 +02:00
|
|
|
class RenderingManager;
|
2022-05-13 18:58:00 -07:00
|
|
|
class PostProcessor;
|
2012-09-14 21:12:16 +02:00
|
|
|
}
|
|
|
|
|
2013-03-31 00:13:56 -07:00
|
|
|
namespace MWMechanics
|
|
|
|
{
|
2015-03-06 21:36:42 +13:00
|
|
|
struct Movement;
|
2013-03-31 00:13:56 -07:00
|
|
|
}
|
|
|
|
|
2018-03-14 01:49:08 +03:00
|
|
|
namespace DetourNavigator
|
|
|
|
{
|
2019-02-16 15:27:02 +03:00
|
|
|
struct Navigator;
|
2022-06-17 00:28:44 +02:00
|
|
|
struct AgentBounds;
|
2018-03-14 01:49:08 +03:00
|
|
|
}
|
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class CellStore;
|
|
|
|
class Player;
|
|
|
|
class LocalScripts;
|
|
|
|
class TimeStamp;
|
2012-10-01 19:17:04 +04:00
|
|
|
class ESMStore;
|
2013-01-13 17:05:12 +00:00
|
|
|
class RefData;
|
2023-01-29 12:06:05 +01:00
|
|
|
class Cell;
|
2023-08-06 14:46:15 +02:00
|
|
|
class DateTimeManager;
|
2013-02-05 11:03:39 -08:00
|
|
|
|
2013-03-31 00:13:56 -07:00
|
|
|
typedef std::vector<std::pair<MWWorld::Ptr, MWMechanics::Movement>> PtrMovementList;
|
2012-07-03 01:06:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWBase
|
|
|
|
{
|
2012-08-08 14:54:35 +02:00
|
|
|
/// \brief Interface for the World (implemented in MWWorld)
|
2012-07-03 01:06:38 +02:00
|
|
|
class World
|
|
|
|
{
|
2012-08-28 17:30:34 +02:00
|
|
|
World(const World&);
|
2012-07-03 01:06:38 +02:00
|
|
|
///< not implemented
|
|
|
|
|
|
|
|
World& operator=(const World&);
|
|
|
|
///< not implemented
|
|
|
|
|
2022-09-22 21:26:05 +03:00
|
|
|
public:
|
2012-07-03 01:06:38 +02:00
|
|
|
struct DoorMarker
|
2022-09-22 21:26:05 +03:00
|
|
|
{
|
2012-07-03 01:06:38 +02:00
|
|
|
std::string name;
|
|
|
|
float x, y; // world position
|
2023-02-19 17:42:37 +01:00
|
|
|
ESM::RefId dest;
|
2022-09-22 21:26:05 +03:00
|
|
|
};
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2016-02-05 00:25:14 +01:00
|
|
|
World() {}
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2014-01-01 22:37:52 +01:00
|
|
|
virtual ~World() {}
|
2012-08-28 17:30:34 +02:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual void setRandomSeed(uint32_t seed) = 0;
|
2013-11-28 09:10:38 +01:00
|
|
|
///< \param seed The seed used when starting a new game.
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual void startNewGame(bool bypass) = 0;
|
2013-11-28 09:10:38 +01:00
|
|
|
///< \param bypass Bypass regular game start.
|
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual void clear() = 0;
|
2013-11-28 09:10:38 +01:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual int countSavedGameRecords() const = 0;
|
|
|
|
virtual int countSavedGameCells() const = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual void write(ESM::ESMWriter& writer, Loading::Listener& listener) const = 0;
|
2013-03-18 08:29:40 +01:00
|
|
|
|
2023-07-30 01:22:47 +02:00
|
|
|
virtual void readRecord(ESM::ESMReader& reader, uint32_t type) = 0;
|
2012-12-21 18:09:31 +00:00
|
|
|
|
2015-12-18 17:56:48 +01:00
|
|
|
virtual void useDeathCamera() = 0;
|
2014-10-24 18:49:38 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual void setWaterHeight(const float height) = 0;
|
|
|
|
|
|
|
|
virtual bool toggleWater() = 0;
|
|
|
|
virtual bool toggleWorld() = 0;
|
2018-06-13 01:48:31 +02:00
|
|
|
virtual bool toggleBorders() = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2015-08-27 14:20:45 -05:00
|
|
|
virtual MWWorld::Player& getPlayer() = 0;
|
|
|
|
virtual MWWorld::Ptr getPlayerPtr() = 0;
|
|
|
|
virtual MWWorld::ConstPtr getPlayerConstPtr() const = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2023-04-20 13:37:01 +02:00
|
|
|
virtual MWWorld::ESMStore& getStore() = 0;
|
|
|
|
const MWWorld::ESMStore& getStore() const { return const_cast<MWBase::World*>(this)->getStore(); }
|
2012-09-18 20:53:32 +02:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual const std::vector<int>& getESMVersions() const = 0;
|
2020-06-03 11:32:28 +04:00
|
|
|
|
|
|
|
virtual MWWorld::LocalScripts& getLocalScripts() = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2022-06-13 18:21:29 +02:00
|
|
|
virtual bool isCellExterior() const = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
|
|
|
|
virtual bool isCellQuasiExterior() const = 0;
|
|
|
|
|
2023-04-20 16:16:17 +02:00
|
|
|
virtual void getDoorMarkers(MWWorld::CellStore& cell, std::vector<DoorMarker>& out) = 0;
|
2022-05-13 18:58:00 -07:00
|
|
|
///< get a list of teleport door markers for a given cell, to be displayed on the local map
|
|
|
|
|
2023-02-07 00:37:55 +01:00
|
|
|
virtual void setGlobalInt(MWWorld::GlobalVariableName name, int value) = 0;
|
2019-01-27 16:55:36 +04:00
|
|
|
///< Set value independently from real type.
|
|
|
|
|
2023-02-07 00:37:55 +01:00
|
|
|
virtual void setGlobalFloat(MWWorld::GlobalVariableName name, float value) = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
///< Set value independently from real type.
|
|
|
|
|
2023-02-07 00:37:55 +01:00
|
|
|
virtual int getGlobalInt(MWWorld::GlobalVariableName name) const = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
///< Get value independently from real type.
|
|
|
|
|
2023-02-07 00:37:55 +01:00
|
|
|
virtual float getGlobalFloat(MWWorld::GlobalVariableName name) const = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
///< Get value independently from real type.
|
|
|
|
|
2023-02-07 00:37:55 +01:00
|
|
|
virtual char getGlobalVariableType(MWWorld::GlobalVariableName name) const = 0;
|
2022-06-13 18:21:29 +02:00
|
|
|
///< Return ' ', if there is no global variable with this name.
|
2013-07-27 07:10:18 -07:00
|
|
|
|
2022-12-01 22:09:30 +01:00
|
|
|
virtual std::string_view getCellName(const MWWorld::CellStore* cell = nullptr) const = 0;
|
2013-11-26 11:39:58 +01:00
|
|
|
///< Return name of the cell.
|
2022-09-22 21:26:05 +03:00
|
|
|
///
|
2013-11-26 11:39:58 +01:00
|
|
|
/// \note If cell==0, the cell the player is currently in will be used instead to
|
2012-07-03 01:06:38 +02:00
|
|
|
/// generate a name.
|
2023-01-27 01:13:17 +01:00
|
|
|
virtual std::string_view getCellName(const MWWorld::Cell& cell) const = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2023-01-31 19:50:48 +01:00
|
|
|
virtual std::string_view getCellName(const ESM::Cell* cell) const = 0;
|
|
|
|
|
2022-07-03 12:51:28 +00:00
|
|
|
virtual void removeRefScript(MWWorld::RefData* ref) = 0;
|
|
|
|
//< Remove the script attached to ref from mLocalScripts
|
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
virtual MWWorld::Ptr getPtr(const ESM::RefId& name, bool activeOnly) = 0;
|
2022-07-03 12:51:28 +00:00
|
|
|
///< Return a pointer to a liveCellRef with the given name.
|
|
|
|
/// \param activeOnly do non search inactive cells.
|
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
virtual MWWorld::Ptr searchPtr(const ESM::RefId& name, bool activeOnly, bool searchInContainers = true) = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
///< Return a pointer to a liveCellRef with the given name.
|
2016-02-27 12:53:07 +01:00
|
|
|
/// \param activeOnly do non search inactive cells.
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2016-03-24 17:18:08 +01:00
|
|
|
virtual MWWorld::Ptr searchPtrViaActorId(int actorId) = 0;
|
2016-02-27 12:53:07 +01:00
|
|
|
///< Search is limited to the active cells.
|
2014-01-16 12:03:23 +01:00
|
|
|
|
2022-06-13 18:21:29 +02:00
|
|
|
virtual MWWorld::Ptr findContainer(const MWWorld::ConstPtr& ptr) = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
///< Return a pointer to a liveCellRef which contains \a ptr.
|
|
|
|
/// \note Search is limited to the active cells.
|
|
|
|
|
|
|
|
virtual void enable(const MWWorld::Ptr& ptr) = 0;
|
|
|
|
|
2013-01-07 23:27:37 -08:00
|
|
|
virtual void disable(const MWWorld::Ptr& ptr) = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2016-07-08 23:07:07 +09:00
|
|
|
virtual void advanceTime(double hours, bool incremental = false) = 0;
|
|
|
|
///< Advance in-game time.
|
|
|
|
|
2017-02-02 16:20:34 +09:00
|
|
|
virtual MWWorld::TimeStamp getTimeStamp() const = 0;
|
|
|
|
///< Return current in-game time and number of day since new game start.
|
2013-07-25 12:58:43 -07:00
|
|
|
|
2018-10-24 01:40:57 +03:00
|
|
|
virtual bool toggleSky() = 0;
|
|
|
|
///< \return Resulting mode
|
2014-06-28 14:59:33 +02:00
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
virtual void changeWeather(const ESM::RefId& region, const unsigned int id) = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2021-04-11 18:18:10 +02:00
|
|
|
virtual int getCurrentWeather() const = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2021-08-28 14:36:30 +02:00
|
|
|
virtual int getNextWeather() const = 0;
|
2012-08-08 14:51:33 +04:00
|
|
|
|
2021-10-19 18:36:30 +02:00
|
|
|
virtual float getWeatherTransition() const = 0;
|
2020-12-18 08:18:07 +01:00
|
|
|
|
2022-02-15 17:25:07 +01:00
|
|
|
virtual unsigned int getNightDayMode() const = 0;
|
2012-07-09 15:23:26 +02:00
|
|
|
|
2021-04-11 19:17:17 +02:00
|
|
|
virtual int getMasserPhase() const = 0;
|
2012-07-09 15:23:26 +02:00
|
|
|
|
2021-08-15 19:50:28 +02:00
|
|
|
virtual int getSecundaPhase() const = 0;
|
2016-02-29 17:16:33 +01:00
|
|
|
|
|
|
|
virtual void setMoonColour(bool red) = 0;
|
2012-09-17 13:36:48 +02:00
|
|
|
|
2023-10-14 16:36:45 +02:00
|
|
|
virtual void modRegion(const ESM::RefId& regionid, const std::vector<uint8_t>& chances) = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2018-09-30 08:38:55 +04:00
|
|
|
virtual void changeToInteriorCell(
|
2023-01-19 17:31:45 +01:00
|
|
|
std::string_view cellName, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent = true)
|
2018-09-30 08:38:55 +04:00
|
|
|
= 0;
|
2013-05-06 00:46:50 +01:00
|
|
|
///< Move to interior cell.
|
|
|
|
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
|
|
|
|
|
2023-02-19 17:42:37 +01:00
|
|
|
virtual void changeToCell(
|
|
|
|
const ESM::RefId& cellId, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent = true)
|
|
|
|
= 0;
|
2020-02-02 20:02:25 +01:00
|
|
|
///< @param changeEvent If false, do not trigger cell change flag or detect worldspace changes
|
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual MWWorld::Ptr getFacedObject() = 0;
|
|
|
|
///< Return pointer to the object the player is looking at, if it is within activation range
|
|
|
|
|
2015-05-02 22:45:27 +02:00
|
|
|
virtual float getDistanceToFacedObject() = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2013-03-28 17:41:00 +01:00
|
|
|
virtual float getMaxActivationDistance() const = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2013-03-28 17:41:00 +01:00
|
|
|
virtual void adjustPosition(const MWWorld::Ptr& ptr, bool force) = 0;
|
|
|
|
///< Adjust position after load to be on ground. Must be called after model load.
|
|
|
|
/// @param force do this even if the ptr is flying
|
2012-07-03 01:06:38 +02:00
|
|
|
|
|
|
|
virtual void fixPosition() = 0;
|
2013-03-28 17:41:00 +01:00
|
|
|
///< Attempt to fix position so that the player is not stuck inside the geometry.
|
2012-07-03 01:06:38 +02:00
|
|
|
|
2012-11-08 16:37:57 +04:00
|
|
|
/// @note No-op for items in containers. Use ContainerStore::removeItem instead.
|
|
|
|
virtual void deleteObject(const MWWorld::Ptr& ptr) = 0;
|
2013-03-28 17:41:00 +01:00
|
|
|
virtual void undeleteObject(const MWWorld::Ptr& ptr) = 0;
|
|
|
|
|
|
|
|
virtual MWWorld::Ptr moveObject(
|
|
|
|
const MWWorld::Ptr& ptr, const osg::Vec3f& position, bool movePhysics = true, bool moveToActive = false)
|
|
|
|
= 0;
|
|
|
|
///< @return an updated Ptr in case the Ptr's cell changes
|
|
|
|
|
|
|
|
virtual MWWorld::Ptr moveObject(const MWWorld::Ptr& ptr, MWWorld::CellStore* newCell,
|
|
|
|
const osg::Vec3f& position, bool movePhysics = true, bool keepActive = false)
|
|
|
|
= 0;
|
|
|
|
///< @return an updated Ptr
|
|
|
|
|
In 0.46, SetPos was setting position of actors before physics simulation, and from this position movement was simulated. This changed with async physics merging, and at the same time problems started, mostly with abot's scenic travel.
Skipping the simulation, switching off collisions, and other approaches were not correct as they either broke some mods, or some core mechanics of the engine such as teleportation or waterwalking. As it turns out, the way to go is to simply do _nothing_ (modulo some gymnastics to account for the 1 frame difference in case of async).
Scripted movement and the unstucking logic tends to collide. Early out of unstuck in case the actor doesn't attempt to move. This means there is no AI package for NPC, which are the case for some boats and striders, or the player is content with their position.
2023-03-16 21:33:36 +01:00
|
|
|
virtual MWWorld::Ptr moveObjectBy(const MWWorld::Ptr& ptr, const osg::Vec3f& vec, bool moveToActive) = 0;
|
2013-03-28 17:41:00 +01:00
|
|
|
///< @return an updated Ptr
|
|
|
|
|
|
|
|
virtual void scaleObject(const MWWorld::Ptr& ptr, float scale, bool force = false) = 0;
|
|
|
|
|
|
|
|
virtual void rotateObject(
|
|
|
|
const MWWorld::Ptr& ptr, const osg::Vec3f& rot, RotationFlags flags = RotationFlag_inverseOrder)
|
|
|
|
= 0;
|
2012-11-08 16:37:57 +04:00
|
|
|
|
2014-12-17 01:05:32 +01:00
|
|
|
virtual MWWorld::Ptr placeObject(
|
|
|
|
const MWWorld::ConstPtr& ptr, MWWorld::CellStore* cell, const ESM::Position& pos)
|
|
|
|
= 0;
|
|
|
|
///< Place an object. Makes a copy of the Ptr.
|
|
|
|
|
|
|
|
virtual MWWorld::Ptr safePlaceObject(const MWWorld::ConstPtr& ptr, const MWWorld::ConstPtr& referenceObject,
|
|
|
|
MWWorld::CellStore* referenceCell, int direction, float distance)
|
|
|
|
= 0;
|
|
|
|
///< Place an object in a safe place next to \a referenceObject. \a direction and \a distance specify the wanted
|
2016-02-29 17:16:33 +01:00
|
|
|
///< placement
|
2014-12-17 01:05:32 +01:00
|
|
|
/// relative to \a referenceObject (but the object may be placed somewhere else if the wanted location is
|
|
|
|
/// obstructed).
|
|
|
|
|
2015-12-18 17:42:59 +01:00
|
|
|
virtual void queueMovement(const MWWorld::Ptr& ptr, const osg::Vec3f& velocity) = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
///< Queues movement for \a ptr (in local space), to be applied in the next call to
|
2014-05-15 01:58:44 +02:00
|
|
|
/// doPhysics.
|
2013-04-28 14:59:15 +02:00
|
|
|
|
2013-06-27 14:11:20 -07:00
|
|
|
virtual void updateAnimatedCollisionShape(const MWWorld::Ptr& ptr) = 0;
|
2018-09-23 01:52:56 +03:00
|
|
|
|
2018-09-23 06:25:20 +03:00
|
|
|
virtual const MWPhysics::RayCastingInterface* getRayCasting() const = 0;
|
2012-09-25 02:35:50 +02:00
|
|
|
|
2013-07-07 15:03:06 +04:00
|
|
|
virtual bool castRenderingRay(MWPhysics::RayCastingResult& res, const osg::Vec3f& from, const osg::Vec3f& to,
|
|
|
|
bool ignorePlayer, bool ignoreActors)
|
2022-09-22 21:26:05 +03:00
|
|
|
= 0;
|
|
|
|
|
2022-06-13 18:21:29 +02:00
|
|
|
virtual void setActorCollisionMode(const MWWorld::Ptr& ptr, bool internal, bool external) = 0;
|
|
|
|
virtual bool isActorCollisionEnabled(const MWWorld::Ptr& ptr) = 0;
|
2013-07-27 00:14:55 -07:00
|
|
|
|
|
|
|
virtual bool toggleCollisionMode() = 0;
|
|
|
|
///< Toggle collision mode for player. If disabled player object should ignore
|
|
|
|
/// collisions and gravity.
|
|
|
|
/// \return Resulting mode
|
|
|
|
|
|
|
|
virtual bool toggleRenderMode(MWRender::RenderMode mode) = 0;
|
|
|
|
///< Toggle a render mode.
|
|
|
|
///< \return Resulting mode
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2023-07-08 17:10:07 +02:00
|
|
|
virtual MWWorld::Ptr placeObject(
|
|
|
|
const MWWorld::Ptr& object, float cursorX, float cursorY, int amount, bool copy = true)
|
|
|
|
= 0;
|
2013-08-13 01:19:33 +02:00
|
|
|
///< copy and place an object into the gameworld at the specified cursor position
|
|
|
|
/// @param object
|
2012-07-03 01:06:38 +02:00
|
|
|
/// @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
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2023-07-08 17:10:07 +02:00
|
|
|
virtual MWWorld::Ptr dropObjectOnGround(
|
|
|
|
const MWWorld::Ptr& actor, const MWWorld::Ptr& object, int amount, bool copy = true)
|
2022-09-22 21:26:05 +03:00
|
|
|
= 0;
|
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
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2012-07-03 01:06:38 +02:00
|
|
|
virtual bool canPlaceObject(float cursorX, float cursorY) = 0;
|
2013-08-13 01:19:33 +02:00
|
|
|
///< @return true if it is possible to place on object at specified cursor location
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2015-02-03 00:53:30 +01:00
|
|
|
virtual void processChangedSettings(const std::set<std::pair<std::string, std::string>>& settings) = 0;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2013-02-18 22:39:43 -08:00
|
|
|
virtual bool isFlying(const MWWorld::Ptr& ptr) const = 0;
|
2013-10-02 22:53:29 +02:00
|
|
|
virtual bool isSlowFalling(const MWWorld::Ptr& ptr) const = 0;
|
2015-12-18 17:56:48 +01:00
|
|
|
virtual bool isSwimming(const MWWorld::ConstPtr& object) const = 0;
|
|
|
|
virtual bool isWading(const MWWorld::ConstPtr& object) const = 0;
|
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 = 0;
|
2015-06-01 21:41:13 +02:00
|
|
|
virtual bool isUnderwater(const MWWorld::CellStore* cell, const osg::Vec3f& pos) const = 0;
|
2017-06-09 10:23:46 +04:00
|
|
|
virtual bool isUnderwater(const MWWorld::ConstPtr& object, const float heightRatio) const = 0;
|
2016-08-31 01:05:54 +09:00
|
|
|
virtual bool isWaterWalkingCastableOnTarget(const MWWorld::ConstPtr& target) const = 0;
|
2013-02-14 22:35:15 -08:00
|
|
|
virtual bool isOnGround(const MWWorld::Ptr& ptr) const = 0;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2015-12-18 17:36:14 +01:00
|
|
|
virtual osg::Matrixf getActorHeadTransform(const MWWorld::ConstPtr& actor) const = 0;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2021-06-14 19:58:04 +02:00
|
|
|
virtual MWRender::Camera* getCamera() = 0;
|
2019-09-19 21:48:43 +04:00
|
|
|
virtual void togglePOV(bool force = false) = 0;
|
2014-12-11 20:57:25 +01:00
|
|
|
virtual bool isFirstPerson() const = 0;
|
2020-08-04 06:04:59 +00:00
|
|
|
virtual bool isPreviewModeEnabled() const = 0;
|
2013-04-27 01:24:36 -07:00
|
|
|
virtual bool toggleVanityMode(bool enable) = 0;
|
2023-07-22 00:51:57 +02:00
|
|
|
virtual bool vanityRotateCamera(const float* rot) = 0;
|
2020-06-27 00:58:33 +02:00
|
|
|
virtual void applyDeferredPreviewRotationToPlayer(float dt) = 0;
|
|
|
|
virtual void disableDeferredPreviewRotation() = 0;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2021-03-23 21:07:57 +01:00
|
|
|
virtual void saveLoaded() = 0;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2013-04-29 17:56:16 +02:00
|
|
|
virtual void setupPlayer() = 0;
|
2012-08-14 20:33:29 +04:00
|
|
|
virtual void renderPlayer() = 0;
|
2022-09-22 21:26:05 +03: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) = 0;
|
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
|
2019-08-25 15:20:14 +02:00
|
|
|
virtual void activateDoor(const MWWorld::Ptr& door, MWWorld::DoorState state) = 0;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2018-08-25 10:34:33 +04:00
|
|
|
virtual void getActorsStandingOn(const MWWorld::ConstPtr& object, std::vector<MWWorld::Ptr>& actors)
|
|
|
|
= 0; ///< get a list of actors standing on \a object
|
2015-12-18 17:56:48 +01:00
|
|
|
virtual bool getPlayerStandingOn(const MWWorld::ConstPtr& object)
|
|
|
|
= 0; ///< @return true if the player is standing on \a object
|
|
|
|
virtual bool getActorStandingOn(const MWWorld::ConstPtr& object)
|
|
|
|
= 0; ///< @return true if any actor is standing on \a object
|
|
|
|
virtual bool getPlayerCollidingWith(const MWWorld::ConstPtr& object)
|
|
|
|
= 0; ///< @return true if the player is colliding with \a object
|
|
|
|
virtual bool getActorCollidingWith(const MWWorld::ConstPtr& object)
|
|
|
|
= 0; ///< @return true if any actor is colliding with \a object
|
|
|
|
virtual void hurtStandingActors(const MWWorld::ConstPtr& object, float dmgPerSecond) = 0;
|
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) = 0;
|
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.
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2013-05-01 11:42:24 +02:00
|
|
|
virtual float getWindSpeed() = 0;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2015-12-18 18:00:18 +01:00
|
|
|
virtual void getContainersOwnedBy(const MWWorld::ConstPtr& npc, std::vector<MWWorld::Ptr>& out) = 0;
|
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) = 0;
|
2013-05-27 02:18:36 +02:00
|
|
|
///< get all items in active cells owned by this Npc
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2015-12-18 18:02:57 +01:00
|
|
|
virtual bool getLOS(const MWWorld::ConstPtr& actor, const MWWorld::ConstPtr& targetActor) = 0;
|
2013-09-10 16:16:13 +02:00
|
|
|
///< get Line of Sight (morrowind stupid implementation)
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2016-04-16 16:39:13 -05:00
|
|
|
virtual float getDistToNearestRayHit(
|
|
|
|
const osg::Vec3f& from, const osg::Vec3f& dir, float maxDist, bool includeWater = false)
|
2022-09-22 21:26:05 +03:00
|
|
|
= 0;
|
|
|
|
|
2018-09-21 16:34:23 +04:00
|
|
|
virtual void enableActorCollision(const MWWorld::Ptr& actor, bool enable) = 0;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2018-09-23 01:52:56 +03:00
|
|
|
enum RestPermitted
|
2022-09-22 21:26:05 +03:00
|
|
|
{
|
2018-09-23 01:52:56 +03:00
|
|
|
Rest_Allowed = 0,
|
|
|
|
Rest_OnlyWaiting = 1,
|
2019-04-04 17:18:49 +03:00
|
|
|
Rest_PlayerIsInAir = 2,
|
|
|
|
Rest_PlayerIsUnderwater = 3,
|
|
|
|
Rest_EnemiesAreNearby = 4
|
2022-09-22 21:26:05 +03:00
|
|
|
};
|
|
|
|
|
2018-09-24 14:59:10 +03:00
|
|
|
/// check if the player is allowed to rest
|
2013-03-28 17:41:00 +01:00
|
|
|
virtual RestPermitted canRest() const = 0;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2013-01-16 09:59:19 -08:00
|
|
|
/// \todo Probably shouldn't be here
|
|
|
|
virtual MWRender::Animation* getAnimation(const MWWorld::Ptr& ptr) = 0;
|
|
|
|
virtual const MWRender::Animation* getAnimation(const MWWorld::ConstPtr& ptr) const = 0;
|
2015-01-28 19:14:57 +01:00
|
|
|
virtual void reattachPlayerCamera() = 0;
|
2022-09-22 21:26:05 +03: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) = 0;
|
2021-01-08 19:33:51 +04:00
|
|
|
virtual bool screenshot360(osg::Image* image) = 0;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2013-07-07 15:03:06 +04:00
|
|
|
/// Find default position inside exterior cell specified by name
|
2023-04-02 22:00:39 +02:00
|
|
|
/// \return empty RefId if exterior with given name not exists, the cell's RefId otherwise
|
2023-02-19 17:42:37 +01:00
|
|
|
virtual ESM::RefId findExteriorPosition(std::string_view name, ESM::Position& pos) = 0;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2013-07-07 15:03:06 +04:00
|
|
|
/// Find default position inside interior cell specified by name
|
2023-04-02 22:00:39 +02:00
|
|
|
/// \return empty RefId if interior with given name not exists, the cell's RefId otherwise
|
2023-02-19 17:42:37 +01:00
|
|
|
virtual ESM::RefId findInteriorPosition(std::string_view name, ESM::Position& pos) = 0;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2013-07-27 00:14:55 -07:00
|
|
|
/// Enables or disables use of teleport spell effects (recall, intervention, etc).
|
|
|
|
virtual void enableTeleporting(bool enable) = 0;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2013-07-27 00:14:55 -07:00
|
|
|
/// Returns true if teleport spell effects are allowed.
|
2016-08-31 01:05:54 +09:00
|
|
|
virtual bool isTeleportingEnabled() const = 0;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2013-10-02 15:12:41 +02:00
|
|
|
/// Enables or disables use of levitation spell effect.
|
|
|
|
virtual void enableLevitation(bool enable) = 0;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2013-10-02 15:12:41 +02:00
|
|
|
/// Returns true if levitation spell effect is allowed.
|
|
|
|
virtual bool isLevitationEnabled() const = 0;
|
|
|
|
|
2020-12-22 06:19:18 +03:00
|
|
|
virtual bool getGodModeState() const = 0;
|
2013-09-12 08:30:00 -04:00
|
|
|
|
2013-08-24 21:19:12 -04:00
|
|
|
virtual bool toggleGodMode() = 0;
|
2013-11-09 07:51:46 +01:00
|
|
|
|
2015-02-10 20:25:57 +01:00
|
|
|
virtual bool toggleScripts() = 0;
|
|
|
|
virtual bool getScriptsEnabled() const = 0;
|
|
|
|
|
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
|
2022-07-29 16:00:25 +03:00
|
|
|
* @return Success or the failure condition.
|
2013-12-26 22:06:13 +01:00
|
|
|
*/
|
2022-07-29 16:00:25 +03:00
|
|
|
virtual MWWorld::SpellCastState startSpellCast(const MWWorld::Ptr& actor) = 0;
|
2013-12-26 22:06:13 +01:00
|
|
|
|
2018-06-28 16:58:51 +04:00
|
|
|
virtual void castSpell(const MWWorld::Ptr& actor, bool manualSpell = false) = 0;
|
2013-10-25 22:16:52 +02:00
|
|
|
|
2023-07-25 21:23:59 +00:00
|
|
|
virtual void launchMagicBolt(const ESM::RefId& spellId, const MWWorld::Ptr& caster,
|
|
|
|
const osg::Vec3f& fallbackDirection, ESM::RefNum item)
|
2021-08-27 20:07:50 +02:00
|
|
|
= 0;
|
2018-08-24 15:03:54 +04:00
|
|
|
virtual void launchProjectile(MWWorld::Ptr& actor, MWWorld::Ptr& projectile, const osg::Vec3f& worldPos,
|
|
|
|
const osg::Quat& orient, MWWorld::Ptr& bow, float speed, float attackStrength)
|
|
|
|
= 0;
|
2021-02-25 23:12:14 +00:00
|
|
|
virtual void updateProjectilesCasters() = 0;
|
2013-12-08 23:36:37 +01:00
|
|
|
|
2022-05-06 21:03:02 +02:00
|
|
|
virtual void applyLoopingParticles(const MWWorld::Ptr& ptr) const = 0;
|
2018-03-17 13:41:13 +04:00
|
|
|
|
2013-11-25 13:00:05 +01:00
|
|
|
virtual const std::vector<std::string>& getContentFiles() const = 0;
|
2014-01-06 00:02:03 +01:00
|
|
|
|
2013-12-08 23:36:37 +01:00
|
|
|
virtual void breakInvisibility(const MWWorld::Ptr& actor) = 0;
|
2013-12-10 23:48:49 +01:00
|
|
|
|
2018-03-03 17:18:40 +04:00
|
|
|
// Allow NPCs to use torches?
|
|
|
|
virtual bool useTorches() const = 0;
|
2013-12-31 18:35:46 +01:00
|
|
|
|
2022-09-19 19:05:22 +02:00
|
|
|
virtual float getSunVisibility() const = 0;
|
|
|
|
virtual float getSunPercentage() const = 0;
|
|
|
|
|
2016-02-05 00:25:47 +01:00
|
|
|
virtual bool findInteriorPositionInWorldSpace(const MWWorld::CellStore* cell, osg::Vec3f& result) = 0;
|
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
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
virtual void teleportToClosestMarker(const MWWorld::Ptr& ptr, const ESM::RefId& id) = 0;
|
2014-01-01 22:37:52 +01: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-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() = 0;
|
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) = 0;
|
2014-01-11 06:47:58 +01:00
|
|
|
|
|
|
|
virtual void goToJail() = 0;
|
2014-01-14 07:40:17 +01:00
|
|
|
|
|
|
|
/// Spawn a random creature from a levelled list next to the player
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
virtual void spawnRandomCreature(const ESM::RefId& creatureList) = 0;
|
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) = 0;
|
2014-01-20 15:48:06 +01:00
|
|
|
|
2018-07-15 12:44:25 +04:00
|
|
|
virtual void spawnEffect(const std::string& model, const std::string& textureOverride,
|
|
|
|
const osg::Vec3f& worldPos, float scale = 1.f, bool isMagicVFX = true)
|
|
|
|
= 0;
|
2014-06-15 21:19:37 +02:00
|
|
|
|
2014-06-24 18:37:38 +02:00
|
|
|
/// @see MWWorld::WeatherManager::isInStorm
|
|
|
|
virtual bool isInStorm() const = 0;
|
|
|
|
|
|
|
|
/// @see MWWorld::WeatherManager::getStormDirection
|
2015-05-12 03:02:15 +02:00
|
|
|
virtual osg::Vec3f getStormDirection() const = 0;
|
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() = 0;
|
2014-10-05 22:24:11 +02:00
|
|
|
|
2016-11-20 18:46:58 +01:00
|
|
|
virtual bool isWalkingOnWater(const MWWorld::ConstPtr& actor) const = 0;
|
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.
|
2021-04-07 12:07:03 +04:00
|
|
|
virtual osg::Vec3f aimToTarget(
|
|
|
|
const MWWorld::ConstPtr& actor, const MWWorld::ConstPtr& target, bool isRangedCombat)
|
|
|
|
= 0;
|
2015-11-18 19:00:43 +01:00
|
|
|
|
2018-12-03 20:21:40 +04:00
|
|
|
virtual void addContainerScripts(const MWWorld::Ptr& reference, MWWorld::CellStore* cell) = 0;
|
2015-12-14 02:57:55 +01:00
|
|
|
virtual void removeContainerScripts(const MWWorld::Ptr& reference) = 0;
|
2016-01-05 23:27:42 +01:00
|
|
|
|
|
|
|
virtual bool isPlayerInJail() const = 0;
|
2016-11-16 20:15:25 +01:00
|
|
|
|
2019-01-25 20:04:35 +04:00
|
|
|
virtual void rest(double hours) = 0;
|
2018-09-23 22:03:43 +04:00
|
|
|
|
2018-08-13 08:30:50 +04:00
|
|
|
virtual void setPlayerTraveling(bool traveling) = 0;
|
|
|
|
virtual bool isPlayerTraveling() const = 0;
|
|
|
|
|
2021-08-15 19:50:28 +02:00
|
|
|
virtual void rotateWorldObject(const MWWorld::Ptr& ptr, const osg::Quat& rotate) = 0;
|
2018-05-30 14:43:07 +04:00
|
|
|
|
2016-11-16 20:15:25 +01:00
|
|
|
/// Return terrain height at \a worldPos position.
|
2023-05-14 18:47:09 +02:00
|
|
|
virtual float getTerrainHeightAt(const osg::Vec3f& worldPos, ESM::RefId worldspace) const = 0;
|
2016-11-16 20:15:25 +01:00
|
|
|
|
|
|
|
/// Return physical or rendering half extents of the given actor.
|
|
|
|
virtual osg::Vec3f getHalfExtents(const MWWorld::ConstPtr& actor, bool rendering = false) const = 0;
|
2017-02-01 03:00:33 +01: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)
|
2022-06-19 13:28:33 +02:00
|
|
|
virtual std::filesystem::path exportSceneGraph(const MWWorld::Ptr& ptr) = 0;
|
2017-02-15 00:55:35 +01:00
|
|
|
|
|
|
|
/// Preload VFX associated with this effect list
|
|
|
|
virtual void preloadEffects(const ESM::EffectList* effectList) = 0;
|
2018-03-14 01:49:08 +03:00
|
|
|
|
|
|
|
virtual DetourNavigator::Navigator* getNavigator() const = 0;
|
2018-07-21 13:37:02 +03:00
|
|
|
|
|
|
|
virtual void updateActorPath(const MWWorld::ConstPtr& actor, const std::deque<osg::Vec3f>& path,
|
2022-11-18 01:55:07 +01:00
|
|
|
const DetourNavigator::AgentBounds& agentBounds, const osg::Vec3f& start, const osg::Vec3f& end) const = 0;
|
2018-08-31 01:39:44 +03:00
|
|
|
|
2018-11-03 10:42:14 +04:00
|
|
|
virtual void removeActorPath(const MWWorld::ConstPtr& actor) const = 0;
|
|
|
|
|
2018-08-31 01:39:44 +03:00
|
|
|
virtual void setNavMeshNumberToRender(const std::size_t value) = 0;
|
2019-03-03 14:58:03 +03:00
|
|
|
|
2022-06-17 00:28:44 +02:00
|
|
|
virtual DetourNavigator::AgentBounds getPathfindingAgentBounds(const MWWorld::ConstPtr& actor) const = 0;
|
2019-08-15 19:19:04 +02:00
|
|
|
|
|
|
|
virtual bool hasCollisionWithDoor(
|
2022-11-18 01:55:07 +01:00
|
|
|
const MWWorld::ConstPtr& door, const osg::Vec3f& position, const osg::Vec3f& destination) const = 0;
|
2020-02-09 18:24:08 +01:00
|
|
|
|
2021-09-29 00:42:29 +02:00
|
|
|
virtual bool isAreaOccupiedByOtherActor(const osg::Vec3f& position, const float radius,
|
2022-11-18 01:55:07 +01:00
|
|
|
std::span<const MWWorld::ConstPtr> ignore, std::vector<MWWorld::Ptr>* occupyingActors = nullptr) const = 0;
|
2020-05-22 00:11:23 +02:00
|
|
|
|
|
|
|
virtual void reportStats(unsigned int frameNumber, osg::Stats& stats) const = 0;
|
2020-10-20 09:22:43 +00:00
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
virtual std::vector<MWWorld::Ptr> getAll(const ESM::RefId& id) = 0;
|
2022-03-06 20:02:03 +02:00
|
|
|
|
|
|
|
virtual Misc::Rng::Generator& getPrng() = 0;
|
2022-04-03 20:42:19 +02:00
|
|
|
|
|
|
|
virtual MWRender::RenderingManager* getRenderingManager() = 0;
|
2022-05-13 18:58:00 -07:00
|
|
|
|
|
|
|
virtual MWRender::PostProcessor* getPostProcessor() = 0;
|
2022-05-25 20:41:11 +02:00
|
|
|
|
2023-08-06 14:46:15 +02:00
|
|
|
virtual MWWorld::DateTimeManager* getTimeManager() = 0;
|
|
|
|
|
2022-05-25 20:41:11 +02:00
|
|
|
virtual void setActorActive(const MWWorld::Ptr& ptr, bool value) = 0;
|
2012-07-03 01:06:38 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|