mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 20:53:52 +00:00
Merge branch 'racy_deadcode' into 'master'
Remove both racy and useless code. See merge request OpenMW/openmw!896
This commit is contained in:
commit
f27d7c66ff
3 changed files with 4 additions and 26 deletions
|
@ -117,27 +117,15 @@ int Actor::getCollisionMask() const
|
|||
void Actor::updatePosition()
|
||||
{
|
||||
std::scoped_lock lock(mPositionMutex);
|
||||
updateWorldPosition();
|
||||
mPreviousPosition = mWorldPosition;
|
||||
mPosition = mWorldPosition;
|
||||
mSimulationPosition = mWorldPosition;
|
||||
const auto worldPosition = mPtr.getRefData().getPosition().asVec3();
|
||||
mPreviousPosition = worldPosition;
|
||||
mPosition = worldPosition;
|
||||
mSimulationPosition = worldPosition;
|
||||
mPositionOffset = osg::Vec3f();
|
||||
mStandingOnPtr = nullptr;
|
||||
mSkipCollisions = true;
|
||||
}
|
||||
|
||||
void Actor::updateWorldPosition()
|
||||
{
|
||||
if (mWorldPosition != mPtr.getRefData().getPosition().asVec3())
|
||||
mWorldPositionChanged = true;
|
||||
mWorldPosition = mPtr.getRefData().getPosition().asVec3();
|
||||
}
|
||||
|
||||
osg::Vec3f Actor::getWorldPosition() const
|
||||
{
|
||||
return mWorldPosition;
|
||||
}
|
||||
|
||||
void Actor::setSimulationPosition(const osg::Vec3f& position)
|
||||
{
|
||||
mSimulationPosition = position;
|
||||
|
@ -174,7 +162,6 @@ osg::Vec3f Actor::getCollisionObjectPosition() const
|
|||
bool Actor::setPosition(const osg::Vec3f& position)
|
||||
{
|
||||
std::scoped_lock lock(mPositionMutex);
|
||||
updateWorldPosition();
|
||||
applyOffsetChange();
|
||||
bool hasChanged = mPosition != position || mWorldPositionChanged;
|
||||
mPreviousPosition = mPosition;
|
||||
|
|
|
@ -55,13 +55,6 @@ namespace MWPhysics
|
|||
*/
|
||||
bool isRotationallyInvariant() const;
|
||||
|
||||
/**
|
||||
* Set mWorldPosition to the position in the Ptr's RefData. This is used by the physics simulation to account for
|
||||
* when an object is "instantly" moved/teleported as opposed to being moved by the physics simulation.
|
||||
*/
|
||||
void updateWorldPosition();
|
||||
osg::Vec3f getWorldPosition() const;
|
||||
|
||||
/**
|
||||
* Used by the physics simulation to store the simulation result. Used in conjunction with mWorldPosition
|
||||
* to account for e.g. scripted movements
|
||||
|
@ -204,7 +197,6 @@ namespace MWPhysics
|
|||
|
||||
osg::Vec3f mScale;
|
||||
osg::Vec3f mRenderingScale;
|
||||
osg::Vec3f mWorldPosition;
|
||||
osg::Vec3f mSimulationPosition;
|
||||
osg::Vec3f mPosition;
|
||||
osg::Vec3f mPreviousPosition;
|
||||
|
|
|
@ -938,7 +938,6 @@ namespace MWPhysics
|
|||
|
||||
void ActorFrameData::updatePosition(btCollisionWorld* world)
|
||||
{
|
||||
mActorRaw->updateWorldPosition();
|
||||
mActorRaw->applyOffsetChange();
|
||||
mPosition = mActorRaw->getPosition();
|
||||
if (mWaterCollision && mPosition.z() < mWaterlevel && canMoveToWaterSurface(mActorRaw, mWaterlevel, world))
|
||||
|
|
Loading…
Reference in a new issue