2012-11-15 21:15:20 +00:00
|
|
|
#ifndef GAME_MWMECHANICS_AITRAVEL_H
|
|
|
|
#define GAME_MWMECHANICS_AITRAVEL_H
|
2013-03-26 17:01:01 +00:00
|
|
|
|
2020-05-17 20:10:36 +00:00
|
|
|
#include "typedaipackage.hpp"
|
2013-05-25 01:16:35 +00:00
|
|
|
|
2014-06-12 21:27:04 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
namespace AiSequence
|
|
|
|
{
|
|
|
|
struct AiTravel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-26 17:01:01 +00:00
|
|
|
namespace MWMechanics
|
2014-06-12 21:27:04 +00:00
|
|
|
{
|
2014-04-30 03:40:59 +00:00
|
|
|
/// \brief Causes the AI to travel to the specified point
|
2020-05-17 20:10:36 +00:00
|
|
|
class AiTravel final : public TypedAiPackage<AiTravel>
|
2013-03-26 17:01:01 +00:00
|
|
|
{
|
2014-06-12 21:27:04 +00:00
|
|
|
public:
|
2014-04-30 03:40:59 +00:00
|
|
|
/// Default constructor
|
2017-12-01 15:58:42 +00:00
|
|
|
AiTravel(float x, float y, float z, bool hidden = false);
|
2014-06-12 21:27:04 +00:00
|
|
|
AiTravel(const ESM::AiSequence::AiTravel* travel);
|
|
|
|
|
2014-12-31 17:41:57 +00:00
|
|
|
/// Simulates the passing of time
|
2020-05-16 16:56:02 +00:00
|
|
|
void fastForward(const MWWorld::Ptr& actor, AiState& state) final;
|
2014-12-31 17:41:57 +00:00
|
|
|
|
2020-05-16 16:56:02 +00:00
|
|
|
void writeState(ESM::AiSequence::AiSequence &sequence) const final;
|
2014-06-12 21:27:04 +00:00
|
|
|
|
2020-05-16 16:56:02 +00:00
|
|
|
bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final;
|
2013-03-26 17:01:01 +00:00
|
|
|
|
2020-05-16 16:56:02 +00:00
|
|
|
int getTypeId() const final;
|
2013-03-26 17:01:01 +00:00
|
|
|
|
2020-05-16 16:56:02 +00:00
|
|
|
bool useVariableSpeed() const final { return true; }
|
2019-10-31 05:44:40 +00:00
|
|
|
|
2020-05-16 16:56:02 +00:00
|
|
|
bool alwaysActive() const final { return true; }
|
2020-01-09 11:11:53 +00:00
|
|
|
|
2020-05-16 16:56:02 +00:00
|
|
|
osg::Vec3f getDestination() const final { return osg::Vec3f(mX, mY, mZ); }
|
2019-10-31 05:44:40 +00:00
|
|
|
|
2013-03-26 17:01:01 +00:00
|
|
|
private:
|
|
|
|
float mX;
|
|
|
|
float mY;
|
|
|
|
float mZ;
|
2017-12-01 15:58:42 +00:00
|
|
|
|
|
|
|
bool mHidden;
|
2013-03-26 17:01:01 +00:00
|
|
|
};
|
2012-11-14 17:42:04 +00:00
|
|
|
}
|
|
|
|
|
2012-11-15 21:15:20 +00:00
|
|
|
#endif
|