Changed gravity constant

This commit is contained in:
ksuprynowicz 2023-11-19 17:39:10 +01:00
parent d2e0e2f41b
commit 825c398e54
4 changed files with 10 additions and 8 deletions

View file

@ -2806,8 +2806,8 @@ controller::Pose MyAvatar::getControllerPoseInAvatarFrame(controller::Action act
void MyAvatar::updateMotors() {
_characterController.clearMotors();
const float FLYING_MOTOR_TIMESCALE = 0.0002f; // Originally 0.05f;
const float WALKING_MOTOR_TIMESCALE = 0.0002f; // Originally 0.2f;
const float FLYING_MOTOR_TIMESCALE = 0.002f; // Originally 0.05f;
const float WALKING_MOTOR_TIMESCALE = 0.1f; // Originally 0.2f;
const float INVALID_MOTOR_TIMESCALE = 1.0e6f;
float horizontalMotorTimescale;
@ -4091,7 +4091,7 @@ void MyAvatar::updateActionMotor(float deltaTime) {
float finalMaxMotorSpeed = sensorToWorldScale * DEFAULT_AVATAR_MAX_FLYING_SPEED * _walkSpeedScalar;
float speedGrowthTimescale = 2.0f;
float speedIncreaseFactor = 1.8f * _walkSpeedScalar;
motorSpeed *= 1.0f + glm::pow(glm::clamp(deltaTime / speedGrowthTimescale, 0.0f, 1.0f), 0.7f) * speedIncreaseFactor;
motorSpeed *= 1.0f + glm::pow(glm::clamp(deltaTime / speedGrowthTimescale, 0.0f, 1.0f), 0.85f) * speedIncreaseFactor;
// use feedback from CharacterController to prevent tunneling under high motorspeed
motorSpeed *= _characterController.getCollisionBrakeAttenuationFactor();
const float maxBoostSpeed = sensorToWorldScale * MAX_BOOST_SPEED;

View file

@ -2849,7 +2849,7 @@ private:
ThreadSafeValueCache<QUrl> _prefOverrideAnimGraphUrl;
QUrl _fstAnimGraphOverrideUrl;
bool _useSnapTurn { true };
bool _hoverWhenUnsupported{ true };
bool _hoverWhenUnsupported{ false };
ThreadSafeValueCache<QString> _dominantHand { DOMINANT_RIGHT_HAND };
ThreadSafeValueCache<QString> _hmdAvatarAlignmentType { DEFAULT_HMD_AVATAR_ALIGNMENT_TYPE };
ThreadSafeValueCache<bool> _strafeEnabled{ DEFAULT_STRAFE_ENABLED };

View file

@ -927,9 +927,10 @@ void CharacterController::updateState() {
const btScalar FLY_TO_GROUND_THRESHOLD = 0.1f * _radius;
const btScalar GROUND_TO_FLY_THRESHOLD = 0.8f * _radius + _halfHeight;
// TODO: This could be a setting. With 5 ms jumping feels very responsive, but with 250 ms animation looks nicer
const quint64 TAKE_OFF_TO_IN_AIR_PERIOD = 5 * MSECS_PER_SECOND; // Originally 250 ms
const btScalar MIN_HOVER_HEIGHT = _scaleFactor * DEFAULT_AVATAR_MIN_HOVER_HEIGHT;
const quint64 JUMP_TO_HOVER_PERIOD = _scaleFactor < 1.0f ? _scaleFactor * 350 * MSECS_PER_SECOND : 350 * MSECS_PER_SECOND; // Originally 1100 ms
const quint64 JUMP_TO_HOVER_PERIOD = _scaleFactor < 1.0f ? _scaleFactor * 500 * MSECS_PER_SECOND : 500 * MSECS_PER_SECOND; // Originally 1100 ms
// scan for distant floor
// rayStart is at center of bottom sphere

View file

@ -89,13 +89,14 @@ const float ANALOG_PLUS_AVATAR_MAX_WALKING_BACKWARD_SPEED = 2.42f; // meters / s
const float ANALOG_PLUS_AVATAR_MAX_FLYING_SPEED = 30.0f; // meters / second
const float ANALOG_PLUS_AVATAR_MAX_SPRINT_SPEED = 20.0f; // meters / second
const float DEFAULT_AVATAR_GRAVITY = -5.0f; // meters / second^2 (world)
const float DEFAULT_AVATAR_JUMP_SPEED = 3.5f; // meters / second (sensor)
const float DEFAULT_AVATAR_GRAVITY = -9.8f; // meters / second^2 (world) (originally -5.0f)
const float DEFAULT_AVATAR_JUMP_SPEED = 5.0f; // meters / second (sensor) (originally 3.5f)
const float DEFAULT_AVATAR_JUMP_HEIGHT = (DEFAULT_AVATAR_JUMP_SPEED * DEFAULT_AVATAR_JUMP_SPEED) / (2.0f * -DEFAULT_AVATAR_GRAVITY); // meters (sensor)
const float DEFAULT_AVATAR_MIN_JUMP_HEIGHT = 0.25f; // meters (world) // hack
const float DEFAULT_AVATAR_FALL_HEIGHT = 20.0f; // meters
const float DEFAULT_AVATAR_MIN_HOVER_HEIGHT = 2.5f; // meters
const float DEFAULT_AVATAR_MIN_HOVER_HEIGHT = 0.35f; // meters, normally it was 2.5f
//const float DEFAULT_AVATAR_MIN_HOVER_HEIGHT = 2.5f; // meters, normally it was 2.5f
static const float MAX_AVATAR_SCALE = 1000.0f;
static const float MIN_AVATAR_SCALE = 0.005f;