1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-31 22:15:33 +00:00

Fix tracing down

This commit is contained in:
Chris Robinson 2013-08-17 04:55:35 -07:00
parent 8bcce0fb55
commit 0481e64b02

View file

@ -92,9 +92,10 @@ namespace MWWorld
if (!physicActor)
return position;
const int maxHeight = 64.f;
Ogre::Vector3 newPosition = position+Ogre::Vector3(0.0f, 0.0f, 4.0f);
const Ogre::Vector3 halfExtents = physicActor->getHalfExtents();
Ogre::Vector3 newPosition = position+Ogre::Vector3(0.0f, 0.0f, halfExtents.z);
const int maxHeight = 200.f;
OEngine::Physic::ActorTracer tracer;
tracer.doTrace(physicActor->getCollisionBody(), newPosition, newPosition-Ogre::Vector3(0,0,maxHeight), engine);
if(tracer.mFraction >= 1.0f)
@ -103,7 +104,7 @@ namespace MWWorld
physicActor->setOnGround(getSlope(tracer.mPlaneNormal) <= sMaxSlope);
newPosition = tracer.mEndPos;
newPosition.z -= physicActor->getHalfExtents().z;
newPosition.z -= halfExtents.z;
newPosition.z += 2.0f;
return newPosition;