cleaned white space

This commit is contained in:
amantley 2018-10-12 16:05:31 -07:00
parent 7dd156ccdd
commit ee830cdcb0

View file

@ -470,7 +470,6 @@ void MyAvatar::update(float deltaTime) {
const float PERCENTAGE_WEIGHT_HEAD_VS_SHOULDERS_AZIMUTH = 0.0f; // 100 percent shoulders const float PERCENTAGE_WEIGHT_HEAD_VS_SHOULDERS_AZIMUTH = 0.0f; // 100 percent shoulders
const float STANDING_HEIGHT_MULTIPLE = 1.2f; const float STANDING_HEIGHT_MULTIPLE = 1.2f;
const float SITTING_HEIGHT_MULTIPLE = 0.833f; const float SITTING_HEIGHT_MULTIPLE = 0.833f;
const float COSINE_TEN_DEGREES = 0.98f;
const float COSINE_THIRTY_DEGREES = 0.866f; const float COSINE_THIRTY_DEGREES = 0.866f;
const int SITTING_COUNT_THRESHOLD = 300; const int SITTING_COUNT_THRESHOLD = 300;
const int SQUATTY_COUNT_THRESHOLD = 600; const int SQUATTY_COUNT_THRESHOLD = 600;
@ -545,12 +544,8 @@ void MyAvatar::update(float deltaTime) {
_tippingPoint = newHeightReading.getTranslation().y; _tippingPoint = newHeightReading.getTranslation().y;
} }
_averageUserHeightCount = 1; _averageUserHeightCount = 1;
// setResetMode(true);
setIsInSittingState(false); setIsInSittingState(false);
// setCenterOfGravityModelEnabled(true);
// setSitStandStateChange(true);
} }
qCDebug(interfaceapp) << "going to stand state";
} else { } else {
_sitStandStateCount = 0; _sitStandStateCount = 0;
// tipping point is average height when sitting. // tipping point is average height when sitting.
@ -568,19 +563,13 @@ void MyAvatar::update(float deltaTime) {
_tippingPoint = newHeightReading.getTranslation().y; _tippingPoint = newHeightReading.getTranslation().y;
} }
_averageUserHeightCount = 1; _averageUserHeightCount = 1;
// setResetMode(true);
setIsInSittingState(true); setIsInSittingState(true);
// setCenterOfGravityModelEnabled(false);
// setSitStandStateChange(true);
} }
qCDebug(interfaceapp) << "going to sit state";
} else { } else {
// returnValue = (offset.y > CYLINDER_TOP) || (offset.y < CYLINDER_BOTTOM);
// use the mode height for the tipping point when we are standing. // use the mode height for the tipping point when we are standing.
_tippingPoint = getCurrentStandingHeight(); _tippingPoint = getCurrentStandingHeight();
_sitStandStateCount = 0; _sitStandStateCount = 0;
} }
} }
} }
@ -3909,7 +3898,12 @@ void MyAvatar::setIsInSittingState(bool isSitting) {
} }
void MyAvatar::setIsSitStandStateLocked(bool isLocked) { void MyAvatar::setIsSitStandStateLocked(bool isLocked) {
const float DEFAULT_FLOOR_HEIGHT = 0.0f;
_lockSitStandState.set(isLocked); _lockSitStandState.set(isLocked);
_sitStandStateCount = 0;
_sumUserHeightSensorSpace = DEFAULT_AVATAR_HEIGHT;
_tippingPoint = DEFAULT_FLOOR_HEIGHT;
_averageUserHeightCount = 1;
emit sitStandStateLockEnabledChanged(isLocked); emit sitStandStateLockEnabledChanged(isLocked);
} }
@ -4156,21 +4150,17 @@ bool MyAvatar::FollowHelper::shouldActivateVertical(MyAvatar& myAvatar, const gl
const int SQUATTY_COUNT_THRESHOLD = 1800; const int SQUATTY_COUNT_THRESHOLD = 1800;
glm::vec3 offset = extractTranslation(desiredBodyMatrix) - extractTranslation(currentBodyMatrix); glm::vec3 offset = extractTranslation(desiredBodyMatrix) - extractTranslation(currentBodyMatrix);
bool returnValue = false; bool returnValue = false;
if (myAvatar.getSitStandStateChange()) { if (myAvatar.getSitStandStateChange()) {
// qCDebug(interfaceapp) << "sit state change";
returnValue = true; returnValue = true;
} }
if (myAvatar.getIsInSittingState()) { if (myAvatar.getIsInSittingState()) {
if (myAvatar.getIsSitStandStateLocked()) { if (myAvatar.getIsSitStandStateLocked()) {
returnValue = (offset.y > CYLINDER_TOP); returnValue = (offset.y > CYLINDER_TOP);
} }
if (offset.y < SITTING_BOTTOM) { if (offset.y < SITTING_BOTTOM) {
// we recenter when sitting. // we recenter more easily when in sitting state.
// qCDebug(interfaceapp) << "lean back sitting ";
returnValue = true; returnValue = true;
} }
} else { } else {
@ -4179,7 +4169,6 @@ bool MyAvatar::FollowHelper::shouldActivateVertical(MyAvatar& myAvatar, const gl
// finally check for squats in standing // finally check for squats in standing
if ((myAvatar._squatCount > SQUATTY_COUNT_THRESHOLD) && !myAvatar.getIsSitStandStateLocked()) { if ((myAvatar._squatCount > SQUATTY_COUNT_THRESHOLD) && !myAvatar.getIsSitStandStateLocked()) {
myAvatar._squatCount = 0; myAvatar._squatCount = 0;
// qCDebug(interfaceapp) << "squatting ";
returnValue = true; returnValue = true;
} }
} }
@ -4194,7 +4183,6 @@ void MyAvatar::FollowHelper::prePhysicsUpdate(MyAvatar& myAvatar, const glm::mat
if (!isActive(Rotation) && (shouldActivateRotation(myAvatar, desiredBodyMatrix, currentBodyMatrix) || hasDriveInput)) { if (!isActive(Rotation) && (shouldActivateRotation(myAvatar, desiredBodyMatrix, currentBodyMatrix) || hasDriveInput)) {
activate(Rotation); activate(Rotation);
qCDebug(interfaceapp) << "should activate rotation true ";
myAvatar.setHeadControllerFacingMovingAverage(myAvatar.getHeadControllerFacing()); myAvatar.setHeadControllerFacingMovingAverage(myAvatar.getHeadControllerFacing());
} }
if (myAvatar.getCenterOfGravityModelEnabled()) { if (myAvatar.getCenterOfGravityModelEnabled()) {
@ -4210,28 +4198,22 @@ void MyAvatar::FollowHelper::prePhysicsUpdate(MyAvatar& myAvatar, const glm::mat
if (!isActive(Horizontal) && (shouldActivateHorizontal(myAvatar, desiredBodyMatrix, currentBodyMatrix) || hasDriveInput)) { if (!isActive(Horizontal) && (shouldActivateHorizontal(myAvatar, desiredBodyMatrix, currentBodyMatrix) || hasDriveInput)) {
activate(Horizontal); activate(Horizontal);
if (myAvatar.getEnableStepResetRotation() && !myAvatar.getIsInSittingState()) { if (myAvatar.getEnableStepResetRotation() && !myAvatar.getIsInSittingState()) {
qCDebug(interfaceapp) << "step recenter rotation true ";
activate(Rotation); activate(Rotation);
myAvatar.setHeadControllerFacingMovingAverage(myAvatar.getHeadControllerFacing()); myAvatar.setHeadControllerFacingMovingAverage(myAvatar.getHeadControllerFacing());
} }
} }
} }
const int VELOCITY_COUNT_THRESHOLD = 60;
if (_velocityCount > 60) { const float MINIMUM_HMD_VELOCITY = 0.1f;
if (_velocityCount > VELOCITY_COUNT_THRESHOLD) {
if (!isActive(Vertical) && (shouldActivateVertical(myAvatar, desiredBodyMatrix, currentBodyMatrix) || hasDriveInput)) { if (!isActive(Vertical) && (shouldActivateVertical(myAvatar, desiredBodyMatrix, currentBodyMatrix) || hasDriveInput)) {
activate(Vertical); activate(Vertical);
} }
} else { } else {
if ((glm::length(myAvatar.getControllerPoseInSensorFrame(controller::Action::HEAD).getVelocity()) > 0.1f)) { if ((glm::length(myAvatar.getControllerPoseInSensorFrame(controller::Action::HEAD).getVelocity()) > MINIMUM_HMD_VELOCITY)) {
_velocityCount++; _velocityCount++;
} }
if (_velocityCount > 60) {
qCDebug(interfaceapp) << "reached velocity count ";
}
} }
} else { } else {
if (!isActive(Rotation) && getForceActivateRotation()) { if (!isActive(Rotation) && getForceActivateRotation()) {
activate(Rotation); activate(Rotation);