Address Wayne and Angus' comments on github.

This commit is contained in:
r3tk0n 2019-04-03 09:38:14 -07:00
parent 4fb7bbabe1
commit ec37ad7dc6
2 changed files with 26 additions and 48 deletions

View file

@ -3331,23 +3331,6 @@ void MyAvatar::updateOrientation(float deltaTime) {
}
}
//static float scaleSpeedByDirection(const glm::vec2 velocityDirection, const float forwardSpeed, const float backwardSpeed) {
// // for the elipse function --> (x^2)/(backwardSpeed*backwardSpeed) + y^2/(forwardSpeed*forwardSpeed) = 1, scale == y^2 when x is 0
// float fwdScale = forwardSpeed * forwardSpeed;
// float backScale = backwardSpeed * backwardSpeed;
// float scaledX = velocityDirection.x * backwardSpeed;
// float scaledSpeed = forwardSpeed;
// if (velocityDirection.y < 0.0f) {
// if (backScale > 0.0f) {
// float yValue = sqrtf(fwdScale * (1.0f - ((scaledX * scaledX) / backScale)));
// scaledSpeed = sqrtf((scaledX * scaledX) + (yValue * yValue));
// }
// } else {
// scaledSpeed = backwardSpeed;
// }
// return scaledSpeed;
//}
float MyAvatar::calculateGearedSpeed(const float driveKey) {
float absDriveKey = abs(driveKey);
float sign = (driveKey < 0.0f) ? -1.0f : 1.0f;
@ -3506,12 +3489,7 @@ void MyAvatar::updateActionMotor(float deltaTime) {
}
_actionMotorVelocity = motorSpeed * direction;
} else {
// we're interacting with a floor --> simple horizontal speed and exponential decay
//const glm::vec2 currentVel = { direction.x, direction.z };
//float scaledSpeed = scaleSpeedByDirection(currentVel, _walkSpeed.get(), _walkBackwardSpeed.get());
// _walkSpeedScalar is a multiplier if we are in sprint mode, otherwise 1.0
_actionMotorVelocity = direction;
//_actionMotorVelocity = getSensorToWorldScale() * (scaledSpeed * _walkSpeedScalar) * direction;
}
float previousBoomLength = _boomLength;