mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
Tweaked adjustPosition. Now uses a very thin box for tracing the feet only.
This commit is contained in:
parent
91c89e5db4
commit
1420a2cb33
@ -105,18 +105,19 @@ namespace MWWorld
|
||||
physicActor->enableCollisions(false);
|
||||
|
||||
Ogre::Vector3 halfExtents = physicActor->getHalfExtents();// + Vector3(1,1,1);
|
||||
halfExtents.z = 1; // we trace the feet only, so we use a very thin box
|
||||
|
||||
Ogre::Vector3 newPosition = position;
|
||||
|
||||
traceResults trace; //no initialization needed
|
||||
|
||||
int maxHeight = 400.f;
|
||||
int maxHeight = 200.f;
|
||||
newtrace(&trace, Ogre::Quaternion::IDENTITY, newPosition, newPosition-Ogre::Vector3(0,0,maxHeight), halfExtents, isInterior, engine);
|
||||
if(trace.fraction < 1.0f)
|
||||
hit = true;
|
||||
newPosition = trace.endpos;
|
||||
|
||||
physicActor->setOnGround(hit);
|
||||
physicActor->setOnGround(hit && getSlope(trace.planenormal) <= sMaxSlope);
|
||||
physicActor->enableCollisions(wasCollisionMode);
|
||||
|
||||
if (hit)
|
||||
|
@ -911,7 +911,7 @@ namespace MWWorld
|
||||
float terrainHeight = mRendering->getTerrainHeightAt(pos);
|
||||
|
||||
if (pos.z < terrainHeight)
|
||||
pos.z = terrainHeight+400; // place slightly above. will snap down to ground with code below
|
||||
pos.z = terrainHeight+5; // place slightly above. will snap down to ground with code below
|
||||
|
||||
ptr.getRefData().getPosition().pos[2] = pos.z;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user