mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 02:43:32 +02:00
quadratic zooming response
This commit is contained in:
parent
2f0fcba1eb
commit
c9d205de3e
2 changed files with 5 additions and 4 deletions
|
@ -71,7 +71,7 @@ const int SCRIPTED_MOTOR_AVATAR_FRAME = 1;
|
||||||
const int SCRIPTED_MOTOR_WORLD_FRAME = 2;
|
const int SCRIPTED_MOTOR_WORLD_FRAME = 2;
|
||||||
|
|
||||||
const float MyAvatar::ZOOM_MIN = 0.5f;
|
const float MyAvatar::ZOOM_MIN = 0.5f;
|
||||||
const float MyAvatar::ZOOM_MAX = 10.0f;
|
const float MyAvatar::ZOOM_MAX = 25.0f;
|
||||||
const float MyAvatar::ZOOM_DEFAULT = 1.5f;
|
const float MyAvatar::ZOOM_DEFAULT = 1.5f;
|
||||||
|
|
||||||
MyAvatar::MyAvatar() :
|
MyAvatar::MyAvatar() :
|
||||||
|
@ -1333,7 +1333,8 @@ glm::vec3 MyAvatar::applyKeyboardMotor(float deltaTime, const glm::vec3& localVe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_boomLength += _driveKeys[BOOM_OUT] - _driveKeys[BOOM_IN];
|
float boomChange = _driveKeys[BOOM_OUT] - _driveKeys[BOOM_IN];
|
||||||
|
_boomLength += 2.0f * _boomLength * boomChange + boomChange * boomChange;
|
||||||
_boomLength = glm::clamp<float>(_boomLength, ZOOM_MIN, ZOOM_MAX);
|
_boomLength = glm::clamp<float>(_boomLength, ZOOM_MIN, ZOOM_MAX);
|
||||||
|
|
||||||
return newLocalVelocity;
|
return newLocalVelocity;
|
||||||
|
|
|
@ -245,8 +245,8 @@ void UserInputMapper::assignDefaulActionScales() {
|
||||||
_actionScales[YAW_RIGHT] = 1.0f; // 1 degree per unit
|
_actionScales[YAW_RIGHT] = 1.0f; // 1 degree per unit
|
||||||
_actionScales[PITCH_DOWN] = 1.0f; // 1 degree per unit
|
_actionScales[PITCH_DOWN] = 1.0f; // 1 degree per unit
|
||||||
_actionScales[PITCH_UP] = 1.0f; // 1 degree per unit
|
_actionScales[PITCH_UP] = 1.0f; // 1 degree per unit
|
||||||
_actionScales[BOOM_IN] = 1.0f; // 1m per unit
|
_actionScales[BOOM_IN] = 0.5f; // .5m per unit
|
||||||
_actionScales[BOOM_OUT] = 1.0f; // 1m per unit
|
_actionScales[BOOM_OUT] = 0.5f; // .5m per unit
|
||||||
_actionStates[SHIFT] = 1.0f; // on
|
_actionStates[SHIFT] = 1.0f; // on
|
||||||
_actionStates[ACTION1] = 1.0f; // default
|
_actionStates[ACTION1] = 1.0f; // default
|
||||||
_actionStates[ACTION2] = 1.0f; // default
|
_actionStates[ACTION2] = 1.0f; // default
|
||||||
|
|
Loading…
Reference in a new issue