mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 00:36:46 +00:00
Merge pull request #2698 from Capostrophic/wander
Support movement deceleration for wander AI
This commit is contained in:
commit
10fafabd7f
5 changed files with 14 additions and 4 deletions
|
@ -44,7 +44,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
void fastForward(const MWWorld::Ptr& actor, AiState& state);
|
void fastForward(const MWWorld::Ptr& actor, AiState& state);
|
||||||
|
|
||||||
virtual osg::Vec3f getDestination() { return osg::Vec3f(mX, mY, mZ); }
|
virtual osg::Vec3f getDestination() const { return osg::Vec3f(mX, mY, mZ); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string mCellId;
|
std::string mCellId;
|
||||||
|
|
|
@ -76,7 +76,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
void fastForward(const MWWorld::Ptr& actor, AiState& state);
|
void fastForward(const MWWorld::Ptr& actor, AiState& state);
|
||||||
|
|
||||||
virtual osg::Vec3f getDestination()
|
virtual osg::Vec3f getDestination() const
|
||||||
{
|
{
|
||||||
MWWorld::Ptr target = getTarget();
|
MWWorld::Ptr target = getTarget();
|
||||||
if (target.isEmpty())
|
if (target.isEmpty())
|
||||||
|
|
|
@ -102,7 +102,7 @@ namespace MWMechanics
|
||||||
/// Return true if this package should repeat. Currently only used for Wander packages.
|
/// Return true if this package should repeat. Currently only used for Wander packages.
|
||||||
virtual bool getRepeat() const;
|
virtual bool getRepeat() const;
|
||||||
|
|
||||||
virtual osg::Vec3f getDestination() { return osg::Vec3f(0, 0, 0); }
|
virtual osg::Vec3f getDestination() const { return osg::Vec3f(0, 0, 0); }
|
||||||
|
|
||||||
// Return true if any loaded actor with this AI package must be active.
|
// Return true if any loaded actor with this AI package must be active.
|
||||||
virtual bool alwaysActive() const { return false; }
|
virtual bool alwaysActive() const { return false; }
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
virtual bool alwaysActive() const { return true; }
|
virtual bool alwaysActive() const { return true; }
|
||||||
|
|
||||||
virtual osg::Vec3f getDestination() { return osg::Vec3f(mX, mY, mZ); }
|
virtual osg::Vec3f getDestination() const { return osg::Vec3f(mX, mY, mZ); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float mX;
|
float mX;
|
||||||
|
|
|
@ -97,6 +97,8 @@ namespace MWMechanics
|
||||||
|
|
||||||
virtual int getTypeId() const;
|
virtual int getTypeId() const;
|
||||||
|
|
||||||
|
virtual bool useVariableSpeed() const { return true;}
|
||||||
|
|
||||||
virtual void writeState(ESM::AiSequence::AiSequence &sequence) const;
|
virtual void writeState(ESM::AiSequence::AiSequence &sequence) const;
|
||||||
|
|
||||||
virtual void fastForward(const MWWorld::Ptr& actor, AiState& state);
|
virtual void fastForward(const MWWorld::Ptr& actor, AiState& state);
|
||||||
|
@ -105,6 +107,14 @@ namespace MWMechanics
|
||||||
|
|
||||||
osg::Vec3f getDestination(const MWWorld::Ptr& actor) const;
|
osg::Vec3f getDestination(const MWWorld::Ptr& actor) const;
|
||||||
|
|
||||||
|
virtual osg::Vec3f getDestination() const
|
||||||
|
{
|
||||||
|
if (!mHasDestination)
|
||||||
|
return osg::Vec3f(0, 0, 0);
|
||||||
|
|
||||||
|
return mDestination;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// NOTE: mDistance and mDuration must be set already
|
// NOTE: mDistance and mDuration must be set already
|
||||||
void init();
|
void init();
|
||||||
|
|
Loading…
Reference in a new issue