Commit graph

46 commits

Author SHA1 Message Date
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
Oren Hurvitz
35082a730e Changed the desktop sprint speed to 2.0.
This change will not actually be felt by users, because the speed was already effectively 2.0
(because the sprint speeds for Desktop and HMD were reversed).
2019-10-27 09:35:16 +02:00
Anthony J. Thibault
2f949a4d4d Disable head ik while reacting
Also, split getReactions() API into two calls

* getTriggerReactions() - lists all reactions that can be triggered with MyAvatar.triggerReaction().
* getBeginReactions() - lists all reactions that can be used with MyAvatar.beginReaction() and MyAvatar.endReaction().
2019-07-26 15:26:43 -07:00
Anthony Thibault
ecae92724e Added reaction api 2019-07-17 14:28:39 -07:00
Shannon Romano
50f39e88d6
Merge pull request #15365 from hyperlogic/bug-fix/better-camera-in-head-check
Better head vs camera checks for avatar head cauterization
2019-04-16 15:07:46 -07:00
r3tk0n
d0abb86366 Reversed costants because no sleep. >_< 2019-04-15 17:26:22 -07:00
r3tk0n
12d7e35722 Add separate constant for desktop run. HMD run affected negatively by 3x multiplier. This will need to be cleaned up in a future release. 2019-04-15 10:56:07 -07:00
r3tk0n
87deb348a8 Adjust run speed constants. 2019-04-12 14:07:06 -07:00
Anthony J. Thibault
02d5769991 Better head vs camera checks for avatar head cauterization
* cameraInsideHead() check now uses detailed avatar collision when possible.
* head is now more constantly hidden in first person camera mode
* getEyeModelPositions() uses a better estimate when avatar eye joints are missing.
* moved findPointKDopDisplacement from Rig.cpp into AnimUtil.cpp
* added isPlayingOverrideAnimation() method to Rig class
2019-04-09 12:57:03 -07:00
r3tk0n
ac2971894b Fix sprint mode scalar. 2019-04-03 11:42:40 -07:00
r3tk0n
7a8dfe0aaf Fix run speeds. 2019-03-21 15:06:21 -07:00
r3tk0n
cbd841a14d Update gearing system. 2019-03-11 16:22:48 -07:00
r3tk0n
5d3a778b0b Merge branch 'master' of https://github.com/highfidelity/hifi into project-freeloco-fargrab-rotation 2019-02-25 13:10:47 -08:00
amantley
de10aebbb5 removed white space 2019-02-21 11:44:18 -08:00
amantley
64ec28ef44 added back missing unity meta files 2019-02-21 11:37:14 -08:00
r3tk0n
ebbf48a11b Merge branch 'master' of https://github.com/highfidelity/hifi into project-freeloco 2019-02-19 12:02:50 -08:00
amantley
f68ee4e7ce merged with master 2019-01-31 09:56:46 -08:00
r3tk0n
7e9d35a0fb Add individual speed settings per control mode. 2019-01-30 15:06:35 -08:00
amantley
2e1a4545c6 cache the spine2 spline default offset and ratio 2019-01-30 14:47:03 -08:00
Anthony Thibault
5d606981de Added HMD Avatar Alignment Type
Adds a new API to set this type, and an option to the Avatar App.

* "eye" - Match the user eyes with the avatar eyes. The previous default behavior.
  If the avatar skull is larger then the user, it can cause the avatars body to lift off of the ground when the user looks down.
* "head" - Match the user head with the avatar head.  The new default behavior.
  This prevents the body from lifting off of the ground while wearing a large headed avatar.  But can cause an offset between the users eyes and the avatars eyes.
