This is enabled with the VIRCADIA_THREAD_DEBUGGING environment variable.
It's incompatible with VIRCADIA_MEMORY_DEBUGGING, so only one of those
can be enabled for a build.
fixes https://github.com/vircadia/vircadia/issues/1015
also:
* new mirror and controls poster model.
* moved controls poster so it would not be obscured by the wizzard.
* updated landing point.
* ambient music volume raised a bit, we may want to have a in-worrld toggle for this later https://github.com/vircadia/vircadia/issues/1016.
* turned the zone light up a bit so it is not so dark when on low graphic settings.
* Removed the deprecated MyAvatar.setToggleHips script function and the "Toggle Hips Following" option from the Developer menu. They had no effect on any code.
* In CharacterController::applyMotor, prevented unnecessary calls to btVector3::rotate() when the motor has no rotation. This change also improves readability through the use of clearly-named lambdas.
* In AvatarData::getFauxJointIndex, prevented unnecessary string comparisons when the named joint is a real joint rather than a faux one.
* In Avatar::getJointIndex, removed an unnecessary call to QHash<QString, int>::contains(), by supplying a default index for QHash<QString, int>::value().
* Removed unnecessary condition "forwardLeanAmount < 0" in MyAvatar::FollowHelper::shouldActivateHorizontal_userSitting.
* Corrected the return type of MyAvatar::getSitStandStateChange from float to bool.
* Added a missing 'f' suffix to a float literal in PreferencesDialog.cpp.
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).
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).
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;
Fix for MyAvatar sometimes hovering off the ground after foot tracking was enabled. MyAvatar's body is now recentered when foot-tracking starts or ends (in MyAvatar::update).
Repro:
- Start without foot tracking, 'Allow my avatar to stand: Always'.
- Crouch, and wait a few seconds for the avatar to pop back to the standing position.
- Slowly stand straight so that the avatar raises off the ground without recentering (PS: is this a bug?). If it recenters, retry from previous step.
- Calibrate foot tracking. Previously the avatar would remain hovering off the ground until MyAvatar::centerBody was called.
Fix for MyAvatar popping to a standing position if the left foot lost tracking. The recentering now takes into account if either of the feet are tracked.
Repro:
- Enable foot tracking (and ideally hips tracking).
- Sit on the floor.
- Cover the left foot sensor so it loses tracking. Previously the avatar and viewpoint would pop to a standing position.
Optimisation: MyAvatar::update now stores bools indicating which body parts are tracked (_isBodyPartTracked). This avoid unnecessary computations that came from using getControllerPoseInAvatarFrame to convert controller::Pose from sensor space to world space and then to avatar space, only to check if the pose was valid.
Previously, if the avatar scale wasn't 1, the body and viewpoint would given the wrong vertical position in some situations, eg: getting up from click-to-sit; changing the 'Allow my avatar to stand' setting.
The avatar scale was being taken into account where it shouldn't have in MyAvatar::deriveBodyFromHMDSensor.
The bug started in 8b839fe71b ("VR fixes for different user heights and avatar scales".
Repro:
1. Set 'Allow my avatar to stand: Always'
2. Reduce the avatar scale to the minumum.
3. Set 'Allow my avatar to stand: When I stand'
4. Previously, the viewpoint would suddenly be below the floor.
(https://github.com/vircadia/vircadia/issues/117)
- In SpinBoxPreference.qml, SpinBox was missing "realStepSize: preference.step".
- Had to change FloatPreference::step from float to double, because there is some truncation happening somewhere. For example, a step of 0.01f was acting like 0.00 because (0.01f < 0.01).
- Changed FloatPreference::decimals (number of decimal places) from float to uint, because it seemed to make more sense.
- Changed the 'User real-world height' spinbox to use a resolution of 1cm (for display and step) rather than 1mm.
- Remaining bug: the up & down buttons of the spinbox fail to change the value, at some values, though the mouse wheel always works. Repro:
Settings > Controls > User real-world height
Hover the mouse over the box and and scroll the mouse wheel down until the value is at 1.15.
Click the up button a few times and observe that the number can't be increased.
Scroll the mouse wheel forward and observe that the number increases correctly.
- Todo: Change all calls to FloatPreference::setStep to pass doubles, if this change to its parameter type is kept.
- The user's real-world height is now taken into account in MyAvatar::deriveBodyFromHMDSensor. Therefore, for any user height, the floor stays correctly positioned in all modes of 'Allow my avatar to stand'.
- Whenever the user's real-world height is changed, centerBodyInternal is now called to position the body accordingly. The floor therefore stays correctly positioned in all modes of 'Allow my avatar to stand'. (MyAvatar::setUserHeight)
- Fix for walk speeds in VR being too fast at large avatar scale and too slow at small avatar scale. The action motor velocity was being scaled once too many by the sensor-to-world scale. The bug existed before this branch. (MyAvatar::scaleMotorSpeed)
Moved the body of the function to a private internal method (centerBodyInternal), which takes the parameter instead.
Previously, when leaving 'away' state, the 'Away' overlay would stay on screen because of the bug.
The bug started in "VR fixes for: couldn't sit on the floor, wrong walk directions." (2179c153de).
- Divided the option "Avatar leaning behavior" into two options that work more usefully: "Allow my avatar to stand" and "Allow my avatar to lean" (PreferencesDialog.cpp). Made the necessary fixes so that the avatar can be set to stand only when the user is standing (more details below).
- The logic controlling the direction of MyAvatar's action motor is now centralised in calculateScaledDirection (was previously split between there and updateMotors). calculateScaledDirection now returns a velocity in world space.
- CharacterController::FollowHelper now uses separate follow timers for rotation, horizontal and vertical (previously followed all three based on the longest of their follow times). Where appropriate, FollowHelper can now snap immediately to the desired rotation/horizontal/vertical independently (see FOLLOW_TIME_IMMEDIATE_SNAP).
- FollowHelper::FollowType has therefore moved to CharacterController::FollowType.
- MyAvatar::FollowHelper::postPhysicsUpdate: If MyAvatar is not allowed to stand when the user is sitting, this now avoids recentring the body based on the head height.
- Removed Q_PROPERTY(MyAvatar::SitStandModelType, as the sitting/standing/leaning model uses different enums now (see setAllowAvatarStandingPreference, setAllowAvatarLeaningPreference).
- Removed Q_PROPERTY(bool isSitStandStateLocked which is no longer used, because we now always track the user's real-world sit/stand state, regardless of what we're doing with it.
- MyAvatar::FollowHelper::shouldActivateHorizontal: If MyAvatar is not allowed to lean, this now returns true to recentre the footing if the head is outside the base of support.
- MyAvatar::FollowHelper::shouldActivateHorizontalCG: If MyAvatar is not allowed to lean, this now always returns true to recentre the footing. Rearranged to avoid computing values that weren't used depending on the conditions. Resolved some duplicated code.
- MyAvatar::setUserRecenterModel previously set HMDLeanRecenterEnabled based on the chosen mode, but it got reset when getting out of a sit. Now HMDLeanRecenterEnabled is only controlled by the scripts.
- Added Rig::getUnscaledHipsHeight (like getUnscaledEyeHeight). Refactored a little to avoid duplicated code. Added DEFAULT_AVATAR_HIPS_HEIGHT which is the value that Rig::getUnscaledHipsHeight returns when using the default avatar.
- Fix for recentring not behaving as requested by the user after getting up from click-to-sit (always behaving like 'Auto') : MyAvatar::endSit now passes false to centerBody for 'forceFollowYPos'.
- Fix for incorrect vertical position of the avatar and viewpoint after changing lean recentre mode while not standing in the real world: MyAvatar::setAllowAvatarStandingPreference now calls centerBody with false for 'forceFollowYPos'.
- computeHipsInSensorFrame: The code now matches the comments in that it only skips the dampening of the hips rotation if the centre-of-gravity model is being used.
GLVND appears to break the entire UI on ATI video cards.
It was set to GLVND due to an understanding that this was a no-op setting, but it turns
out the documentation in OpenGL_GL_PREFERENCE is confusing, and it looks like LEGACY
is the setting that was being used after all.
An additional point of interest is that debian/rules contained OpenGL_GL_PREFERENCE=GLVND,
and this was done back in the High Fidelity days. It's uncertain whether this was correct
or not, though.
This should be a no-op, besides generating less build warnings,
since:
"CMake 3.11 and above prefer to choose GLVND libraries."
And 3.11 is a few years old at this point
New fonts for pictograms
since "hifi-glyphs.ttf" has no more room for new icons.
This contains icons for copy, cut, paste, duplicate, undo, redo... and a V logo.
Trouble with:
> Script.getExternalPath(Script.ExternalPaths.Assets, "hi")
[UncaughtException evaluate] Error: cannot call getExternalPath(): argument 1 has unknown type `ExternalResource::Bucket' (register the type with qScriptRegisterMetaType()) in about:console:1 [Backtrace] <global>() at about:console:1
TypeError: cannot call getExternalPath(): argument 1 has unknown type `ExternalResource::Bucket' (register the type with qScriptRegisterMetaType())