@ -87,36 +87,25 @@ namespace MWWorld
const ESM : : Position & refpos = ptr . getRefData ( ) . getPosition ( ) ;
const ESM : : Position & refpos = ptr . getRefData ( ) . getPosition ( ) ;
Ogre : : Vector3 position ( refpos . pos ) ;
Ogre : : Vector3 position ( refpos . pos ) ;
bool hit = false ;
bool isInterior = ! ptr . getCell ( ) - > isExterior ( ) ;
OEngine : : Physic : : PhysicActor * physicActor = engine - > getCharacter ( ptr . getRefData ( ) . getHandle ( ) ) ;
OEngine : : Physic : : PhysicActor * physicActor = engine - > getCharacter ( ptr . getRefData ( ) . getHandle ( ) ) ;
if ( ! physicActor )
if ( ! physicActor )
return position ;
return position ;
bool wasCollisionMode = physicActor - > getCollisionMode ( ) ;
const int maxHeight = 64.f ;
physicActor - > enableCollisions ( false ) ;
Ogre : : Vector3 newPosition = position + Ogre : : Vector3 ( 0.0f , 0.0f , 4.0f ) ;
Ogre : : Vector3 halfExtents = physicActor - > getHalfExtents ( ) ;
halfExtents . z = 1 ; // we trace the feet only, so we use a very thin box
Ogre : : Vector3 newPosition = position ;
traceResults trace ;
actortrace ( & trace , physicActor - > getCollisionBody ( ) , newPosition , newPosition - Ogre : : Vector3 ( 0 , 0 , maxHeight ) , engine ) ;
if ( trace . fraction > = 1.0f )
return position ;
traceResults trace ; //no initialization needed
physicActor- > setOnGround ( getSlope ( trace . planenormal ) < = sMaxSlope ) ;
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 ;
newPosition = trace . endpos ;
newPosition . z - = physicActor - > getHalfExtents ( ) . z ;
newPosition . z + = 4.0f ;
physicActor - > setOnGround ( hit & & getSlope ( trace . planenormal ) < = sMaxSlope ) ;
return newPosition ;
if ( wasCollisionMode )
physicActor - > enableCollisions ( true ) ;
if ( ! hit )
return position ;
return newPosition + Ogre : : Vector3 ( 0 , 0 , 4 ) ;
}
}
static Ogre : : Vector3 move ( const MWWorld : : Ptr & ptr , const Ogre : : Vector3 & movement , float time ,
static Ogre : : Vector3 move ( const MWWorld : : Ptr & ptr , const Ogre : : Vector3 & movement , float time ,