forked from mirror/openmw-tes3mp
Merge remote-tracking branch 'capostrophic/physics'
This commit is contained in:
commit
21ea49fe83
1 changed files with 5 additions and 3 deletions
|
@ -308,6 +308,7 @@ namespace MWPhysics
|
|||
float swimlevel = waterlevel + halfExtents.z() - (physicActor->getRenderingHalfExtents().z() * 2 * fSwimHeightScale);
|
||||
|
||||
ActorTracer tracer;
|
||||
|
||||
osg::Vec3f inertia = physicActor->getInertialForce();
|
||||
osg::Vec3f velocity;
|
||||
|
||||
|
@ -320,10 +321,11 @@ namespace MWPhysics
|
|||
{
|
||||
velocity = (osg::Quat(refpos.rot[2], osg::Vec3f(0, 0, -1))) * movement;
|
||||
|
||||
if (velocity.z() > 0.f && physicActor->getOnGround() && !physicActor->getOnSlope())
|
||||
if ((velocity.z() > 0.f && physicActor->getOnGround() && !physicActor->getOnSlope())
|
||||
|| (velocity.z() > 0.f && velocity.z() + inertia.z() <= -velocity.z() && physicActor->getOnSlope()))
|
||||
inertia = velocity;
|
||||
else if(!physicActor->getOnGround() || physicActor->getOnSlope())
|
||||
velocity = velocity + physicActor->getInertialForce();
|
||||
else if (!physicActor->getOnGround() || physicActor->getOnSlope())
|
||||
velocity = velocity + inertia;
|
||||
}
|
||||
|
||||
// dead actors underwater will float to the surface, if the CharacterController tells us to do so
|
||||
|
|
Loading…
Reference in a new issue