This helps with log flooding. Successive repeated log messages will be skipped and counted,
the count will be output when a different message is logged.
A new option of 'keep_repeats' has been added to VIRCADIA_LOG_OPTIONS to disable this.
Fix z-write being enabled for transparencies in GeometryCache::getSimplePipeline and Procedural::Procedural (fixes https://github.com/vircadia/vircadia/issues/224).
Z-write is controlled by the 'writeMask' parameter of gpu::State::setDepthTest.
Individually tested each of these scale fixes in third-person view.
Simplify withinBaseOfSupport.
Change input parameter from float& to float (isWithinThresholdHeightMode).
Debug: remove unnecessary Y offset that didn't scale properly with the avatar (drawBaseOfSupport).
Engine code no longer controls MyAvatar.centerOfGravityModelEnabled. Maybe we should deprecate it now, since its reason to exist seemed to be only to disable the CG model while the user was sitting, which is now done more explicitly (see below).
MyAvatar::FollowHelper:
- rename shouldActivateHorizontal to shouldActivateHorizontal_userSitting, now private.
- rename shouldActivateHorizontalCG to shouldActivateHorizontal_userStanding, now private.
- add new shouldActivateHorizontal that calls one of the above based on the user's sit/stand state.
- these functions no longer modify their 'myAvatar' parameter.
Add USER_CAN_TURN_BODY_WHILE_SITTING (false), which retains the old rotation behaviour of lean recentering:
a lean recenter doesn't rotate the body if the user is sitting (new: unless the feet are tracked).
In other words, the lean recentering assumes the user isn't on a swivel chair and keeps the avatar pointing in the same direction. It might be good to expose that as an option. (Regardless, rotation recentering does kick-in if they turn too far).
Engine code no longer controls MyAvatar.centerOfGravityModelEnabled. Maybe we should deprecate it now, since its reason to exist seemed to be only to disable the CG model while the user was sitting, which is now done more explicitly (see below).
MyAvatar::FollowHelper:
- rename shouldActivateHorizontal to shouldActivateHorizontal_userSitting, now private.
- rename shouldActivateHorizontalCG to shouldActivateHorizontal_userStanding, now private.
- add new shouldActivateHorizontal that calls one of the above based on the user's sit/stand state.
- these functions no longer modify their 'myAvatar' parameter.
Add USER_CAN_TURN_BODY_WHILE_SITTING (false), which retains the old rotation behaviour of lean recentering:
a lean recenter doesn't rotate the body if the user is sitting (new: unless the feet are tracked).
In other words, the lean recentering assumes the user isn't on a swivel chair and keeps the avatar pointing in the same direction. It might be good to expose that as an option. (Regardless, rotation recentering does kick-in if they turn too far).
computeHipsInSensorFrame was accidentally setting useCenterOfGravityModel to false if !getHMDCrouchRecenterEnabled. Now it sets it to true if !getHMDCrouchRecenterEnabled. So if artificial standing is disabled, it uses center-of-gravity regardless of the user's sit/stand state.
The "squat" recenter pre-dates the sit/stand detection, but the current version basically came from ad6bbc7ff6 in 2018. I'm removing it because it doesn't seem useful anymore (with or without the other changes in this branch).
What it did (on the current master) :
- If "Avatar leaning behavior" was "Auto"
- and the user was standing
- but their head was more than 5cm below standing height
- and their chest was upright
- for 30 seconds
- do a vertical recenter so that the avatar stands straight (instead of having knees bent).
When the user stood up straight after that recenter, the avatar would hover off the ground until the next recenter (eg. walking).
The "squat" recenter pre-dates the sit/stand detection, but the current version basically came from ad6bbc7ff6 in 2018. I'm removing it because it doesn't seem useful anymore (with or without the other changes in this branch).
What it did (on the current master) :
- If "Avatar leaning behavior" was "Auto"
- and the user was standing
- but their head was more than 5cm below standing height
- and their chest was upright
- for 30 seconds
- do a vertical recenter so that the avatar stands straight (instead of having knees bent).
When the user stood up straight after that recenter, the avatar would hover off the ground until the next recenter (eg. walking).
As suggested in the review here: https://github.com/vircadia/vircadia/pull/928/files#r549821976
Re-added and deprecated MyAvatar.userRecenterModel. Retained the functionality of setUserRecenterModel, and approximated that of getUserRecenterModel (some stand+lean preference pairs had no equivalent before).
Re-added and deprecated MyAvatar.isSitStandStateLocked. Approximated the functionality of getIsSitStandStateLocked.
Didn't retain that of setIsSitStandStateLocked, because it wouldn't be useful on its own; someone using it would probably want setUserRecenterModel instead (or new functions to set the standing and leaning preferences).
isSitStandStateLocked's reason to exist was that we could stop keeping track of the user's real-world sit/stand state (in updateSitStandState), and instead pretend the user was always standing (for SitStandModelType::ForceStand) or always sitting (for SitStandModelType::ForceSit).
That determined whether the avatar was allowed to lean (wouldn't lean if the user was sitting or in ForceSit).
Now though, the user explicitly chooses when the avatar may lean: never / just when the user is standing / even when the user is sitting.
These API features were removed in 2179c153de ("VR fixes for: couldn't sit on the floor, wrong walk directions").
Suggested here: https://github.com/vircadia/vircadia/pull/928/files#r549830690
The ones I've left are either
- values known at compile time, eg. const float MIN_LENGTH_FOR_NORMALIZE = 0.061f;
- consts that were already there in the previous code, eg. const float MAX_DISPLACEMENT = 0.5f * _radius;