mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
Start trace from collision object origin
This commit is contained in:
parent
99bc4f733f
commit
05cc258ed3
1 changed files with 4 additions and 2 deletions
|
@ -1328,10 +1328,12 @@ namespace MWPhysics
|
|||
waterCollision = true;
|
||||
else if (physicActor->getCollisionMode())
|
||||
{
|
||||
const float halfZ = physicActor->getHalfExtents().z();
|
||||
const osg::Vec3f actorPosition = physicActor->getPosition();
|
||||
const osg::Vec3f destinationPosition(actorPosition.x(), actorPosition.y(), waterlevel + physicActor->getHalfExtents().z());
|
||||
const osg::Vec3f startingPosition(actorPosition.x(), actorPosition.y(), actorPosition.z() + halfZ);
|
||||
const osg::Vec3f destinationPosition(actorPosition.x(), actorPosition.y(), waterlevel + halfZ);
|
||||
ActorTracer tracer;
|
||||
tracer.doTrace(physicActor->getCollisionObject(), actorPosition, destinationPosition, mCollisionWorld);
|
||||
tracer.doTrace(physicActor->getCollisionObject(), startingPosition, destinationPosition, mCollisionWorld);
|
||||
if (tracer.mFraction >= 1.0f)
|
||||
{
|
||||
waterCollision = true;
|
||||
|
|
Loading…
Reference in a new issue