2019-01-08 18:35:28 -08: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
amantley
90a51e6181 added walk velocity threshold, this determines if we are in the walk state. when we are then we don't do cg leaning calculation. this will smooth out the walking in a large tracked area 2018-09-06 13:12:48 -07:00
amantley
73e628bb8d merge with master fixes 2018-09-05 14:42:49 -07:00
Anthony Thibault
3a034fdf66 HMD mode bug fix for avatars with no eyes
Previously getCenterEyeCalibrationMat() would return the average eye position for an avatar, if the eyes are missing.
Now we fall back to using the HeadCalibrationMat() and adding an offset from the head to the center of the eyes.
This is more accurate for characters that don't quite have human proportions.
2018-09-04 10:13:57 -07:00
amantley
055f03878e made changes to add roll to the spine2 rotation. also only the shoulders control the rotation recenter now 2018-08-27 14:44:27 -07:00
amantley
1e3ca6f902 added quicker follow code and added head to rotate calculation 2018-08-22 12:57:06 -07:00
amantley
1fabc77244 latest update to stop lurching, and allow leaning, and stop perma leans 2018-08-21 12:34:05 -07:00
amantley
1e2ca579c7 widened base of support and put head angular and hand angular back to normal 2018-08-20 18:06:34 -07:00
amantley
2dcdd60750 added new AvatarConstants and more frequent horizontal recentering to deal with lurching walk in large tracked volumes 2018-08-20 17:32:52 -07:00
amantley
471bb28545 Merge remote-tracking branch 'upstream/master' into steppingReboot 2018-08-20 09:50:45 -07:00
amantley
c2612af7a8 changed the spine stretch limit, will check the scale implications next 2018-08-10 17:10:33 -07:00
amantley
74186b0162 changed back speed to 2.2 m/s and the end frame for strafe left and right to 33, and the end frame for wlk_bkwd to 27 2018-08-10 09:56:24 -07:00
amantley
c8a31bc59f created a backward walk speed constant 1.6m/s and changed the characteristic speed for strafe right left to 1.3 2018-08-09 17:38:57 -07:00
amantley
85b7a9b67c added the changes committed to the hot fix rc70.1 in AvatarConstants.h 2018-07-25 11:31:02 -07:00
amantley
a2f8e024fb added avatar constants changed for posterior and head velocity 2018-07-09 13:59:56 -07:00
amantley
096d0d2827 reorganized the step detection code, creating a shouldActivateHorizontalCG that calls all the step detection conditionals. The average rotation and the mode are now calculated in MyAvatar::update 2018-07-02 15:43:57 -07:00
Andrew Meadows
085130e3c9 avatars collide again again 2018-06-18 13:17:32 -07:00
Anthony J. Thibault
c3da4e74de Code review feedback 2018-06-08 16:22:00 -07:00
amantley
8000bcd272 cleaned up cg code ie computeNewHipsRotation 2018-05-08 18:12:53 -07:00
amantley
3a10cacec0 1.added the swing twist code to update the follow rotation in MyAvatar.cpp
2.added step.js and cg_lean.js to the developer folder
3.added menu item for toggling the hips following between head and hips
4.added new function to return true if the root of MyAvatar is translating
to be under the head.  Used to smooth the path of the hips
5.added computeCounterBalance to MyAvatar.h and cpp
6.added the menu item under developer/avatar to enable debug draw of the base of support in menu.h menu.cpp MyAvatar.h MyAvatar.cpp
7.added head yaw into the calculation of the hip rotation for the center
of gravity.  This is already was happening in the deriveBodyFromHMD code
that is default
8.Changed Constants in Avatar constants for the base of support
9.fixed the over rotation of the shoulders
10.fixed scaling problem in cg computation
11.added room for going up on the toes without stretching
2018-05-07 17:41:35 -07:00
Dante Ruiz
4d52caccde making some more requested changes 2018-03-22 17:39:22 -07:00
Anthony J. Thibault
9f54ce55f3 Change domain setting from min/max avatar scale to min/max avatar height
* Domain settings version has been bumped from version 2.0 to 2.1
* Old domain settings for avatar scale will be auto-converted to avatar height
* Avatar code has been changed so that limitDomainScale() works with the new height limits
* Avatar getUnscaledEyeHeight() was added to C++.
* MyAvatar.getHeight() was added to JS.
2017-11-21 13:25:47 -08:00
Anthony J. Thibault
4f830cf1dc Calculate jump speed based on canonical jump height. 2017-08-25 15:34:51 -07:00
Anthony J. Thibault
e0ff7f5f40 Moved speed constants into AvatarConstants.h 2017-08-25 10:47:54 -07:00
Anthony J. Thibault
963ddce7bc Use eye-height to match user and avatar scales, follow fixes
Fix postPhysicsUpdate to properly transform follow displacement into sensor frame.
2017-08-21 17:42:24 -07:00
Anthony J. Thibault
d196743986 Added Avatar::getHeight() method 2017-08-21 17:42:22 -07:00