Commit graph

211 commits

Author SHA1 Message Date
Edgar
e27696802b
🐛 Fixed avatar bounding box being inverted 2024-03-12 22:12:03 +01:00
825c398e54 Changed gravity constant 2023-11-19 17:39:10 +01:00
74c5b6038f Lower inertia for more precise controls 2023-08-02 22:00:12 +02:00
8b973bdfa3 Remove executable permission from a bunch of files 2023-03-14 00:02:33 +01:00
Phil Palmer
72725e783a Small optimisations and tidying of things that were noticed in passing. No behaviour should change.
* 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.
2021-02-19 21:55:08 -05:00
Phil Palmer
8c7c91ed6f Remove const from variable declarations as suggested in the review.
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;
2020-12-29 19:31:35 -05:00
Phil Palmer
3e25e32f18 Revert temporary "added pragmas" (optimize off)
This reverts commit 20e4f952ab.
2020-12-27 02:52:52 -05:00
Phil Palmer
c9cf7eb75d Merge branch 'fix/vr-recenter-PRAGMAS' into fix/vr-recenter 2020-12-26 23:22:16 -05:00
Phil Palmer
20e4f952ab added pragmas 2020-12-26 23:19:21 -05:00
Phil Palmer
a489e9ddca Code style: made some little things more conformant with the coding standards and the rest of the codebase.
https://github.com/vircadia/vircadia/blob/master/CODING_STANDARD.md
2020-12-23 19:00:05 -05:00
Phil Palmer
6fc40385ca Fix compile error building macOS-latest: changed MINIMUM_TIME_REMAINING from const to constexpr in CharacterController::playerStep.
Error was: "static_assert expression is not an integral constant expression", "read of non-constexpr variable 'MINIMUM_TIME_REMAINING' is not allowed in a constant expression".
Error started in last commit (2179c153de).
2020-12-22 15:51:03 -05:00
Phil Palmer
2179c153de VR fixes for: couldn't sit on the floor, wrong walk directions.
- 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.
2020-12-22 14:22:27 -05:00
HifiExperiments
cbce911e83 fix lag on restart with scaled avatar 2020-07-17 14:40:40 -07:00
Andrew Meadows
b7ae55ca3e smaller CCD proxy for MyAvatar 2019-08-28 11:33:51 -07:00
Andrew Meadows
1beafbdd35 comment cleanup and final tuning 2019-08-28 09:48:15 -07:00
Andrew Meadows
6be3750b38 use collision brake feedback to prevent tunneling 2019-08-27 20:28:56 -07:00
Andrew Meadows
1314430f04 more checks to prevent thrusting through mesh 2019-08-27 13:51:54 -07:00
Sabrina Shanman
0f5ef9ecb3
Merge pull request #16097 from AndrewMeadows/less-MyAvatar-mesh-tunelling
BUGZ-1325: prevent MyAvatar from tunneling through mesh at high speeds
2019-08-26 16:16:10 -07:00
Andrew Meadows
8135021b25 watch for tunneling events and interfere before stuck 2019-08-23 17:54:52 -07:00
Clement
a607984d4e Fix debug builds 2019-08-23 17:04:54 -07:00
Andrew Meadows
7084908df3 add isStuck logging, add assert because singleton 2019-08-20 17:33:29 -07:00
Andrew Meadows
434af8bdfb remove support for sub-contactAddecCallbacks from PhysicsEngine 2019-08-20 17:33:29 -07:00
Andrew Meadows
dba7cadcae remove cruft 2019-08-20 17:33:29 -07:00
Andrew Meadows
113d132d8e use pairwise collision filtering to help unstuck MyAvatar 2019-08-20 17:33:29 -07:00
Andrew Meadows
7cf0899d59 more correct safeLanding trigger 2019-08-20 17:33:29 -07:00
Andrew Meadows
32400a6baf improved isStuck detection and MyAvatar::safeLanding() trigger 2019-08-20 17:33:29 -07:00
luiscuenca
6e4d1bde8e
Fix code and warnings 2019-07-24 13:16:53 -07:00
luiscuenca
9cec979552
Add sit API to MyAvatar 2019-07-23 14:20:54 -07:00
Saracen
3dde53f743 Friendlier and more understandable naming. 2019-04-11 03:57:34 +01:00
Saracen
eb8e912808 Added missing checks to ground and takeoff state. 2019-04-11 03:29:58 +01:00
Saracen
bce80130bd Allow players to disable automatic falling to flight threshold. 2019-04-09 21:07:17 +01:00
luiscuenca
a7c36c9505 Merge branch 'master' into kdopsRotOffsetFix 2019-03-29 10:29:30 -07:00
luiscuenca
79b7a3d28d Apply kdop computation after reading the joint rotation offsets 2019-03-04 13:15:15 -07:00
SamGondelman
e102ad073e allow flying in HMD if you would otherwise fall forever 2019-02-25 11:49:38 -08:00
Jeff Clinton
54109deab9
Merge pull request #14825 from SamGondelman/fall
Case 20829: Always fall when flying is not allowed
2019-02-07 14:39:46 -08:00
Shannon Romano
6fd480e51d
Merge pull request #14795 from AndrewMeadows/myAvatar-vs-backfacing-triangles-2
case 17773: reduce likelihood MyAvatar will get stuck in mesh geometry when flying around
2019-02-06 15:52:31 -08:00
SamGondelman
5553752d81 fall when flying not allowed 2019-01-30 18:04:44 -08:00
Andrew Meadows
e372cb668a enable CCD for MyAvatar's RigidBody 2019-01-29 11:11:54 -08:00
luiscuenca
f54f9e5bfd Merge branch 'master' into multiSphereAvatar04 2019-01-25 13:54:01 -07:00
raveenajain
3f2aa56187 feedback changes 2019-01-21 13:24:07 -08:00
raveenajain
d2e37d0c90 my and other avater changes, if setting toggled can pass through other avatar 2019-01-18 16:50:44 -08:00
luiscuenca
19701ef333 Fix scale and add rayTest 2019-01-11 15:36:07 -07:00
Anthony Thibault
ef74014075 Small avatars now have a minimum jump height of 0.25 meters
This should improve the quality of the jump animation and improve the mobility of small avatars.
2018-10-19 13:55:56 -07:00
unknown
4313a34ff3 Allow avatar to fly when its scale is very small 2018-10-08 15:35:07 -07:00
Andrew Meadows
49a1d0a18a MyAvatar RigidBody ignores backfacing triangles 2018-08-08 09:11:09 -07:00
luiscuenca
45f8ed010c formatting 2018-07-12 16:03:15 -07:00
luiscuenca
1ab6c7a8ac Proper fix 2018-07-12 14:00:55 -07:00
luiscuenca
ced4e1e0e0 Fix blue screen after player step returns NaN values 2018-07-11 18:02:19 -07:00
John Conklin II
1bd698a5dc
Merge pull request #13558 from danteruiz/fix-falling-through-floor
Fix falling through floor
2018-07-06 13:44:08 -07:00
Dante Ruiz
fdf58ab2b5 fixing edge case 2018-07-06 11:09:59 -07:00