mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
Support Wander movement deceleration
This commit is contained in:
parent
54e7e0c718
commit
013953ec7f
5 changed files with 14 additions and 4 deletions
|
@ -44,7 +44,7 @@ namespace MWMechanics
|
|||
|
||||
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:
|
||||
std::string mCellId;
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace MWMechanics
|
|||
|
||||
void fastForward(const MWWorld::Ptr& actor, AiState& state);
|
||||
|
||||
virtual osg::Vec3f getDestination()
|
||||
virtual osg::Vec3f getDestination() const
|
||||
{
|
||||
MWWorld::Ptr target = getTarget();
|
||||
if (target.isEmpty())
|
||||
|
|
|
@ -102,7 +102,7 @@ namespace MWMechanics
|
|||
/// Return true if this package should repeat. Currently only used for Wander packages.
|
||||
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.
|
||||
virtual bool alwaysActive() const { return false; }
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace MWMechanics
|
|||
|
||||
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:
|
||||
float mX;
|
||||
|
|
|
@ -97,6 +97,8 @@ namespace MWMechanics
|
|||
|
||||
virtual int getTypeId() const;
|
||||
|
||||
virtual bool useVariableSpeed() const { return true;}
|
||||
|
||||
virtual void writeState(ESM::AiSequence::AiSequence &sequence) const;
|
||||
|
||||
virtual void fastForward(const MWWorld::Ptr& actor, AiState& state);
|
||||
|
@ -105,6 +107,14 @@ namespace MWMechanics
|
|||
|
||||
osg::Vec3f getDestination(const MWWorld::Ptr& actor) const;
|
||||
|
||||
virtual osg::Vec3f getDestination() const
|
||||
{
|
||||
if (!mHasDestination)
|
||||
return osg::Vec3f(0, 0, 0);
|
||||
|
||||
return mDestination;
|
||||
}
|
||||
|
||||
private:
|
||||
// NOTE: mDistance and mDuration must be set already
|
||||
void init();
|
||||
|
|
Loading…
Reference in a new issue