Added a RotateAcceleration field to the config file to control the sensitivity of keyboard and joystick navigation controls.

ver1_5_1
Chris Laurel 2002-10-22 17:26:51 +00:00
parent e7dba5ea0e
commit 9c6f61e156
3 changed files with 11 additions and 5 deletions

View File

@ -50,11 +50,11 @@ static const float fIncrementFactor = 10.0f;
static const double fMinSlewRate = 3.0;
static const double fMaxKeyAccel = 20.0;
static const float fAltitudeThreshold = 4.0f;
static const float KeyRotationAccel = degToRad(120.0f);
static const float RotationBraking = 10.0f;
static const float RotationDecay = 2.0f;
static const double MaximumTimeRate = 1.0e15;
static const float stdFOV = 45.0f;
static float KeyRotationAccel = degToRad(120.0f);
static void warning(string s)
@ -1028,13 +1028,13 @@ void CelestiaCore::tick()
float fov = renderer->getFieldOfView()/stdFOV;
if (keysPressed[Key_Left])
av += Vec3f(0, 0, dt);
av += Vec3f(0, 0, dt * -KeyRotationAccel);
if (keysPressed[Key_Right])
av += Vec3f(0, 0, -dt);
av += Vec3f(0, 0, dt * KeyRotationAccel);
if (keysPressed[Key_Down])
av += Vec3f(dt * fov, 0, 0);
av += Vec3f(dt * fov * -KeyRotationAccel, 0, 0);
if (keysPressed[Key_Up])
av += Vec3f(-dt * fov, 0, 0);
av += Vec3f(dt * fov * KeyRotationAccel, 0, 0);
if (keysPressed[Key_NumPad4])
av += Vec3f(0, dt * fov * -KeyRotationAccel, 0);
@ -1708,6 +1708,8 @@ bool CelestiaCore::initSimulation()
return false;
}
KeyRotationAccel = degToRad(config->rotateAcceleration);
readFavoritesFile();
// If we couldn't read the favorites list from a file, allocate

View File

@ -72,6 +72,9 @@ CelestiaConfig* ReadCelestiaConfig(string filename)
// configParams->getNumber("LogoWidth", config->logoWidth);
// configParams->getNumber("LogoHeight", config->logoHeight);
config->rotateAcceleration = 120.0f;
configParams->getNumber("RotateAcceleration", config->rotateAcceleration);
Value* solarSystemsVal = configParams->getValue("SolarSystemCatalogs");
if (solarSystemsVal != NULL)
{

View File

@ -33,6 +33,7 @@ struct CelestiaConfig
std::string labelFont;
std::string titleFont;
std::string logoTextureFile;
float rotateAcceleration;
};