1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 20:53:50 +00:00

Trace up to waterlevel + halfextent

This commit is contained in:
Assumeru 2016-11-09 18:03:10 +01:00
parent 25d64989b3
commit 99bc4f733f

View file

@ -1329,13 +1329,13 @@ namespace MWPhysics
else if (physicActor->getCollisionMode())
{
const osg::Vec3f actorPosition = physicActor->getPosition();
const osg::Vec3f destinationPosition(actorPosition.x(), actorPosition.y(), waterlevel);
const osg::Vec3f destinationPosition(actorPosition.x(), actorPosition.y(), waterlevel + physicActor->getHalfExtents().z());
ActorTracer tracer;
tracer.doTrace(physicActor->getCollisionObject(), actorPosition, destinationPosition, mCollisionWorld);
if (tracer.mFraction >= 1.0f)
{
waterCollision = true;
physicActor->setPosition(destinationPosition);
physicActor->setPosition(osg::Vec3f(actorPosition.x(), actorPosition.y(), waterlevel));
}
else
{