forked from teamnwah/openmw-tes3coop
add gravity
This commit is contained in:
parent
122e526cba
commit
79fba7e77e
1 changed files with 7 additions and 7 deletions
|
@ -34,11 +34,11 @@ namespace Physic
|
||||||
externalGhostObject = new PairCachingGhostObject(name);
|
externalGhostObject = new PairCachingGhostObject(name);
|
||||||
externalGhostObject->setWorldTransform( transform );
|
externalGhostObject->setWorldTransform( transform );
|
||||||
|
|
||||||
btScalar externalCapsuleHeight = 50;
|
btScalar externalCapsuleHeight = 90;
|
||||||
btScalar externalCapsuleWidth = 20;
|
btScalar externalCapsuleWidth = 16;
|
||||||
|
|
||||||
externalCollisionShape = new btCapsuleShapeZ( externalCapsuleWidth, externalCapsuleHeight );
|
externalCollisionShape = new btCapsuleShapeZ( externalCapsuleWidth, externalCapsuleHeight );
|
||||||
externalCollisionShape->setMargin( 1 );
|
externalCollisionShape->setMargin( 0.05 );
|
||||||
|
|
||||||
externalGhostObject->setCollisionShape( externalCollisionShape );
|
externalGhostObject->setCollisionShape( externalCollisionShape );
|
||||||
externalGhostObject->setCollisionFlags( btCollisionObject::CF_CHARACTER_OBJECT );
|
externalGhostObject->setCollisionFlags( btCollisionObject::CF_CHARACTER_OBJECT );
|
||||||
|
@ -47,16 +47,16 @@ namespace Physic
|
||||||
internalGhostObject = new PairCachingGhostObject(name);
|
internalGhostObject = new PairCachingGhostObject(name);
|
||||||
internalGhostObject->setWorldTransform( transform );
|
internalGhostObject->setWorldTransform( transform );
|
||||||
//internalGhostObject->getBroadphaseHandle()->s
|
//internalGhostObject->getBroadphaseHandle()->s
|
||||||
btScalar internalCapsuleHeight = 20;
|
btScalar internalCapsuleHeight = 88;
|
||||||
btScalar internalCapsuleWidth = 5;
|
btScalar internalCapsuleWidth = 15;
|
||||||
|
|
||||||
internalCollisionShape = new btCapsuleShapeZ( internalCapsuleWidth, internalCapsuleHeight );
|
internalCollisionShape = new btCapsuleShapeZ( internalCapsuleWidth, internalCapsuleHeight );
|
||||||
internalCollisionShape->setMargin( 1 );
|
internalCollisionShape->setMargin( 0.05 );
|
||||||
|
|
||||||
internalGhostObject->setCollisionShape( internalCollisionShape );
|
internalGhostObject->setCollisionShape( internalCollisionShape );
|
||||||
internalGhostObject->setCollisionFlags( btCollisionObject::CF_CHARACTER_OBJECT );
|
internalGhostObject->setCollisionFlags( btCollisionObject::CF_CHARACTER_OBJECT );
|
||||||
|
|
||||||
mCharacter = new btKinematicCharacterController( externalGhostObject,internalGhostObject,btScalar( 0.4 ),1,0 );
|
mCharacter = new btKinematicCharacterController( externalGhostObject,internalGhostObject,btScalar( 10 ),1,20,20,9.8,0.2 );
|
||||||
mCharacter->setUpAxis(btKinematicCharacterController::Z_AXIS);
|
mCharacter->setUpAxis(btKinematicCharacterController::Z_AXIS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue