mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-30 13:57:59 +03:00
Various collision changes:
- no collision with NCO objects - better camera control (no turning the camera upside down) - up/down buttons (shift/ctrl) does not move the player when walking - eye level adjusted - various updates git-svn-id: https://openmw.svn.sourceforge.net/svnroot/openmw/trunk@55 ea6a568a-9f4f-0410-981a-c910a81bb256
This commit is contained in:
parent
e927c9a70e
commit
08ba0278a1
9 changed files with 236 additions and 97 deletions
|
@ -34,7 +34,7 @@
|
|||
bool g_touchingContact;
|
||||
btVector3 g_touchingNormal;
|
||||
btScalar g_currentStepOffset;
|
||||
float g_stepHeight = 20;
|
||||
float g_stepHeight = 5;
|
||||
|
||||
// Returns the reflection direction of a ray going 'direction' hitting
|
||||
// a surface with normal 'normal'
|
||||
|
@ -293,6 +293,18 @@ void playerStepCallback(btDynamicsWorld* dynamicsWorld, btScalar timeStep)
|
|||
// simulation.
|
||||
btVector3 walkStep = g_walkDirection * timeStep;
|
||||
|
||||
float len = walkStep.length();
|
||||
|
||||
// In walk mode, it shouldn't matter whether or not we look up or
|
||||
// down. Rotate the vector back to the horizontal plane.
|
||||
if(g_physMode == PHYS_WALK)
|
||||
{
|
||||
walkStep.setZ(0);
|
||||
float len2 = walkStep.length();
|
||||
if(len2 > 0)
|
||||
walkStep *= len/len2;
|
||||
}
|
||||
|
||||
// Get the player position
|
||||
g_playerPosition = g_playerObject->getWorldTransform().getOrigin();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue