mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-29 05:17:58 +03:00
Skip simulation result after calling Actor::updatePosition(). Otherwise
when going out of tcl the player would go back to previous position for one frame.
This commit is contained in:
parent
83af0402b8
commit
6ad2cf8e4f
2 changed files with 4 additions and 1 deletions
|
@ -124,11 +124,13 @@ void Actor::updatePosition()
|
||||||
mPositionOffset = osg::Vec3f();
|
mPositionOffset = osg::Vec3f();
|
||||||
mStandingOnPtr = nullptr;
|
mStandingOnPtr = nullptr;
|
||||||
mSkipCollisions = true;
|
mSkipCollisions = true;
|
||||||
|
mSkipSimulation = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Actor::setSimulationPosition(const osg::Vec3f& position)
|
void Actor::setSimulationPosition(const osg::Vec3f& position)
|
||||||
{
|
{
|
||||||
mSimulationPosition = position;
|
if (!std::exchange(mSkipSimulation, false))
|
||||||
|
mSimulationPosition = position;
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::Vec3f Actor::getSimulationPosition() const
|
osg::Vec3f Actor::getSimulationPosition() const
|
||||||
|
|
|
@ -204,6 +204,7 @@ namespace MWPhysics
|
||||||
osg::Vec3f mVelocity;
|
osg::Vec3f mVelocity;
|
||||||
bool mWorldPositionChanged;
|
bool mWorldPositionChanged;
|
||||||
bool mSkipCollisions;
|
bool mSkipCollisions;
|
||||||
|
bool mSkipSimulation;
|
||||||
btTransform mLocalTransform;
|
btTransform mLocalTransform;
|
||||||
mutable std::mutex mPositionMutex;
|
mutable std::mutex mPositionMutex;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue