Apply suggestions from code review

Tidying (bracing style, spaces, remove final comma from enum, fix JSDoc comment).

Co-authored-by: David Rowe <david@ctrlaltstudio.com>
This commit is contained in:
Phil 2020-12-29 18:25:17 -05:00 committed by GitHub
parent 1e54d41f95
commit 7e5680b2a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 9 deletions

View file

@ -5622,8 +5622,7 @@ void MyAvatar::FollowHelper::decrementTimeRemaining(float dt) {
for (auto& time : _timeRemaining) { for (auto& time : _timeRemaining) {
if (time == CharacterController::FOLLOW_TIME_IMMEDIATE_SNAP) { if (time == CharacterController::FOLLOW_TIME_IMMEDIATE_SNAP) {
time = 0.0f; time = 0.0f;
} } else {
else {
time -= dt; time -= dt;
} }
} }
@ -5638,8 +5637,7 @@ bool MyAvatar::FollowHelper::shouldActivateRotation(const MyAvatar& myAvatar,
if (myAvatar.areHipsTracked()) { if (myAvatar.areHipsTracked()) {
shouldSnapOut = true; shouldSnapOut = true;
return true; return true;
} } else {
else {
shouldSnapOut = false; shouldSnapOut = false;
} }

View file

@ -282,7 +282,7 @@ class MyAvatar : public Avatar {
* <p><strong>Warning:</strong> Setting this value also sets the value of <code>analogPlusSprintSpeed</code> to twice * <p><strong>Warning:</strong> Setting this value also sets the value of <code>analogPlusSprintSpeed</code> to twice
* the value.</p> * the value.</p>
* @property {number} analogPlusSprintSpeed - The sprint (run) speed of your avatar for the "AnalogPlus" control scheme. * @property {number} analogPlusSprintSpeed - The sprint (run) speed of your avatar for the "AnalogPlus" control scheme.
* @property {number} isInSittingState - <code>true</code> if the user wearing the HMD is determined to be sitting; * @property {boolean} isInSittingState - <code>true</code> if the user wearing the HMD is determined to be sitting;
* <code>false</code> if the user wearing the HMD is determined to be standing. This can affect whether the avatar * <code>false</code> if the user wearing the HMD is determined to be standing. This can affect whether the avatar
* is allowed to stand, lean or recenter its footing, depending on user preferences. * is allowed to stand, lean or recenter its footing, depending on user preferences.
* The property value automatically updates as the user sits or stands. Setting the property value overrides the current * The property value automatically updates as the user sits or stands. Setting the property value overrides the current
@ -543,12 +543,11 @@ public:
Q_ENUM(SitStandModelType) Q_ENUM(SitStandModelType)
// Note: The option strings in setupPreferences (PreferencesDialog.cpp) must match this order. // Note: The option strings in setupPreferences (PreferencesDialog.cpp) must match this order.
enum class AllowAvatarStandingPreference : uint enum class AllowAvatarStandingPreference : uint {
{
WhenUserIsStanding, WhenUserIsStanding,
Always, Always,
Count, Count,
Default = Always, Default = Always
}; };
Q_ENUM(AllowAvatarStandingPreference) Q_ENUM(AllowAvatarStandingPreference)
@ -2732,7 +2731,7 @@ private:
// Indicates which parts of the body are under direct control (tracked). // Indicates which parts of the body are under direct control (tracked).
struct { struct {
bool _feet{ false }; // Left or right foot. bool _feet { false }; // Left or right foot.
bool _feetPreviousUpdate{ false };// Value of _feet on the previous update. bool _feetPreviousUpdate{ false };// Value of _feet on the previous update.
bool _hips{ false }; bool _hips{ false };
bool _leftHand{ false }; bool _leftHand{ false };