1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-10 03:39:55 +00:00
fredzio c795e0bce6 Some actors are supposed to spawn on an object that belongs to an adjacent cell.
Since actors can be active in 3x3 grid around the player, we need to
first load all objects in a 5x5 grid around the player.

Split load and unloading in 2 phases. Add an mInactiveCells set into the
scene, which contains all cells inside the aforementioned 5x5 grid.
These cells contains only heightfields and non-animated physics objects.

Animated objects are tied to the scene graph, which doesn't exists yet
in these cells, so we skip them.
2021-06-28 09:36:04 +02:00

55 lines
1.7 KiB
C++

#ifndef GAME_MWCLASS_MOBILE_H
#define GAME_MWCLASS_MOBILE_H
#include "../mwworld/class.hpp"
namespace ESM
{
struct GameSetting;
}
namespace MWClass
{
/// \brief Class holding functionality common to Creature and NPC
class Actor : public MWWorld::Class
{
protected:
Actor() = default;
public:
~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, osg::Quat rotation, MWPhysics::PhysicsSystem& physics, bool skipAnimated = false) const override;
bool useAnim() const override;
void block(const MWWorld::Ptr &ptr) const override;
osg::Vec3f getRotationVector(const MWWorld::Ptr& ptr) const override;
///< Return desired rotations, as euler angles. Sets getMovementSettings(ptr).mRotation to zero.
float getEncumbrance(const MWWorld::Ptr& ptr) const override;
///< Returns total weight of objects inside this object (including modifications from magic
/// effects). Throws an exception, if the object can't hold other objects.
bool allowTelekinesis(const MWWorld::ConstPtr& ptr) const override;
///< Return whether this class of object can be activated with telekinesis
bool isActor() const override;
/// Return current movement speed.
float getCurrentSpeed(const MWWorld::Ptr& ptr) const override;
// not implemented
Actor(const Actor&) = delete;
Actor& operator= (const Actor&) = delete;
};
}
#endif