btKinematicCharacterController::btKinematicCharacterController (btPairCachingGhostObject* ghostObject,btConvexShape* convexShape,btScalar stepHeight, int upAxis) { m_upAxis = upAxis; m_addedMargin = btScalar(0.02); m_walkDirection.setValue(0,0,0); m_useGhostObjectSweepTest = true; m_ghostObject = ghostObject; m_stepHeight = stepHeight; m_turnAngle = btScalar(0.0); m_convexShape=convexShape; m_useWalkDirection = true; // use walk direction by default, legacy behavior m_velocityTimeInterval = 0.0; m_verticalVelocity = 0.0; m_verticalOffset = 0.0; m_gravity = btScalar(9.8 * 3); // 3G acceleration. m_fallSpeed = 55.0; // Terminal velocity of a sky diver in m/s. m_jumpSpeed = 10.0; // ? m_wasOnGround = false; m_wasJumping = false; m_interpolateUp = true; setMaxSlope(btRadians(45.0)); m_currentStepOffset = 0; full_drop = false; bounce_fix = false; }
bulletCharacterController::bulletCharacterController (btPairCachingGhostObject* ghostObject,btConvexShape* convexShape,btScalar stepHeight, int upAxis) { m_upAxis = upAxis; m_addedMargin = 0.02; m_walkDirection.setValue(0,0,0); m_useGhostObjectSweepTest = true; m_ghostObject = ghostObject; m_stepHeight = stepHeight; m_turnAngle = btScalar(0.0); m_convexShape=convexShape; m_useWalkDirection = true; // use walk direction by default, legacy behavior m_velocityTimeInterval = 0.0; m_verticalVelocity = 0.0; m_verticalOffset = 0.0; m_gravity = 9.8; // 1G accelation. m_fallSpeed = 55.0; // Terminal velocity of a sky diver in m/s. m_jumpSpeed = 10.0; // ? m_wasOnGround = false; m_responseEnabled = true; setMaxSlope(btRadians(50.0)); }
btKinematicCharacterController::btKinematicCharacterController( btPairCachingGhostObject* externalGhostObject_, btPairCachingGhostObject* internalGhostObject_, btScalar stepHeight, btScalar constantScale, btScalar gravity, btScalar fallVelocity, btScalar jumpVelocity, btScalar recoveringFactor ) { m_upAxis = btKinematicCharacterController::Y_AXIS; m_walkDirection.setValue( btScalar( 0 ), btScalar( 0 ), btScalar( 0 ) ); m_useGhostObjectSweepTest = true; externalGhostObject = externalGhostObject_; internalGhostObject = internalGhostObject_; m_recoveringFactor = recoveringFactor; m_stepHeight = stepHeight; m_useWalkDirection = true; // use walk direction by default, legacy behavior m_velocityTimeInterval = btScalar( 0 ); m_verticalVelocity = btScalar( 0 ); m_verticalOffset = btScalar( 0 ); m_gravity = constantScale * gravity; m_fallSpeed = constantScale * fallVelocity; // Terminal velocity of a sky diver in m/s. m_jumpSpeed = constantScale * jumpVelocity; // ? m_wasJumping = false; setMaxSlope( btRadians( 45.0 ) ); mCollision = true; }