mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-20 15:40:32 +00:00
Merge branch 'master' into 'OpenCS_Bug6017'
This commit is contained in:
commit
f68c81e631
@ -29,6 +29,7 @@ Programmers
|
||||
Alex S (docwest)
|
||||
Alexey Yaryshev (skeevert)
|
||||
Allofich
|
||||
Andreas Stöckel
|
||||
Andrei Kortunov (akortunov)
|
||||
AnyOldName3
|
||||
Ardekantur
|
||||
|
11
CHANGELOG.md
11
CHANGELOG.md
@ -3,11 +3,21 @@
|
||||
|
||||
Bug #3737: Scripts from The Underground 2 .esp do not play (all patched versions)
|
||||
Bug #3846: Strings starting with "-" fail to compile if not enclosed in quotes
|
||||
Bug #5379: Wandering NPCs falling through cantons
|
||||
Bug #5453: Magic effect VFX are offset for creatures
|
||||
Bug #5483: AutoCalc flag is not used to calculate spells cost
|
||||
Bug #6037: Morrowind Content Language Cannot be Set to English in OpenMW Launcher
|
||||
Bug #6066: addtopic "return" does not work from within script. No errors thrown
|
||||
Bug #6067: esp loader fails in for certain subrecord orders
|
||||
Bug #6101: Disarming trapped unlocked owned objects isn't considered a crime
|
||||
Bug #6107: Fatigue is incorrectly recalculated when fortify effect is applied or removed
|
||||
Bug #6115: Showmap overzealous matching
|
||||
Bug #6129: Player avatar not displayed correctly for large window sizes when GUI scaling active
|
||||
Bug #6131: Item selection in the avatar window not working correctly for large window sizes
|
||||
Bug #6133: Cannot reliably sneak or steal in the sight of the NPCs siding with player
|
||||
Task #6017: Separate persistent and temporary cell references when saving
|
||||
|
||||
|
||||
0.47.0
|
||||
------
|
||||
|
||||
@ -140,6 +150,7 @@
|
||||
Bug #6036: OpenMW-CS: Terrain selection at the border of cells omits certain corner vertices
|
||||
Bug #6043: Actor can have torch missing when torch animation is played
|
||||
Bug #6047: Mouse bindings can be triggered during save loading
|
||||
Bug #6136: Game freezes when NPCs try to open doors that are about to be closed
|
||||
Feature #390: 3rd person look "over the shoulder"
|
||||
Feature #832: OpenMW-CS: Handle deleted references
|
||||
Feature #1536: Show more information about level on menu
|
||||
|
@ -258,10 +258,10 @@ download() {
|
||||
|
||||
if [ -z $VERBOSE ]; then
|
||||
RET=0
|
||||
curl --silent --retry 10 -Ly 5 -o $FILE $URL || RET=$?
|
||||
curl --silent --fail --retry 10 -Ly 5 -o $FILE $URL || RET=$?
|
||||
else
|
||||
RET=0
|
||||
curl --retry 10 -Ly 5 -o $FILE $URL || RET=$?
|
||||
curl --fail --retry 10 -Ly 5 -o $FILE $URL || RET=$?
|
||||
fi
|
||||
|
||||
if [ $RET -ne 0 ]; then
|
||||
|
@ -458,8 +458,8 @@ else ()
|
||||
"${OpenMW_BINARY_DIR}/openmw.cfg")
|
||||
endif ()
|
||||
|
||||
configure_resource_file(${OpenMW_SOURCE_DIR}/files/openmw-cs.cfg
|
||||
"${OpenMW_BINARY_DIR}" "openmw-cs.cfg")
|
||||
pack_resource_file(${OpenMW_SOURCE_DIR}/files/openmw-cs.cfg
|
||||
"${OpenMW_BINARY_DIR}" "defaults-cs.bin")
|
||||
|
||||
# Needs the copy version because the configure version assumes the end of the file has been reached when a null character is reached and there are no CMake expressions to evaluate.
|
||||
copy_resource_file(${OpenMW_SOURCE_DIR}/files/opencs/defaultfilters
|
||||
@ -928,7 +928,7 @@ elseif(NOT APPLE)
|
||||
INSTALL(FILES "${INSTALL_SOURCE}/gamecontrollerdb.txt" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw")
|
||||
|
||||
IF(BUILD_OPENCS)
|
||||
INSTALL(FILES "${INSTALL_SOURCE}/openmw-cs.cfg" DESTINATION "${SYSCONFDIR}" COMPONENT "opencs")
|
||||
INSTALL(FILES "${INSTALL_SOURCE}/defaults-cs.bin" DESTINATION "${SYSCONFDIR}" COMPONENT "opencs")
|
||||
ENDIF(BUILD_OPENCS)
|
||||
|
||||
# Install resources
|
||||
|
@ -69,7 +69,7 @@ namespace
|
||||
AreaType generateAreaType(Random& random)
|
||||
{
|
||||
std::uniform_int_distribution<int> distribution(0, 4);
|
||||
return toAreaType(distribution(random));;
|
||||
return toAreaType(distribution(random));
|
||||
}
|
||||
|
||||
template <typename OutputIterator, typename Random>
|
||||
|
@ -158,7 +158,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
if(APPLE)
|
||||
set (OPENCS_MAC_ICON "${CMAKE_SOURCE_DIR}/files/mac/openmw-cs.icns")
|
||||
set (OPENCS_CFG "${OpenMW_BINARY_DIR}/openmw-cs.cfg")
|
||||
set (OPENCS_CFG "${OpenMW_BINARY_DIR}/defaults-cs.bin")
|
||||
set (OPENCS_DEFAULT_FILTERS_FILE "${OpenMW_BINARY_DIR}/resources/defaultfilters")
|
||||
set (OPENCS_OPENMW_CFG "${OpenMW_BINARY_DIR}/openmw.cfg")
|
||||
else()
|
||||
@ -270,7 +270,7 @@ if (WIN32)
|
||||
SET(INSTALL_SOURCE "${OpenMW_BINARY_DIR}")
|
||||
endif ()
|
||||
|
||||
INSTALL(FILES "${INSTALL_SOURCE}/openmw-cs.cfg" DESTINATION ".")
|
||||
INSTALL(FILES "${INSTALL_SOURCE}/defaults-cs.bin" DESTINATION ".")
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
|
@ -78,7 +78,7 @@ void CSMDoc::Runner::start (bool delayed)
|
||||
else
|
||||
arguments << "--new-game=1";
|
||||
|
||||
arguments << ("--script-run="+mStartup->fileName());;
|
||||
arguments << ("--script-run="+mStartup->fileName());
|
||||
|
||||
arguments <<
|
||||
QString::fromUtf8 (("--data=\""+mProjectPath.parent_path().string()+"\"").c_str());
|
||||
|
@ -17,15 +17,15 @@ CSMPrefs::State *CSMPrefs::State::sThis = nullptr;
|
||||
void CSMPrefs::State::load()
|
||||
{
|
||||
// default settings file
|
||||
boost::filesystem::path local = mConfigurationManager.getLocalPath() / mConfigFile;
|
||||
boost::filesystem::path global = mConfigurationManager.getGlobalPath() / mConfigFile;
|
||||
boost::filesystem::path local = mConfigurationManager.getLocalPath() / mDefaultConfigFile;
|
||||
boost::filesystem::path global = mConfigurationManager.getGlobalPath() / mDefaultConfigFile;
|
||||
|
||||
if (boost::filesystem::exists (local))
|
||||
mSettings.loadDefault (local.string());
|
||||
else if (boost::filesystem::exists (global))
|
||||
mSettings.loadDefault (global.string());
|
||||
else
|
||||
throw std::runtime_error ("No default settings file found! Make sure the file \"openmw-cs.cfg\" was properly installed.");
|
||||
throw std::runtime_error ("No default settings file found! Make sure the file \"" + mDefaultConfigFile + "\" was properly installed.");
|
||||
|
||||
// user settings file
|
||||
boost::filesystem::path user = mConfigurationManager.getUserConfigPath() / mConfigFile;
|
||||
@ -641,7 +641,7 @@ void CSMPrefs::State::setDefault (const std::string& key, const std::string& def
|
||||
}
|
||||
|
||||
CSMPrefs::State::State (const Files::ConfigurationManager& configurationManager)
|
||||
: mConfigFile ("openmw-cs.cfg"), mConfigurationManager (configurationManager),
|
||||
: mConfigFile ("openmw-cs.cfg"), mDefaultConfigFile("defaults-cs.bin"), mConfigurationManager (configurationManager),
|
||||
mCurrentCategory (mCategories.end())
|
||||
{
|
||||
if (sThis)
|
||||
|
@ -48,6 +48,7 @@ namespace CSMPrefs
|
||||
private:
|
||||
|
||||
const std::string mConfigFile;
|
||||
const std::string mDefaultConfigFile;
|
||||
const Files::ConfigurationManager& mConfigurationManager;
|
||||
ShortcutManager mShortcutManager;
|
||||
Settings::Manager mSettings;
|
||||
|
@ -23,7 +23,7 @@ CSVRender::CellArrow *CSVRender::CellArrowTag::getCellArrow() const
|
||||
return mArrow;
|
||||
}
|
||||
|
||||
QString CSVRender::CellArrowTag::getToolTip (bool hideBasics) const
|
||||
QString CSVRender::CellArrowTag::getToolTip(bool hideBasics, const WorldspaceHitResult& /*hit*/) const
|
||||
{
|
||||
QString text ("Direction: ");
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace CSVRender
|
||||
|
||||
CellArrow *getCellArrow() const;
|
||||
|
||||
QString getToolTip (bool hideBasics) const override;
|
||||
QString getToolTip(bool hideBasics, const WorldspaceHitResult& hit) const override;
|
||||
};
|
||||
|
||||
|
||||
|
@ -61,7 +61,7 @@ CSVRender::ObjectTag::ObjectTag (Object* object)
|
||||
: TagBase (Mask_Reference), mObject (object)
|
||||
{}
|
||||
|
||||
QString CSVRender::ObjectTag::getToolTip (bool hideBasics) const
|
||||
QString CSVRender::ObjectTag::getToolTip(bool /*hideBasics*/, const WorldspaceHitResult& /*hit*/) const
|
||||
{
|
||||
return QString::fromUtf8 (mObject->getReferenceableId().c_str());
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ namespace CSVRender
|
||||
|
||||
Object* mObject;
|
||||
|
||||
QString getToolTip (bool hideBasics) const override;
|
||||
QString getToolTip (bool hideBasics, const WorldspaceHitResult& hit) const override;
|
||||
};
|
||||
|
||||
class ObjectMarkerTag : public ObjectTag
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "../../model/world/commandmacro.hpp"
|
||||
#include "../../model/world/data.hpp"
|
||||
#include "../../model/world/idtree.hpp"
|
||||
#include "worldspacewidget.hpp"
|
||||
|
||||
namespace CSVRender
|
||||
{
|
||||
@ -40,10 +41,13 @@ namespace CSVRender
|
||||
return mPathgrid;
|
||||
}
|
||||
|
||||
QString PathgridTag::getToolTip(bool hideBasics) const
|
||||
QString PathgridTag::getToolTip(bool /*hideBasics*/, const WorldspaceHitResult& hit) const
|
||||
{
|
||||
QString text("Pathgrid: ");
|
||||
text += mPathgrid->getId().c_str();
|
||||
text += " (";
|
||||
text += QString::number(SceneUtil::getPathgridNode(static_cast<unsigned short>(hit.index0)));
|
||||
text += ")";
|
||||
|
||||
return text;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ namespace CSVRender
|
||||
|
||||
Pathgrid* getPathgrid () const;
|
||||
|
||||
QString getToolTip (bool hideBasics) const override;
|
||||
QString getToolTip (bool hideBasics, const WorldspaceHitResult& hit) const override;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -8,7 +8,7 @@ CSVRender::Mask CSVRender::TagBase::getMask() const
|
||||
return mMask;
|
||||
}
|
||||
|
||||
QString CSVRender::TagBase::getToolTip (bool hideBasics) const
|
||||
QString CSVRender::TagBase::getToolTip (bool hideBasics, const WorldspaceHitResult& /*hit*/) const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
namespace CSVRender
|
||||
{
|
||||
struct WorldspaceHitResult;
|
||||
|
||||
class TagBase : public osg::Referenced
|
||||
{
|
||||
Mask mMask;
|
||||
@ -19,7 +21,7 @@ namespace CSVRender
|
||||
|
||||
Mask getMask() const;
|
||||
|
||||
virtual QString getToolTip (bool hideBasics) const;
|
||||
virtual QString getToolTip (bool hideBasics, const WorldspaceHitResult& hit) const;
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -592,7 +592,7 @@ void CSVRender::WorldspaceWidget::showToolTip()
|
||||
if (hit.tag)
|
||||
{
|
||||
bool hideBasics = CSMPrefs::get()["Tooltips"]["scene-hide-basic"].isTrue();
|
||||
QToolTip::showText (pos, hit.tag->getToolTip (hideBasics), this);
|
||||
QToolTip::showText(pos, hit.tag->getToolTip(hideBasics, hit), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ CSVWorld::ScriptSubView::ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc:
|
||||
sizes << 1 << 0;
|
||||
mMain->setSizes (sizes);
|
||||
|
||||
QWidget *widget = new QWidget (this);;
|
||||
QWidget *widget = new QWidget (this);
|
||||
widget->setLayout (&mLayout);
|
||||
setWidget (widget);
|
||||
|
||||
|
@ -88,7 +88,7 @@ namespace MWBase
|
||||
virtual void setPlayerClass (const ESM::Class& class_) = 0;
|
||||
///< Set player class to custom class.
|
||||
|
||||
virtual void restoreDynamicStats(MWWorld::Ptr actor, double hours, bool sleep) = 0;
|
||||
virtual void restoreDynamicStats(const MWWorld::Ptr& actor, double hours, bool sleep) = 0;
|
||||
|
||||
virtual void rest(double hours, bool sleep) = 0;
|
||||
///< If the player is sleeping or waiting, this should be called every hour.
|
||||
@ -230,7 +230,7 @@ namespace MWBase
|
||||
virtual bool isReadyToBlock (const MWWorld::Ptr& ptr) const = 0;
|
||||
virtual bool isAttackingOrSpell(const MWWorld::Ptr &ptr) const = 0;
|
||||
|
||||
virtual void castSpell(const MWWorld::Ptr& ptr, const std::string spellId, bool manualSpell) = 0;
|
||||
virtual void castSpell(const MWWorld::Ptr& ptr, const std::string& spellId, bool manualSpell) = 0;
|
||||
|
||||
virtual void processChangedSettings (const std::set< std::pair<std::string, std::string> >& settings) = 0;
|
||||
|
||||
|
@ -171,7 +171,7 @@ namespace MWBase
|
||||
virtual void setDragDrop(bool dragDrop) = 0;
|
||||
virtual bool getWorldMouseOver() = 0;
|
||||
|
||||
virtual float getScalingFactor() = 0;
|
||||
virtual float getScalingFactor() const = 0;
|
||||
|
||||
virtual bool toggleFogOfWar() = 0;
|
||||
|
||||
|
@ -38,10 +38,10 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void Activator::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
void Activator::insertObject(const MWWorld::Ptr& ptr, const std::string& model, osg::Quat rotation, MWPhysics::PhysicsSystem& physics, bool skipAnimated) const
|
||||
{
|
||||
if(!model.empty())
|
||||
physics.addObject(ptr, model);
|
||||
physics.addObject(ptr, model, rotation, MWPhysics::CollisionType_World, skipAnimated);
|
||||
}
|
||||
|
||||
std::string Activator::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
|
@ -17,7 +17,7 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, osg::Quat rotation, MWPhysics::PhysicsSystem& physics, bool skipAnimated = false) const override;
|
||||
|
||||
std::string getName (const MWWorld::ConstPtr& ptr) const override;
|
||||
///< \return name or ID; can return an empty string.
|
||||
|
@ -17,16 +17,12 @@
|
||||
|
||||
namespace MWClass
|
||||
{
|
||||
Actor::Actor() {}
|
||||
|
||||
Actor::~Actor() {}
|
||||
|
||||
void Actor::adjustPosition(const MWWorld::Ptr& ptr, bool force) const
|
||||
{
|
||||
MWBase::Environment::get().getWorld()->adjustPosition(ptr, force);
|
||||
}
|
||||
|
||||
void Actor::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
void Actor::insertObject(const MWWorld::Ptr& ptr, const std::string& model, osg::Quat rotation, MWPhysics::PhysicsSystem& physics, bool skipAnimated) const
|
||||
{
|
||||
if (!model.empty())
|
||||
{
|
||||
|
@ -15,16 +15,16 @@ namespace MWClass
|
||||
{
|
||||
protected:
|
||||
|
||||
Actor();
|
||||
Actor() = default;
|
||||
|
||||
public:
|
||||
virtual ~Actor();
|
||||
~Actor() override = default;
|
||||
|
||||
void adjustPosition(const MWWorld::Ptr& ptr, bool force) const override;
|
||||
///< Adjust position to stand on ground. Must be called post model load
|
||||
/// @param force do this even if the ptr is flying
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, osg::Quat rotation, MWPhysics::PhysicsSystem& physics, bool skipAnimated = false) const override;
|
||||
|
||||
bool useAnim() const override;
|
||||
|
||||
@ -46,8 +46,8 @@ namespace MWClass
|
||||
float getCurrentSpeed(const MWWorld::Ptr& ptr) const override;
|
||||
|
||||
// not implemented
|
||||
Actor(const Actor&);
|
||||
Actor& operator= (const Actor&);
|
||||
Actor(const Actor&) = delete;
|
||||
Actor& operator= (const Actor&) = delete;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -26,11 +26,6 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void Apparatus::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
{
|
||||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Apparatus::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
const MWWorld::LiveCellRef<ESM::Apparatus> *ref = ptr.get<ESM::Apparatus>();
|
||||
|
@ -17,8 +17,6 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
|
||||
std::string getName (const MWWorld::ConstPtr& ptr) const override;
|
||||
///< \return name or ID; can return an empty string.
|
||||
|
||||
|
@ -34,11 +34,6 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void Armor::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
{
|
||||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Armor::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
const MWWorld::LiveCellRef<ESM::Armor> *ref = ptr.get<ESM::Armor>();
|
||||
|
@ -16,8 +16,6 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
|
||||
std::string getName (const MWWorld::ConstPtr& ptr) const override;
|
||||
///< \return name or ID; can return an empty string.
|
||||
|
||||
|
@ -22,10 +22,6 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void BodyPart::insertObject(const MWWorld::Ptr &ptr, const std::string &model, MWPhysics::PhysicsSystem &physics) const
|
||||
{
|
||||
}
|
||||
|
||||
std::string BodyPart::getName(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
return std::string();
|
||||
|
@ -15,8 +15,6 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
|
||||
std::string getName (const MWWorld::ConstPtr& ptr) const override;
|
||||
///< \return name or ID; can return an empty string.
|
||||
|
||||
|
@ -31,11 +31,6 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void Book::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
{
|
||||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Book::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
const MWWorld::LiveCellRef<ESM::Book> *ref = ptr.get<ESM::Book>();
|
||||
|
@ -14,8 +14,6 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
|
||||
std::string getName (const MWWorld::ConstPtr& ptr) const override;
|
||||
///< \return name or ID; can return an empty string.
|
||||
|
||||
|
@ -29,11 +29,6 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void Clothing::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
{
|
||||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Clothing::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
const MWWorld::LiveCellRef<ESM::Clothing> *ref = ptr.get<ESM::Clothing>();
|
||||
|
@ -14,8 +14,6 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
|
||||
std::string getName (const MWWorld::ConstPtr& ptr) const override;
|
||||
///< \return name or ID; can return an empty string.
|
||||
|
||||
|
@ -106,10 +106,10 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void Container::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
void Container::insertObject(const MWWorld::Ptr& ptr, const std::string& model, osg::Quat rotation, MWPhysics::PhysicsSystem& physics, bool skipAnimated) const
|
||||
{
|
||||
if(!model.empty())
|
||||
physics.addObject(ptr, model);
|
||||
physics.addObject(ptr, model, rotation, MWPhysics::CollisionType_World, skipAnimated);
|
||||
}
|
||||
|
||||
std::string Container::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
|
@ -42,7 +42,7 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, osg::Quat rotation, MWPhysics::PhysicsSystem& physics, bool skipAnimated = false) const override;
|
||||
|
||||
std::string getName (const MWWorld::ConstPtr& ptr) const override;
|
||||
///< \return name or ID; can return an empty string.
|
||||
|
@ -55,10 +55,10 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void Door::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
void Door::insertObject(const MWWorld::Ptr& ptr, const std::string& model, osg::Quat rotation, MWPhysics::PhysicsSystem& physics, bool skipAnimated) const
|
||||
{
|
||||
if(!model.empty())
|
||||
physics.addObject(ptr, model, MWPhysics::CollisionType_Door);
|
||||
physics.addObject(ptr, model, rotation, MWPhysics::CollisionType_Door, skipAnimated);
|
||||
|
||||
// Resume the door's opening/closing animation if it wasn't finished
|
||||
if (ptr.getRefData().getCustomData())
|
||||
@ -132,12 +132,14 @@ namespace MWClass
|
||||
MWBase::Environment::get().getWorld()->getMaxActivationDistance())
|
||||
{
|
||||
MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(ptr);
|
||||
if(animation)
|
||||
{
|
||||
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
int index = ESM::MagicEffect::effectStringToId("sEffectTelekinesis");
|
||||
const ESM::MagicEffect *effect = store.get<ESM::MagicEffect>().find(index);
|
||||
|
||||
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||
int index = ESM::MagicEffect::effectStringToId("sEffectTelekinesis");
|
||||
const ESM::MagicEffect *effect = store.get<ESM::MagicEffect>().find(index);
|
||||
|
||||
animation->addSpellCastGlow(effect, 1); // 1 second glow to match the time taken for a door opening or closing
|
||||
animation->addSpellCastGlow(effect, 1); // 1 second glow to match the time taken for a door opening or closing
|
||||
}
|
||||
}
|
||||
|
||||
const std::string keyId = ptr.getCellRef().getKey();
|
||||
|
@ -18,7 +18,7 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, osg::Quat rotation, MWPhysics::PhysicsSystem& physics, bool skipAnimated = false) const override;
|
||||
|
||||
bool isDoor() const override;
|
||||
|
||||
|
@ -28,11 +28,6 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void Ingredient::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
{
|
||||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Ingredient::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
const MWWorld::LiveCellRef<ESM::Ingredient> *ref = ptr.get<ESM::Ingredient>();
|
||||
|
@ -14,8 +14,6 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
|
||||
std::string getName (const MWWorld::ConstPtr& ptr) const override;
|
||||
///< \return name or ID; can return an empty string.
|
||||
|
||||
|
@ -33,7 +33,7 @@ namespace MWClass
|
||||
renderingInterface.getObjects().insertModel(ptr, model, true, !(ref->mBase->mData.mFlags & ESM::Light::OffDefault));
|
||||
}
|
||||
|
||||
void Light::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
void Light::insertObject(const MWWorld::Ptr& ptr, const std::string& model, osg::Quat rotation, MWPhysics::PhysicsSystem& physics, bool skipAnimated) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
@ -41,7 +41,7 @@ namespace MWClass
|
||||
|
||||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
if (!model.empty() && (ref->mBase->mData.mFlags & ESM::Light::Carry) == 0)
|
||||
physics.addObject(ptr, model);
|
||||
physics.addObject(ptr, model, rotation, MWPhysics::CollisionType_World, skipAnimated);
|
||||
|
||||
if (!ref->mBase->mSound.empty() && !(ref->mBase->mData.mFlags & ESM::Light::OffDefault))
|
||||
MWBase::Environment::get().getSoundManager()->playSound3D(ptr, ref->mBase->mSound, 1.0, 1.0,
|
||||
|
@ -14,7 +14,7 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, osg::Quat rotation, MWPhysics::PhysicsSystem& physics, bool skipAnimated = false) const override;
|
||||
|
||||
bool useAnim() const override;
|
||||
|
||||
|
@ -28,11 +28,6 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void Lockpick::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
{
|
||||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Lockpick::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
const MWWorld::LiveCellRef<ESM::Lockpick> *ref = ptr.get<ESM::Lockpick>();
|
||||
|
@ -14,8 +14,6 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
|
||||
std::string getName (const MWWorld::ConstPtr& ptr) const override;
|
||||
///< \return name or ID; can return an empty string.
|
||||
|
||||
|
@ -37,11 +37,6 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void Miscellaneous::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
{
|
||||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Miscellaneous::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
const MWWorld::LiveCellRef<ESM::Miscellaneous> *ref = ptr.get<ESM::Miscellaneous>();
|
||||
|
@ -14,8 +14,6 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
|
||||
std::string getName (const MWWorld::ConstPtr& ptr) const override;
|
||||
///< \return name or ID; can return an empty string.
|
||||
|
||||
|
@ -30,11 +30,6 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void Potion::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
{
|
||||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Potion::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
const MWWorld::LiveCellRef<ESM::Potion> *ref = ptr.get<ESM::Potion>();
|
||||
|
@ -14,8 +14,6 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
|
||||
std::string getName (const MWWorld::ConstPtr& ptr) const override;
|
||||
///< \return name or ID; can return an empty string.
|
||||
|
||||
|
@ -28,11 +28,6 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void Probe::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
{
|
||||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Probe::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
const MWWorld::LiveCellRef<ESM::Probe> *ref = ptr.get<ESM::Probe>();
|
||||
|
@ -14,8 +14,6 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
|
||||
std::string getName (const MWWorld::ConstPtr& ptr) const override;
|
||||
///< \return name or ID; can return an empty string.
|
||||
|
||||
|
@ -25,11 +25,6 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void Repair::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
{
|
||||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Repair::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
const MWWorld::LiveCellRef<ESM::Repair> *ref = ptr.get<ESM::Repair>();
|
||||
|
@ -14,8 +14,6 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
|
||||
std::string getName (const MWWorld::ConstPtr& ptr) const override;
|
||||
///< \return name or ID; can return an empty string.
|
||||
|
||||
|
@ -23,10 +23,10 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void Static::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
void Static::insertObject(const MWWorld::Ptr& ptr, const std::string& model, osg::Quat rotation, MWPhysics::PhysicsSystem& physics, bool skipAnimated) const
|
||||
{
|
||||
if(!model.empty())
|
||||
physics.addObject(ptr, model);
|
||||
physics.addObject(ptr, model, rotation, MWPhysics::CollisionType_World, skipAnimated);
|
||||
}
|
||||
|
||||
std::string Static::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
|
@ -14,7 +14,7 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, osg::Quat rotation, MWPhysics::PhysicsSystem& physics, bool skipAnimated = false) const override;
|
||||
|
||||
std::string getName (const MWWorld::ConstPtr& ptr) const override;
|
||||
///< \return name or ID; can return an empty string.
|
||||
|
@ -34,11 +34,6 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
void Weapon::insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const
|
||||
{
|
||||
// TODO: add option somewhere to enable collision for placeable objects
|
||||
}
|
||||
|
||||
std::string Weapon::getModel(const MWWorld::ConstPtr &ptr) const
|
||||
{
|
||||
const MWWorld::LiveCellRef<ESM::Weapon> *ref = ptr.get<ESM::Weapon>();
|
||||
|
@ -15,8 +15,6 @@ namespace MWClass
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
|
||||
|
||||
std::string getName (const MWWorld::ConstPtr& ptr) const override;
|
||||
///< \return name or ID; can return an empty string.
|
||||
|
||||
|
@ -50,15 +50,16 @@ namespace MWDialogue
|
||||
const MWWorld::Store<ESM::Dialogue> & dialogs =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>();
|
||||
|
||||
std::list<std::string> keywordList;
|
||||
for (MWWorld::Store<ESM::Dialogue>::iterator it = dialogs.begin(); it != dialogs.end(); ++it)
|
||||
keywordList.push_back(Misc::StringUtils::lowerCase(it->mId));
|
||||
keywordList.sort(Misc::StringUtils::ciLess);
|
||||
std::vector<std::string> keywordList;
|
||||
keywordList.reserve(dialogs.getSize());
|
||||
for (const auto& it : dialogs)
|
||||
keywordList.push_back(Misc::StringUtils::lowerCase(it.mId));
|
||||
sort(keywordList.begin(), keywordList.end());
|
||||
|
||||
KeywordSearch<std::string, int /*unused*/> keywordSearch;
|
||||
|
||||
for (std::list<std::string>::const_iterator it = keywordList.begin(); it != keywordList.end(); ++it)
|
||||
keywordSearch.seed(*it, 0 /*unused*/);
|
||||
for (const auto& it : keywordList)
|
||||
keywordSearch.seed(it, 0 /*unused*/);
|
||||
|
||||
std::vector<KeywordSearch<std::string, int /*unused*/>::Match> matches;
|
||||
keywordSearch.highlightKeywords(text.begin(), text.end(), matches);
|
||||
|
@ -16,8 +16,6 @@
|
||||
|
||||
namespace MWDialogue
|
||||
{
|
||||
Entry::Entry() {}
|
||||
|
||||
Entry::Entry (const std::string& topic, const std::string& infoId, const MWWorld::Ptr& actor)
|
||||
: mInfoId (infoId)
|
||||
{
|
||||
@ -60,8 +58,6 @@ namespace MWDialogue
|
||||
}
|
||||
|
||||
|
||||
JournalEntry::JournalEntry() {}
|
||||
|
||||
JournalEntry::JournalEntry (const std::string& topic, const std::string& infoId, const MWWorld::Ptr& actor)
|
||||
: Entry (topic, infoId, actor), mTopic (topic)
|
||||
{}
|
||||
|
@ -22,7 +22,7 @@ namespace MWDialogue
|
||||
std::string mText;
|
||||
std::string mActorName; // optional
|
||||
|
||||
Entry();
|
||||
Entry() = default;
|
||||
|
||||
/// actor is optional
|
||||
Entry (const std::string& topic, const std::string& infoId, const MWWorld::Ptr& actor);
|
||||
@ -41,7 +41,7 @@ namespace MWDialogue
|
||||
{
|
||||
std::string mTopic;
|
||||
|
||||
JournalEntry();
|
||||
JournalEntry() = default;
|
||||
|
||||
JournalEntry (const std::string& topic, const std::string& infoId, const MWWorld::Ptr& actor);
|
||||
|
||||
|
@ -746,9 +746,7 @@ namespace
|
||||
mVertexColourType = MyGUI::RenderManager::getInstance().getVertexFormat();
|
||||
}
|
||||
|
||||
~GlyphStream ()
|
||||
{
|
||||
}
|
||||
~GlyphStream () = default;
|
||||
|
||||
MyGUI::Vertex* end () const { return mVertices; }
|
||||
|
||||
|
@ -488,7 +488,7 @@ namespace MWGui
|
||||
mHistoryContents.clear();
|
||||
}
|
||||
|
||||
bool DialogueWindow::setKeywords(std::list<std::string> keyWords)
|
||||
bool DialogueWindow::setKeywords(const std::list<std::string>& keyWords)
|
||||
{
|
||||
if (mKeywords == keyWords && isCompanion() == mIsCompanion)
|
||||
return false;
|
||||
|
@ -118,7 +118,7 @@ namespace MWGui
|
||||
void setPtr(const MWWorld::Ptr& actor) override;
|
||||
|
||||
/// @return true if stale keywords were updated successfully
|
||||
bool setKeywords(std::list<std::string> keyWord);
|
||||
bool setKeywords(const std::list<std::string>& keyWord);
|
||||
|
||||
void addResponse (const std::string& title, const std::string& text, bool needMargin = true);
|
||||
|
||||
|
@ -461,14 +461,10 @@ namespace MWGui
|
||||
|
||||
void InventoryWindow::updatePreviewSize()
|
||||
{
|
||||
MyGUI::IntSize size = mAvatarImage->getSize();
|
||||
int width = std::min(mPreview->getTextureWidth(), size.width);
|
||||
int height = std::min(mPreview->getTextureHeight(), size.height);
|
||||
float scalingFactor = MWBase::Environment::get().getWindowManager()->getScalingFactor();
|
||||
mPreview->setViewport(int(width*scalingFactor), int(height*scalingFactor));
|
||||
|
||||
const MyGUI::IntSize viewport = getPreviewViewportSize();
|
||||
mPreview->setViewport(viewport.width, viewport.height);
|
||||
mAvatarImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f,
|
||||
width*scalingFactor/float(mPreview->getTextureWidth()), height*scalingFactor/float(mPreview->getTextureHeight())));
|
||||
viewport.width / float(mPreview->getTextureWidth()), viewport.height / float(mPreview->getTextureHeight())));
|
||||
}
|
||||
|
||||
void InventoryWindow::onNameFilterChanged(MyGUI::EditBox* _sender)
|
||||
@ -629,15 +625,8 @@ namespace MWGui
|
||||
|
||||
MWWorld::Ptr InventoryWindow::getAvatarSelectedItem(int x, int y)
|
||||
{
|
||||
// convert to OpenGL lower-left origin
|
||||
y = (mAvatarImage->getHeight()-1) - y;
|
||||
|
||||
// Scale coordinates
|
||||
float scalingFactor = MWBase::Environment::get().getWindowManager()->getScalingFactor();
|
||||
x = static_cast<int>(x*scalingFactor);
|
||||
y = static_cast<int>(y*scalingFactor);
|
||||
|
||||
int slot = mPreview->getSlotSelected (x, y);
|
||||
const osg::Vec2f viewport_coords = mapPreviewWindowToViewport(x, y);
|
||||
int slot = mPreview->getSlotSelected(viewport_coords.x(), viewport_coords.y());
|
||||
|
||||
if (slot == -1)
|
||||
return MWWorld::Ptr();
|
||||
@ -832,4 +821,26 @@ namespace MWGui
|
||||
{
|
||||
mPreview->rebuild();
|
||||
}
|
||||
|
||||
MyGUI::IntSize InventoryWindow::getPreviewViewportSize() const
|
||||
{
|
||||
const MyGUI::IntSize previewWindowSize = mAvatarImage->getSize();
|
||||
const float scale = MWBase::Environment::get().getWindowManager()->getScalingFactor();
|
||||
|
||||
return MyGUI::IntSize(std::min<int>(mPreview->getTextureWidth(), previewWindowSize.width * scale),
|
||||
std::min<int>(mPreview->getTextureHeight(), previewWindowSize.height * scale));
|
||||
}
|
||||
|
||||
osg::Vec2f InventoryWindow::mapPreviewWindowToViewport(int x, int y) const
|
||||
{
|
||||
const MyGUI::IntSize previewWindowSize = mAvatarImage->getSize();
|
||||
const float normalisedX = x / std::max<float>(1.0f, previewWindowSize.width);
|
||||
const float normalisedY = y / std::max<float>(1.0f, previewWindowSize.height);
|
||||
|
||||
const MyGUI::IntSize viewport = getPreviewViewportSize();
|
||||
return osg::Vec2f(
|
||||
normalisedX * float(viewport.width - 1),
|
||||
(1.0 - normalisedY) * float(viewport.height - 1)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -130,6 +130,9 @@ namespace MWGui
|
||||
void updatePreviewSize();
|
||||
void updateArmorRating();
|
||||
|
||||
MyGUI::IntSize getPreviewViewportSize() const;
|
||||
osg::Vec2f mapPreviewWindowToViewport(int x, int y) const;
|
||||
|
||||
void adjustPanes();
|
||||
|
||||
/// Unequips count items from mSelectedItem, if it is equipped, and then updates mSelectedItem in case the items were re-stacked
|
||||
|
@ -1326,7 +1326,7 @@ namespace MWGui
|
||||
return mHud->getWorldMouseOver();
|
||||
}
|
||||
|
||||
float WindowManager::getScalingFactor()
|
||||
float WindowManager::getScalingFactor() const
|
||||
{
|
||||
return mScalingFactor;
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ namespace MWGui
|
||||
void setDragDrop(bool dragDrop) override;
|
||||
bool getWorldMouseOver() override;
|
||||
|
||||
float getScalingFactor() override;
|
||||
float getScalingFactor() const override;
|
||||
|
||||
bool toggleFogOfWar() override;
|
||||
bool toggleFullHelp() override; ///< show extra info in item tooltips (owner, script)
|
||||
|
@ -140,7 +140,7 @@ namespace MWMechanics
|
||||
return mSpells;
|
||||
}
|
||||
|
||||
void ActiveSpells::addSpell(const std::string &id, bool stack, std::vector<ActiveEffect> effects,
|
||||
void ActiveSpells::addSpell(const std::string &id, bool stack, const std::vector<ActiveEffect>& effects,
|
||||
const std::string &displayName, int casterActorId)
|
||||
{
|
||||
TContainer::iterator it(mSpells.find(id));
|
||||
|
@ -74,7 +74,7 @@ namespace MWMechanics
|
||||
/// \param effects
|
||||
/// \param displayName Name for display in magic menu.
|
||||
///
|
||||
void addSpell (const std::string& id, bool stack, std::vector<ActiveEffect> effects,
|
||||
void addSpell (const std::string& id, bool stack, const std::vector<ActiveEffect>& effects,
|
||||
const std::string& displayName, int casterActorId);
|
||||
|
||||
/// Removes the active effects from this spell/potion/.. with \a id
|
||||
|
@ -826,7 +826,7 @@ namespace MWMechanics
|
||||
|
||||
DynamicStat<float> magicka = creatureStats.getMagicka();
|
||||
float diff = (static_cast<int>(magickaFactor*intelligence)) - magicka.getBase();
|
||||
float currentToBaseRatio = (magicka.getCurrent() / magicka.getBase());
|
||||
float currentToBaseRatio = magicka.getBase() > 0 ? magicka.getCurrent() / magicka.getBase() : 0;
|
||||
magicka.setModified(magicka.getModified() + diff, 0);
|
||||
magicka.setCurrent(magicka.getBase() * currentToBaseRatio, false, true);
|
||||
creatureStats.setMagicka(magicka);
|
||||
@ -1667,7 +1667,7 @@ namespace MWMechanics
|
||||
}
|
||||
}
|
||||
|
||||
void Actors::castSpell(const MWWorld::Ptr& ptr, const std::string spellId, bool manualSpell)
|
||||
void Actors::castSpell(const MWWorld::Ptr& ptr, const std::string& spellId, bool manualSpell)
|
||||
{
|
||||
PtrActorMap::iterator iter = mActors.find(ptr);
|
||||
if(iter != mActors.end())
|
||||
@ -2396,11 +2396,17 @@ namespace MWMechanics
|
||||
float radius = std::min(fSneakUseDist, mActorsProcessingRange);
|
||||
getObjectsInRange(position, radius, observers);
|
||||
|
||||
std::set<MWWorld::Ptr> sidingActors;
|
||||
getActorsSidingWith(player, sidingActors);
|
||||
|
||||
for (const MWWorld::Ptr &observer : observers)
|
||||
{
|
||||
if (observer == player || observer.getClass().getCreatureStats(observer).isDead())
|
||||
continue;
|
||||
|
||||
if (sidingActors.find(observer) != sidingActors.cend())
|
||||
continue;
|
||||
|
||||
if (world->getLOS(player, observer))
|
||||
{
|
||||
if (MWBase::Environment::get().getMechanicsManager()->awarenessCheck(player, observer))
|
||||
|
@ -101,7 +101,7 @@ namespace MWMechanics
|
||||
|
||||
void resurrect (const MWWorld::Ptr& ptr);
|
||||
|
||||
void castSpell(const MWWorld::Ptr& ptr, const std::string spellId, bool manualSpell=false);
|
||||
void castSpell(const MWWorld::Ptr& ptr, const std::string& spellId, bool manualSpell=false);
|
||||
|
||||
void updateActor(const MWWorld::Ptr &old, const MWWorld::Ptr& ptr);
|
||||
///< Updates an actor with a new Ptr
|
||||
|
@ -55,6 +55,11 @@ MWWorld::Ptr MWMechanics::AiPackage::getTarget() const
|
||||
|
||||
if (mTargetActorId == -1)
|
||||
{
|
||||
if (mTargetActorRefId.empty())
|
||||
{
|
||||
mTargetActorId = -2;
|
||||
return MWWorld::Ptr();
|
||||
}
|
||||
MWWorld::Ptr target = MWBase::Environment::get().getWorld()->searchPtr(mTargetActorRefId, false);
|
||||
if (target.isEmpty())
|
||||
{
|
||||
|
@ -2852,7 +2852,7 @@ void CharacterController::setAttackingOrSpell(bool attackingOrSpell)
|
||||
mAttackingOrSpell = attackingOrSpell;
|
||||
}
|
||||
|
||||
void CharacterController::castSpell(const std::string spellId, bool manualSpell)
|
||||
void CharacterController::castSpell(const std::string& spellId, bool manualSpell)
|
||||
{
|
||||
mAttackingOrSpell = true;
|
||||
mCastingManualSpell = manualSpell;
|
||||
|
@ -286,7 +286,7 @@ public:
|
||||
|
||||
void setVisibility(float visibility);
|
||||
void setAttackingOrSpell(bool attackingOrSpell);
|
||||
void castSpell(const std::string spellId, bool manualSpell=false);
|
||||
void castSpell(const std::string& spellId, bool manualSpell=false);
|
||||
void setAIAttackType(const std::string& attackType);
|
||||
static void setAttackTypeRandomly(std::string& attackType);
|
||||
|
||||
|
@ -159,7 +159,7 @@ namespace MWMechanics
|
||||
float diff = (strength+willpower+agility+endurance) - fatigue.getBase();
|
||||
float currentToBaseRatio = fatigue.getBase() > 0 ? (fatigue.getCurrent() / fatigue.getBase()) : 0;
|
||||
fatigue.setModified(fatigue.getModified() + diff, 0);
|
||||
fatigue.setCurrent(fatigue.getBase() * currentToBaseRatio);
|
||||
fatigue.setCurrent(fatigue.getBase() * currentToBaseRatio, false, true);
|
||||
setFatigue(fatigue);
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace MWMechanics
|
||||
/// Call when \a actor has got in contact with \a carrier (e.g. hit by him, or loots him)
|
||||
/// @param actor The actor that will potentially catch diseases. Currently only the player can catch diseases.
|
||||
/// @param carrier The disease carrier.
|
||||
inline void diseaseContact (MWWorld::Ptr actor, MWWorld::Ptr carrier)
|
||||
inline void diseaseContact (const MWWorld::Ptr& actor, const MWWorld::Ptr& carrier)
|
||||
{
|
||||
if (!carrier.getClass().isActor() || actor != getPlayer())
|
||||
return;
|
||||
|
@ -251,7 +251,7 @@ namespace MWMechanics
|
||||
mObjects.addObject(ptr);
|
||||
}
|
||||
|
||||
void MechanicsManager::castSpell(const MWWorld::Ptr& ptr, const std::string spellId, bool manualSpell)
|
||||
void MechanicsManager::castSpell(const MWWorld::Ptr& ptr, const std::string& spellId, bool manualSpell)
|
||||
{
|
||||
if(ptr.getClass().isActor())
|
||||
mActors.castSpell(ptr, spellId, manualSpell);
|
||||
@ -402,7 +402,7 @@ namespace MWMechanics
|
||||
mActors.rest(hours, sleep);
|
||||
}
|
||||
|
||||
void MechanicsManager::restoreDynamicStats(MWWorld::Ptr actor, double hours, bool sleep)
|
||||
void MechanicsManager::restoreDynamicStats(const MWWorld::Ptr& actor, double hours, bool sleep)
|
||||
{
|
||||
mActors.restoreDynamicStats(actor, hours, sleep);
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ namespace MWMechanics
|
||||
void setPlayerClass (const ESM::Class& class_) override;
|
||||
///< Set player class to custom class.
|
||||
|
||||
void restoreDynamicStats(MWWorld::Ptr actor, double hours, bool sleep) override;
|
||||
void restoreDynamicStats(const MWWorld::Ptr& actor, double hours, bool sleep) override;
|
||||
|
||||
void rest(double hours, bool sleep) override;
|
||||
///< If the player is sleeping or waiting, this should be called every hour.
|
||||
@ -186,7 +186,7 @@ namespace MWMechanics
|
||||
/// Is \a ptr casting spell or using weapon now?
|
||||
bool isAttackingOrSpell(const MWWorld::Ptr &ptr) const override;
|
||||
|
||||
void castSpell(const MWWorld::Ptr& ptr, const std::string spellId, bool manualSpell=false) override;
|
||||
void castSpell(const MWWorld::Ptr& ptr, const std::string& spellId, bool manualSpell=false) override;
|
||||
|
||||
void processChangedSettings(const Settings::CategorySettingVector& settings) override;
|
||||
|
||||
|
@ -13,10 +13,6 @@
|
||||
namespace MWMechanics
|
||||
{
|
||||
|
||||
Objects::Objects()
|
||||
{
|
||||
}
|
||||
|
||||
Objects::~Objects()
|
||||
{
|
||||
for(auto& object : mObjects)
|
||||
|
@ -26,7 +26,7 @@ namespace MWMechanics
|
||||
PtrControllerMap mObjects;
|
||||
|
||||
public:
|
||||
Objects();
|
||||
Objects() = default;
|
||||
~Objects();
|
||||
|
||||
void addObject (const MWWorld::Ptr& ptr);
|
||||
|
@ -369,7 +369,13 @@ namespace MWMechanics
|
||||
mPath.clear();
|
||||
|
||||
// If it's not possible to build path over navmesh due to disabled navmesh generation fallback to straight path
|
||||
if (!buildPathByNavigatorImpl(actor, startPoint, endPoint, halfExtents, flags, areaCosts, std::back_inserter(mPath)))
|
||||
DetourNavigator::Status status = buildPathByNavigatorImpl(actor, startPoint, endPoint, halfExtents, flags,
|
||||
areaCosts, std::back_inserter(mPath));
|
||||
|
||||
if (status != DetourNavigator::Status::Success)
|
||||
mPath.clear();
|
||||
|
||||
if (status == DetourNavigator::Status::NavMeshNotFound)
|
||||
mPath.push_back(endPoint);
|
||||
|
||||
mConstructed = !mPath.empty();
|
||||
@ -382,25 +388,33 @@ namespace MWMechanics
|
||||
mPath.clear();
|
||||
mCell = cell;
|
||||
|
||||
bool hasNavMesh = false;
|
||||
DetourNavigator::Status status = DetourNavigator::Status::NavMeshNotFound;
|
||||
|
||||
if (!actor.getClass().isPureWaterCreature(actor) && !actor.getClass().isPureFlyingCreature(actor))
|
||||
hasNavMesh = buildPathByNavigatorImpl(actor, startPoint, endPoint, halfExtents, flags, areaCosts, std::back_inserter(mPath));
|
||||
{
|
||||
status = buildPathByNavigatorImpl(actor, startPoint, endPoint, halfExtents, flags, areaCosts, std::back_inserter(mPath));
|
||||
if (status != DetourNavigator::Status::Success)
|
||||
mPath.clear();
|
||||
}
|
||||
|
||||
if (hasNavMesh && mPath.empty())
|
||||
buildPathByNavigatorImpl(actor, startPoint, endPoint, halfExtents,
|
||||
if (status != DetourNavigator::Status::NavMeshNotFound && mPath.empty())
|
||||
{
|
||||
status = buildPathByNavigatorImpl(actor, startPoint, endPoint, halfExtents,
|
||||
flags | DetourNavigator::Flag_usePathgrid, areaCosts, std::back_inserter(mPath));
|
||||
if (status != DetourNavigator::Status::Success)
|
||||
mPath.clear();
|
||||
}
|
||||
|
||||
if (mPath.empty())
|
||||
buildPathByPathgridImpl(startPoint, endPoint, pathgridGraph, std::back_inserter(mPath));
|
||||
|
||||
if (!hasNavMesh && mPath.empty())
|
||||
if (status == DetourNavigator::Status::NavMeshNotFound && mPath.empty())
|
||||
mPath.push_back(endPoint);
|
||||
|
||||
mConstructed = !mPath.empty();
|
||||
}
|
||||
|
||||
bool PathFinder::buildPathByNavigatorImpl(const MWWorld::ConstPtr& actor, const osg::Vec3f& startPoint,
|
||||
DetourNavigator::Status PathFinder::buildPathByNavigatorImpl(const MWWorld::ConstPtr& actor, const osg::Vec3f& startPoint,
|
||||
const osg::Vec3f& endPoint, const osg::Vec3f& halfExtents, const DetourNavigator::Flags flags,
|
||||
const DetourNavigator::AreaCosts& areaCosts, std::back_insert_iterator<std::deque<osg::Vec3f>> out)
|
||||
{
|
||||
@ -409,9 +423,6 @@ namespace MWMechanics
|
||||
const auto navigator = world->getNavigator();
|
||||
const auto status = navigator->findPath(halfExtents, stepSize, startPoint, endPoint, flags, areaCosts, out);
|
||||
|
||||
if (status == DetourNavigator::Status::NavMeshNotFound)
|
||||
return false;
|
||||
|
||||
if (status != DetourNavigator::Status::Success)
|
||||
{
|
||||
Log(Debug::Debug) << "Build path by navigator error: \"" << DetourNavigator::getMessage(status)
|
||||
@ -420,7 +431,7 @@ namespace MWMechanics
|
||||
<< DetourNavigator::WriteFlags {flags} << ")";
|
||||
}
|
||||
|
||||
return true;
|
||||
return status;
|
||||
}
|
||||
|
||||
void PathFinder::buildPathByNavMeshToNextPoint(const MWWorld::ConstPtr& actor, const osg::Vec3f& halfExtents,
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <components/detournavigator/flags.hpp>
|
||||
#include <components/detournavigator/areatype.hpp>
|
||||
#include <components/detournavigator/status.hpp>
|
||||
#include <components/esm/defs.hpp>
|
||||
#include <components/esm/loadpgrd.hpp>
|
||||
|
||||
@ -167,7 +168,7 @@ namespace MWMechanics
|
||||
// Caller needs to be careful for very short distances (i.e. less than 1)
|
||||
// or when accumuating the results i.e. (a + b)^2 != a^2 + b^2
|
||||
//
|
||||
static float distanceSquared(ESM::Pathgrid::Point point, const osg::Vec3f& pos)
|
||||
static float distanceSquared(const ESM::Pathgrid::Point& point, const osg::Vec3f& pos)
|
||||
{
|
||||
return (MWMechanics::PathFinder::makeOsgVec3(point) - pos).length2();
|
||||
}
|
||||
@ -209,9 +210,10 @@ namespace MWMechanics
|
||||
void buildPathByPathgridImpl(const osg::Vec3f& startPoint, const osg::Vec3f& endPoint,
|
||||
const PathgridGraph& pathgridGraph, std::back_insert_iterator<std::deque<osg::Vec3f>> out);
|
||||
|
||||
bool buildPathByNavigatorImpl(const MWWorld::ConstPtr& actor, const osg::Vec3f& startPoint,
|
||||
const osg::Vec3f& endPoint, const osg::Vec3f& halfExtents, const DetourNavigator::Flags flags,
|
||||
const DetourNavigator::AreaCosts& areaCosts, std::back_insert_iterator<std::deque<osg::Vec3f>> out);
|
||||
[[nodiscard]] DetourNavigator::Status buildPathByNavigatorImpl(const MWWorld::ConstPtr& actor,
|
||||
const osg::Vec3f& startPoint, const osg::Vec3f& endPoint, const osg::Vec3f& halfExtents,
|
||||
const DetourNavigator::Flags flags, const DetourNavigator::AreaCosts& areaCosts,
|
||||
std::back_insert_iterator<std::deque<osg::Vec3f>> out);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ namespace MWMechanics
|
||||
}
|
||||
}
|
||||
|
||||
bool Pickpocket::pick(MWWorld::Ptr item, int count)
|
||||
bool Pickpocket::pick(const MWWorld::Ptr& item, int count)
|
||||
{
|
||||
float stackValue = static_cast<float>(item.getClass().getValue(item) * count);
|
||||
float fPickPocketMod = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
|
||||
|
@ -13,7 +13,7 @@ namespace MWMechanics
|
||||
|
||||
/// Steal some items
|
||||
/// @return Was the thief detected?
|
||||
bool pick (MWWorld::Ptr item, int count);
|
||||
bool pick (const MWWorld::Ptr& item, int count);
|
||||
/// End the pickpocketing process
|
||||
/// @return Was the thief detected?
|
||||
bool finish ();
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
namespace MWMechanics
|
||||
{
|
||||
MWWorld::ContainerStoreIterator getActiveWeapon(MWWorld::Ptr actor, int *weaptype)
|
||||
MWWorld::ContainerStoreIterator getActiveWeapon(const MWWorld::Ptr& actor, int *weaptype)
|
||||
{
|
||||
MWWorld::InventoryStore &inv = actor.getClass().getInventoryStore(actor);
|
||||
CreatureStats &stats = actor.getClass().getCreatureStats(actor);
|
||||
|
@ -261,7 +261,7 @@ namespace MWMechanics
|
||||
}
|
||||
};
|
||||
|
||||
MWWorld::ContainerStoreIterator getActiveWeapon(MWWorld::Ptr actor, int *weaptype);
|
||||
MWWorld::ContainerStoreIterator getActiveWeapon(const MWWorld::Ptr& actor, int *weaptype);
|
||||
|
||||
const ESM::WeaponType* getWeaponType(const int weaponType);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ Actor::Actor(const MWWorld::Ptr& ptr, const Resource::BulletShape* shape, Physic
|
||||
updateScale();
|
||||
|
||||
if(!mRotationallyInvariant)
|
||||
updateRotation();
|
||||
setRotation(mPtr.getRefData().getBaseNode()->getAttitude());
|
||||
|
||||
updatePosition();
|
||||
addCollisionMask(getCollisionMask());
|
||||
@ -197,10 +197,10 @@ osg::Vec3f Actor::getPreviousPosition() const
|
||||
return mPreviousPosition;
|
||||
}
|
||||
|
||||
void Actor::updateRotation ()
|
||||
void Actor::setRotation(osg::Quat quat)
|
||||
{
|
||||
std::scoped_lock lock(mPositionMutex);
|
||||
mRotation = mPtr.getRefData().getBaseNode()->getAttitude();
|
||||
mRotation = quat;
|
||||
}
|
||||
|
||||
bool Actor::isRotationallyInvariant() const
|
||||
|
@ -48,7 +48,7 @@ namespace MWPhysics
|
||||
void enableCollisionBody(bool collision);
|
||||
|
||||
void updateScale();
|
||||
void updateRotation();
|
||||
void setRotation(osg::Quat quat);
|
||||
|
||||
/**
|
||||
* Return true if the collision shape looks the same no matter how its Z rotated.
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
namespace MWPhysics
|
||||
{
|
||||
Object::Object(const MWWorld::Ptr& ptr, osg::ref_ptr<Resource::BulletShapeInstance> shapeInstance, int collisionType, PhysicsTaskScheduler* scheduler)
|
||||
Object::Object(const MWWorld::Ptr& ptr, osg::ref_ptr<Resource::BulletShapeInstance> shapeInstance, osg::Quat rotation, int collisionType, PhysicsTaskScheduler* scheduler)
|
||||
: mShapeInstance(shapeInstance)
|
||||
, mSolid(true)
|
||||
, mTaskScheduler(scheduler)
|
||||
@ -27,7 +27,7 @@ namespace MWPhysics
|
||||
mCollisionObject->setUserPointer(this);
|
||||
|
||||
setScale(ptr.getCellRef().getScale());
|
||||
setRotation(Misc::Convert::toBullet(ptr.getRefData().getBaseNode()->getAttitude()));
|
||||
setRotation(rotation);
|
||||
setOrigin(Misc::Convert::toBullet(ptr.getRefData().getPosition().asVec3()));
|
||||
commitPositionChange();
|
||||
|
||||
@ -51,10 +51,10 @@ namespace MWPhysics
|
||||
mScaleUpdatePending = true;
|
||||
}
|
||||
|
||||
void Object::setRotation(const btQuaternion& quat)
|
||||
void Object::setRotation(osg::Quat quat)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(mPositionMutex);
|
||||
mLocalTransform.setRotation(quat);
|
||||
mLocalTransform.setRotation(Misc::Convert::toBullet(quat));
|
||||
mTransformUpdatePending = true;
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ namespace MWPhysics
|
||||
|
||||
bool Object::isAnimated() const
|
||||
{
|
||||
return !mShapeInstance->mAnimatedShapes.empty();
|
||||
return mShapeInstance->isAnimated();
|
||||
}
|
||||
|
||||
bool Object::animateCollisionShapes()
|
||||
|
@ -26,12 +26,12 @@ namespace MWPhysics
|
||||
class Object final : public PtrHolder
|
||||
{
|
||||
public:
|
||||
Object(const MWWorld::Ptr& ptr, osg::ref_ptr<Resource::BulletShapeInstance> shapeInstance, int collisionType, PhysicsTaskScheduler* scheduler);
|
||||
Object(const MWWorld::Ptr& ptr, osg::ref_ptr<Resource::BulletShapeInstance> shapeInstance, osg::Quat rotation, int collisionType, PhysicsTaskScheduler* scheduler);
|
||||
~Object() override;
|
||||
|
||||
const Resource::BulletShapeInstance* getShapeInstance() const;
|
||||
void setScale(float scale);
|
||||
void setRotation(const btQuaternion& quat);
|
||||
void setRotation(osg::Quat quat);
|
||||
void setOrigin(const btVector3& vec);
|
||||
void commitPositionChange();
|
||||
btCollisionObject* getCollisionObject();
|
||||
|
@ -261,7 +261,7 @@ namespace MWPhysics
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
RayCastingResult PhysicsSystem::castRay(const osg::Vec3f &from, const osg::Vec3f &to, const MWWorld::ConstPtr& ignore, std::vector<MWWorld::Ptr> targets, int mask, int group) const
|
||||
RayCastingResult PhysicsSystem::castRay(const osg::Vec3f &from, const osg::Vec3f &to, const MWWorld::ConstPtr& ignore, const std::vector<MWWorld::Ptr>& targets, int mask, int group) const
|
||||
{
|
||||
if (from == to)
|
||||
{
|
||||
@ -290,7 +290,7 @@ namespace MWPhysics
|
||||
|
||||
if (!targets.empty())
|
||||
{
|
||||
for (MWWorld::Ptr& target : targets)
|
||||
for (const MWWorld::Ptr& target : targets)
|
||||
{
|
||||
const Actor* actor = getActor(target);
|
||||
if (actor)
|
||||
@ -461,13 +461,18 @@ namespace MWPhysics
|
||||
return heightField->second.get();
|
||||
}
|
||||
|
||||
void PhysicsSystem::addObject (const MWWorld::Ptr& ptr, const std::string& mesh, int collisionType)
|
||||
void PhysicsSystem::addObject (const MWWorld::Ptr& ptr, const std::string& mesh, osg::Quat rotation, int collisionType, bool skipAnimated)
|
||||
{
|
||||
osg::ref_ptr<Resource::BulletShapeInstance> shapeInstance = mShapeManager->getInstance(mesh);
|
||||
if (!shapeInstance || !shapeInstance->getCollisionShape())
|
||||
return;
|
||||
|
||||
auto obj = std::make_shared<Object>(ptr, shapeInstance, collisionType, mTaskScheduler.get());
|
||||
if (skipAnimated && shapeInstance->isAnimated())
|
||||
return;
|
||||
|
||||
assert(!getObject(ptr));
|
||||
|
||||
auto obj = std::make_shared<Object>(ptr, shapeInstance, rotation, collisionType, mTaskScheduler.get());
|
||||
mObjects.emplace(ptr, obj);
|
||||
|
||||
if (obj->isAnimated())
|
||||
@ -625,12 +630,12 @@ namespace MWPhysics
|
||||
mTaskScheduler->updateSingleAabb(foundProjectile->second);
|
||||
}
|
||||
|
||||
void PhysicsSystem::updateRotation(const MWWorld::Ptr &ptr)
|
||||
void PhysicsSystem::updateRotation(const MWWorld::Ptr &ptr, osg::Quat rotate)
|
||||
{
|
||||
ObjectMap::iterator found = mObjects.find(ptr);
|
||||
if (found != mObjects.end())
|
||||
{
|
||||
found->second->setRotation(Misc::Convert::toBullet(ptr.getRefData().getBaseNode()->getAttitude()));
|
||||
found->second->setRotation(rotate);
|
||||
mTaskScheduler->updateSingleAabb(found->second);
|
||||
return;
|
||||
}
|
||||
@ -639,7 +644,7 @@ namespace MWPhysics
|
||||
{
|
||||
if (!foundActor->second->isRotationallyInvariant())
|
||||
{
|
||||
foundActor->second->updateRotation();
|
||||
foundActor->second->setRotation(rotate);
|
||||
mTaskScheduler->updateSingleAabb(foundActor->second);
|
||||
}
|
||||
return;
|
||||
|
@ -122,7 +122,7 @@ namespace MWPhysics
|
||||
void setWaterHeight(float height);
|
||||
void disableWater();
|
||||
|
||||
void addObject (const MWWorld::Ptr& ptr, const std::string& mesh, int collisionType = CollisionType_World);
|
||||
void addObject (const MWWorld::Ptr& ptr, const std::string& mesh, osg::Quat rotation, int collisionType = CollisionType_World, bool skipAnimated = false);
|
||||
void addActor (const MWWorld::Ptr& ptr, const std::string& mesh);
|
||||
|
||||
int addProjectile(const MWWorld::Ptr& caster, const osg::Vec3f& position, const std::string& mesh, bool computeRadius, bool canTraverseWater);
|
||||
@ -143,7 +143,7 @@ namespace MWPhysics
|
||||
void remove (const MWWorld::Ptr& ptr);
|
||||
|
||||
void updateScale (const MWWorld::Ptr& ptr);
|
||||
void updateRotation (const MWWorld::Ptr& ptr);
|
||||
void updateRotation (const MWWorld::Ptr& ptr, osg::Quat rotate);
|
||||
void updatePosition (const MWWorld::Ptr& ptr);
|
||||
|
||||
void addHeightField (const float* heights, int x, int y, float triSize, float sqrtVerts, float minH, float maxH, const osg::Object* holdObject);
|
||||
@ -175,7 +175,7 @@ namespace MWPhysics
|
||||
|
||||
/// @param me Optional, a Ptr to ignore in the list of results. targets are actors to filter for, ignoring all other actors.
|
||||
RayCastingResult castRay(const osg::Vec3f &from, const osg::Vec3f &to, const MWWorld::ConstPtr& ignore = MWWorld::ConstPtr(),
|
||||
std::vector<MWWorld::Ptr> targets = std::vector<MWWorld::Ptr>(),
|
||||
const std::vector<MWWorld::Ptr>& targets = std::vector<MWWorld::Ptr>(),
|
||||
int mask = CollisionType_World|CollisionType_HeightMap|CollisionType_Actor|CollisionType_Door, int group=0xff) const override;
|
||||
|
||||
RayCastingResult castSphere(const osg::Vec3f& from, const osg::Vec3f& to, float radius) const override;
|
||||
|
@ -78,7 +78,7 @@ bool Projectile::canTraverseWater() const
|
||||
return mCanCrossWaterSurface;
|
||||
}
|
||||
|
||||
void Projectile::hit(MWWorld::Ptr target, btVector3 pos, btVector3 normal)
|
||||
void Projectile::hit(const MWWorld::Ptr& target, btVector3 pos, btVector3 normal)
|
||||
{
|
||||
if (!mActive.load(std::memory_order_acquire))
|
||||
return;
|
||||
@ -95,7 +95,7 @@ MWWorld::Ptr Projectile::getCaster() const
|
||||
return mCaster;
|
||||
}
|
||||
|
||||
void Projectile::setCaster(MWWorld::Ptr caster)
|
||||
void Projectile::setCaster(const MWWorld::Ptr& caster)
|
||||
{
|
||||
std::scoped_lock lock(mMutex);
|
||||
mCaster = caster;
|
||||
|
@ -58,11 +58,11 @@ namespace MWPhysics
|
||||
}
|
||||
|
||||
MWWorld::Ptr getCaster() const;
|
||||
void setCaster(MWWorld::Ptr caster);
|
||||
void setCaster(const MWWorld::Ptr& caster);
|
||||
|
||||
bool canTraverseWater() const;
|
||||
|
||||
void hit(MWWorld::Ptr target, btVector3 pos, btVector3 normal);
|
||||
void hit(const MWWorld::Ptr& target, btVector3 pos, btVector3 normal);
|
||||
|
||||
void setValidTargets(const std::vector<MWWorld::Ptr>& targets);
|
||||
bool isValidTarget(const MWWorld::Ptr& target) const;
|
||||
|
@ -28,7 +28,7 @@ namespace MWPhysics
|
||||
|
||||
/// @param me Optional, a Ptr to ignore in the list of results. targets are actors to filter for, ignoring all other actors.
|
||||
virtual RayCastingResult castRay(const osg::Vec3f &from, const osg::Vec3f &to, const MWWorld::ConstPtr& ignore = MWWorld::ConstPtr(),
|
||||
std::vector<MWWorld::Ptr> targets = std::vector<MWWorld::Ptr>(),
|
||||
const std::vector<MWWorld::Ptr>& targets = std::vector<MWWorld::Ptr>(),
|
||||
int mask = CollisionType_World|CollisionType_HeightMap|CollisionType_Actor|CollisionType_Door, int group=0xff) const = 0;
|
||||
|
||||
virtual RayCastingResult castSphere(const osg::Vec3f& from, const osg::Vec3f& to, float radius) const = 0;
|
||||
|
@ -1973,11 +1973,6 @@ namespace MWRender
|
||||
return SceneUtil::hasUserDescription(mObjectRoot, Constants::HerbalismLabel);
|
||||
}
|
||||
|
||||
Animation::AnimState::~AnimState()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------
|
||||
|
||||
PartHolder::PartHolder(osg::ref_ptr<osg::Node> node)
|
||||
|
@ -207,7 +207,7 @@ protected:
|
||||
mLoopCount(0), mPriority(0), mBlendMask(0), mAutoDisable(true)
|
||||
{
|
||||
}
|
||||
~AnimState();
|
||||
~AnimState() = default;
|
||||
|
||||
float getTime() const
|
||||
{
|
||||
|
@ -48,12 +48,9 @@ namespace MWRender
|
||||
float mScale;
|
||||
std::string mModel;
|
||||
|
||||
GroundcoverEntry(const ESM::CellRef& ref, const std::string& model)
|
||||
{
|
||||
mPos = ref.mPos;
|
||||
mScale = ref.mScale;
|
||||
mModel = model;
|
||||
}
|
||||
GroundcoverEntry(const ESM::CellRef& ref, const std::string& model):
|
||||
mPos(ref.mPos), mScale(ref.mScale), mModel(model)
|
||||
{}
|
||||
};
|
||||
|
||||
private:
|
||||
|
@ -673,11 +673,6 @@ LocalMap::MapSegment::MapSegment()
|
||||
{
|
||||
}
|
||||
|
||||
LocalMap::MapSegment::~MapSegment()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void LocalMap::MapSegment::createFogOfWarTexture()
|
||||
{
|
||||
if (mFogOfWarTexture)
|
||||
|
@ -115,7 +115,7 @@ namespace MWRender
|
||||
struct MapSegment
|
||||
{
|
||||
MapSegment();
|
||||
~MapSegment();
|
||||
~MapSegment() = default;
|
||||
|
||||
void initFogOfWar();
|
||||
void loadFogOfWar(const ESM::FogTexture& fog);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user