1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 21:32:42 +00:00

60 lines
1.5 KiB
C++
Raw Normal View History

#ifndef GAME_MWMECHANICS_ACTIVATORS_H
2013-04-01 17:30:54 +02:00
#define GAME_MWMECHANICS_ACTIVATORS_H
#include "character.hpp"
2022-09-22 21:26:05 +03:00
#include <list>
#include <map>
2022-09-22 21:26:05 +03:00
#include <string>
2019-02-19 01:10:55 +03:00
#include <vector>
2019-02-19 01:10:55 +03:00
namespace osg
{
class Vec3f;
}
namespace MWWorld
{
class Ptr;
class CellStore;
}
namespace MWMechanics
{
class Objects
{
std::list<CharacterController> mObjects;
std::map<const MWWorld::LiveCellRefBase*, std::list<CharacterController>::iterator> mIndex;
public:
2022-09-22 21:26:05 +03:00
void addObject(const MWWorld::Ptr& ptr);
///< Register an animated object
2022-09-22 21:26:05 +03:00
void removeObject(const MWWorld::Ptr& ptr);
///< Deregister an object
2022-09-22 21:26:05 +03:00
void updateObject(const MWWorld::Ptr& old, const MWWorld::Ptr& ptr);
///< Updates an object with a new Ptr
2022-09-22 21:26:05 +03:00
void dropObjects(const MWWorld::CellStore* cellStore);
///< Deregister all objects in the given cell.
void update(float duration, bool paused);
///< Update object animations
bool onOpen(const MWWorld::Ptr& ptr);
void onClose(const MWWorld::Ptr& ptr);
2022-09-22 21:26:05 +03:00
bool playAnimationGroup(
const MWWorld::Ptr& ptr, std::string_view groupName, int mode, int number, bool persist = false);
void skipAnimation(const MWWorld::Ptr& ptr);
void persistAnimationStates();
2014-01-20 13:00:43 +01:00
void getObjectsInRange(const osg::Vec3f& position, float radius, std::vector<MWWorld::Ptr>& out) const;
2022-09-22 21:26:05 +03:00
std::size_t size() const { return mObjects.size(); }
};
}
#endif