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:
parent
25d64989b3
commit
99bc4f733f
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue