removing the pulsing mechanism in MyAvatar and making a new stadnard.json mapping file

This commit is contained in:
samcake 2015-11-04 10:53:53 -08:00
parent bbe74f2e55
commit ce5e89ce66
3 changed files with 7 additions and 26 deletions

View file

@ -2,8 +2,9 @@
"name": "Standard to Action", "name": "Standard to Action",
"channels": [ "channels": [
{ "from": "Standard.LY", "to": "Actions.TranslateZ" }, { "from": "Standard.LY", "to": "Actions.TranslateZ" },
{ "from": "Standard.LX", "to": "Actions.TranslateX" },
{ "from": "Standard.LX", { "from": "Standard.RX",
"when": [ "Application.InHMD", "Application.ComfortMode" ], "when": [ "Application.InHMD", "Application.ComfortMode" ],
"to": "Actions.StepYaw", "to": "Actions.StepYaw",
"filters": "filters":
@ -12,11 +13,8 @@
{ "type": "scale", "scale": 15 } { "type": "scale", "scale": 15 }
] ]
}, },
{ "from": "Standard.RX", "to": "Actions.Yaw" },
{ "from": "Standard.LX", "to": "Actions.Yaw" }, { "from": "Standard.RY", "when": "!Application.InHMD", "to": "Actions.Pitch" },
{ "from": "Standard.RX", "to": "Actions.TranslateX" },
{ "from": "Standard.RY", "filters": "invert", "to": "Actions.TranslateY" },
{ "from": [ "Standard.DU", "Standard.DL", "Standard.DR", "Standard.DD" ], "to": "Standard.LeftPrimaryThumb" }, { "from": [ "Standard.DU", "Standard.DL", "Standard.DR", "Standard.DD" ], "to": "Standard.LeftPrimaryThumb" },

View file

@ -53,7 +53,6 @@
using namespace std; using namespace std;
static quint64 COMFORT_MODE_PULSE_TIMING = USECS_PER_SECOND / 2; // turn once per half second
const glm::vec3 DEFAULT_UP_DIRECTION(0.0f, 1.0f, 0.0f); const glm::vec3 DEFAULT_UP_DIRECTION(0.0f, 1.0f, 0.0f);
const float YAW_SPEED = 150.0f; // degrees/sec const float YAW_SPEED = 150.0f; // degrees/sec
const float PITCH_SPEED = 100.0f; // degrees/sec const float PITCH_SPEED = 100.0f; // degrees/sec
@ -259,23 +258,9 @@ void MyAvatar::simulate(float deltaTime) {
stepAction = true; stepAction = true;
} }
} }
quint64 now = usecTimestampNow();
quint64 pulseDeltaTime = now - _lastStepPulse;
if (!stepAction) {
_lastStepPulse = 0;
}
if (stepAction && pulseDeltaTime > COMFORT_MODE_PULSE_TIMING) {
_pulseUpdate = true;
}
updateOrientation(deltaTime); updateOrientation(deltaTime);
updatePosition(deltaTime); updatePosition(deltaTime);
if (_pulseUpdate) {
_lastStepPulse = now;
_pulseUpdate = false;
}
} }
{ {
@ -1623,7 +1608,7 @@ void MyAvatar::updateOrientation(float deltaTime) {
// get an instantaneous 15 degree turn. If you keep holding the key down you'll get another // get an instantaneous 15 degree turn. If you keep holding the key down you'll get another
// snap turn every half second. // snap turn every half second.
quint64 now = usecTimestampNow(); quint64 now = usecTimestampNow();
if (_driveKeys[STEP_YAW] != 0.0f && now - _lastStepPulse > COMFORT_MODE_PULSE_TIMING) { if (_driveKeys[STEP_YAW] != 0.0f) {
totalBodyYaw += _driveKeys[STEP_YAW]; totalBodyYaw += _driveKeys[STEP_YAW];
} }
@ -1692,9 +1677,9 @@ glm::vec3 MyAvatar::applyKeyboardMotor(float deltaTime, const glm::vec3& localVe
glm::vec3 newLocalVelocity = localVelocity; glm::vec3 newLocalVelocity = localVelocity;
float stepControllerInput = fabsf(_driveKeys[STEP_TRANSLATE_Z]) + fabsf(_driveKeys[STEP_TRANSLATE_Z]) + fabsf(_driveKeys[STEP_TRANSLATE_Z]); float stepControllerInput = fabsf(_driveKeys[STEP_TRANSLATE_Z]) + fabsf(_driveKeys[STEP_TRANSLATE_Z]) + fabsf(_driveKeys[STEP_TRANSLATE_Z]);
quint64 now = usecTimestampNow(); quint64 now = usecTimestampNow();
// FIXME how do I implement step translation as well? // FIXME how do I implement step translation as well?
if (stepControllerInput && now - _lastStepPulse > COMFORT_MODE_PULSE_TIMING) {
}
float keyboardInput = fabsf(_driveKeys[TRANSLATE_Z]) + fabsf(_driveKeys[TRANSLATE_X]) + fabsf(_driveKeys[TRANSLATE_Y]); float keyboardInput = fabsf(_driveKeys[TRANSLATE_Z]) + fabsf(_driveKeys[TRANSLATE_X]) + fabsf(_driveKeys[TRANSLATE_Y]);
if (keyboardInput) { if (keyboardInput) {

View file

@ -420,8 +420,6 @@ private:
AtRestDetector _hmdAtRestDetector; AtRestDetector _hmdAtRestDetector;
bool _lastIsMoving { false }; bool _lastIsMoving { false };
quint64 _lastStepPulse { 0 };
bool _pulseUpdate { false };
}; };
QScriptValue audioListenModeToScriptValue(QScriptEngine* engine, const AudioListenerMode& audioListenerMode); QScriptValue audioListenModeToScriptValue(QScriptEngine* engine, const AudioListenerMode& audioListenerMode);