1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-04 12:39:55 +00:00
OpenMW/apps/openmw/mwmechanics/aitravel.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
1.9 KiB
C++
Raw Normal View History

2012-11-15 22:15:20 +01:00
#ifndef GAME_MWMECHANICS_AITRAVEL_H
#define GAME_MWMECHANICS_AITRAVEL_H
#include "typedaipackage.hpp"
2014-06-12 23:27:04 +02:00
namespace ESM
{
namespace AiSequence
{
struct AiTravel;
}
}
2013-03-26 18:01:01 +01:00
namespace MWMechanics
2014-06-12 23:27:04 +02:00
{
struct AiInternalTravel;
/// \brief Causes the AI to travel to the specified point
class AiTravel : public TypedAiPackage<AiTravel>
2013-03-26 18:01:01 +01:00
{
2014-06-12 23:27:04 +02:00
public:
AiTravel(float x, float y, float z, bool repeat, AiTravel* derived);
AiTravel(float x, float y, float z, AiInternalTravel* derived);
AiTravel(float x, float y, float z, bool repeat);
explicit AiTravel(const ESM::AiSequence::AiTravel* travel);
/// Simulates the passing of time
void fastForward(const MWWorld::Ptr& actor, AiState& state) override;
void writeState(ESM::AiSequence::AiSequence& sequence) const override;
bool execute(const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state,
float duration) override;
static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Travel; }
static constexpr Options makeDefaultOptions()
{
AiPackage::Options options;
options.mUseVariableSpeed = true;
options.mAlwaysActive = true;
return options;
}
osg::Vec3f getDestination() const override { return osg::Vec3f(mX, mY, mZ); }
2013-03-26 18:01:01 +01:00
private:
const float mX;
const float mY;
const float mZ;
const bool mHidden;
float mDestinationTimer;
2013-03-26 18:01:01 +01:00
};
struct AiInternalTravel final : public AiTravel
{
AiInternalTravel(float x, float y, float z);
explicit AiInternalTravel(const ESM::AiSequence::AiTravel* travel);
static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::InternalTravel; }
std::unique_ptr<AiPackage> clone() const override;
};
2012-11-14 18:42:04 +01:00
}
2012-11-15 22:15:20 +01:00
#endif