mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-30 07:21:12 +00:00
Make sure physics simulation does not reset flags for nonprocessed actors
Actor::getOnGround and Actor::getOnSlope is used to initialize ActorFrameData. After a physics simulation the result is copied back. But when actor is outside processing range, Actor::mInternalCollisionMode is false and physics simulation does not recalculate OnGround and OnSlope flags. So the flags are always set to false that makes actor play landing animation when they exit and then enter actors processing range.
This commit is contained in:
parent
ec6ba3deeb
commit
617cd4ceb6
@ -116,17 +116,11 @@ namespace MWPhysics
|
||||
|
||||
void setOnGround(bool grounded);
|
||||
|
||||
bool getOnGround() const
|
||||
{
|
||||
return mInternalCollisionMode && mOnGround;
|
||||
}
|
||||
bool getOnGround() const { return mOnGround; }
|
||||
|
||||
void setOnSlope(bool slope);
|
||||
|
||||
bool getOnSlope() const
|
||||
{
|
||||
return mInternalCollisionMode && mOnSlope;
|
||||
}
|
||||
bool getOnSlope() const { return mOnSlope; }
|
||||
|
||||
/// Sets whether this actor should be able to collide with the water surface
|
||||
void setCanWaterWalk(bool waterWalk);
|
||||
|
@ -176,7 +176,7 @@ namespace MWPhysics
|
||||
bool PhysicsSystem::isOnSolidGround (const MWWorld::Ptr& actor) const
|
||||
{
|
||||
const Actor* physactor = getActor(actor);
|
||||
if (!physactor || !physactor->getOnGround())
|
||||
if (!physactor || !physactor->getOnGround() || !physactor->getCollisionMode())
|
||||
return false;
|
||||
|
||||
const auto obj = physactor->getStandingOnPtr();
|
||||
@ -374,7 +374,7 @@ namespace MWPhysics
|
||||
bool PhysicsSystem::isOnGround(const MWWorld::Ptr &actor)
|
||||
{
|
||||
Actor* physactor = getActor(actor);
|
||||
return physactor && physactor->getOnGround();
|
||||
return physactor && physactor->getOnGround() && physactor->getCollisionMode();
|
||||
}
|
||||
|
||||
bool PhysicsSystem::canMoveToWaterSurface(const MWWorld::ConstPtr &actor, const float waterlevel)
|
||||
|
Loading…
x
Reference in New Issue
Block a user