mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-31 22:45:33 +00:00
Fix tracing down
This commit is contained in:
parent
8bcce0fb55
commit
0481e64b02
1 changed files with 4 additions and 3 deletions
|
@ -92,9 +92,10 @@ namespace MWWorld
|
||||||
if (!physicActor)
|
if (!physicActor)
|
||||||
return position;
|
return position;
|
||||||
|
|
||||||
const int maxHeight = 64.f;
|
const Ogre::Vector3 halfExtents = physicActor->getHalfExtents();
|
||||||
Ogre::Vector3 newPosition = position+Ogre::Vector3(0.0f, 0.0f, 4.0f);
|
Ogre::Vector3 newPosition = position+Ogre::Vector3(0.0f, 0.0f, halfExtents.z);
|
||||||
|
|
||||||
|
const int maxHeight = 200.f;
|
||||||
OEngine::Physic::ActorTracer tracer;
|
OEngine::Physic::ActorTracer tracer;
|
||||||
tracer.doTrace(physicActor->getCollisionBody(), newPosition, newPosition-Ogre::Vector3(0,0,maxHeight), engine);
|
tracer.doTrace(physicActor->getCollisionBody(), newPosition, newPosition-Ogre::Vector3(0,0,maxHeight), engine);
|
||||||
if(tracer.mFraction >= 1.0f)
|
if(tracer.mFraction >= 1.0f)
|
||||||
|
@ -103,7 +104,7 @@ namespace MWWorld
|
||||||
physicActor->setOnGround(getSlope(tracer.mPlaneNormal) <= sMaxSlope);
|
physicActor->setOnGround(getSlope(tracer.mPlaneNormal) <= sMaxSlope);
|
||||||
|
|
||||||
newPosition = tracer.mEndPos;
|
newPosition = tracer.mEndPos;
|
||||||
newPosition.z -= physicActor->getHalfExtents().z;
|
newPosition.z -= halfExtents.z;
|
||||||
newPosition.z += 2.0f;
|
newPosition.z += 2.0f;
|
||||||
|
|
||||||
return newPosition;
|
return newPosition;
|
||||||
|
|
Loading…
Reference in a new issue