Commit graph

5527 commits

Author SHA1 Message Date
Phil
7e5680b2a6
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>
2020-12-29 18:25:17 -05:00
Phil Palmer
1e54d41f95 Remove static variable from MyAvatar::update (made it a member). 2020-12-28 05:37:06 -05:00
Phil Palmer
2be87fe7dc Fix VR recentering cases that gave incorrect vertical position.
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.
2020-12-27 22:13:09 -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
dec9e9d338 VR fix for different avatar scales.
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.
2020-12-27 02:50:29 -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
8b839fe71b VR fixes for different user heights and avatar scales.
- 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)
2020-12-23 07:54:59 -05:00
Phil Palmer
287f710ea1 Fix MyAvatar::centerBody breaking existing scripts (eg. away.js) by having a new parameter:
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).
2020-12-22 19:32:43 -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
kasenvr
87d4fddb40
Merge branch 'master' into feature/transparent-web-entities 2020-09-26 01:25:02 -04:00
kasenvr
faadb9e340
Merge pull request #668 from kasenvr/fix/URL-migrations
New Metaverse PR
2020-09-26 01:21:17 -04:00
Kalila L
0d08254a07 Some updates to URLs in C++ 2020-09-20 23:37:29 -04:00
Kalila L
58c1518d0b Updating some .cpp and .h URLs. 2020-08-31 01:00:05 -04:00
Dale Glass
a8ab9307d0 Add fall-through comments to fix GCC warnings
Unfortunately the attribute can't be used since we're not on C++17 yet.
2020-08-27 19:27:11 +02:00
Kalila L
26d4eb8e67 Updates per CR.
Co-Authored-By: David Rowe <david@ctrlaltstudio.com>
2020-08-24 18:43:03 -04:00
Kasen IO
ca97450464 Centralizing some more networking constants. 2020-08-17 02:44:26 -04:00
kasenvr
180b7f1bd3
Merge pull request #547 from HifiExperiments/scaled
Fix lag on restart with scaled avatar
2020-07-30 17:15:50 -04:00
HifiExperiments
cbce911e83 fix lag on restart with scaled avatar 2020-07-17 14:40:40 -07:00
Kasen IO
3ccaa46563 Update API docs URLs. 2020-07-08 14:18:32 -04:00
motofckr9k
3d05cdd61e Merge remote-tracking branch 'refs/remotes/kasen/master'
Conflicts:
	BUILD_WIN.md
	CODING_STANDARD.md
	LICENSE
	cmake/installer/installer-header.bmp
	cmake/installer/installer.ico
	cmake/installer/uninstaller-header.bmp
	interface/resources/images/about-vircadia.png
	interface/resources/images/vircadia-logo.svg
	interface/resources/qml/LoginDialog.qml
	interface/resources/qml/dialogs/TabletLoginDialog.qml
	interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml
	interface/src/Application.cpp
	pkg-scripts/athena-server.spec
	scripts/system/more/app-more.js
	scripts/system/more/css/styles.css
	scripts/system/more/more.html
2020-06-10 02:49:13 +02:00
kasenvr
103fd8eef2
Merge branch 'master' into fix/revert-instancing-temporarily-1 2020-06-03 22:44:32 -04:00
kasenvr
d69c89583f
Merge pull request #394 from ctrlaltdavid/feature/enable-vr-flying
Enable flying in VR by default
2020-06-03 22:40:05 -04:00
Kasen IO
21fd10d154 Revert commit 359248829c using -m 1 to temporarily fix issue 383. 2020-06-03 16:08:18 -04:00
kasenvr
4cca7f6f75
Merge pull request #281 from HifiExperiments/parenting2
Improve performance of MyAvatar::simulate when you have lots of descendants
2020-05-31 14:47:22 -04:00
David Rowe
d451012d08 Enable flying in VR by default 2020-05-28 09:12:17 +12:00
motofckr9k
d406b81b47 Big rebrand 2020-05-22 20:35:27 +02:00
kasenvr
7996698c8f
Merge branch 'master' into fix/other-renamings 2020-05-18 15:10:32 -04:00
David Rowe
5e997d7b60 Fix up Vircadia URLs 2020-04-27 20:38:23 +12:00
David Rowe
2d070e630b Merge branch 'master' into fix/jsdoc-fixes
# Conflicts:
#	interface/resources/qml/hifi/avatarapp/MessageBoxes.qml
#	interface/resources/qml/hifi/commerce/checkout/Checkout.qml
#	interface/resources/qml/hifi/commerce/purchases/Purchases.qml
#	interface/src/Application.cpp
2020-04-26 20:38:43 +12:00
David Rowe
ffeb37e7aa Merge remote-tracking branch 'hifi/master' into merge-hifi-master
# Conflicts:
#	CMakeLists.txt
#	README.md
#	cmake/externals/glad32es/CMakeLists.txt
#	cmake/externals/glad41/CMakeLists.txt
#	cmake/externals/glad45/CMakeLists.txt
#	cmake/externals/polyvox/CMakeLists.txt
#	cmake/externals/quazip/CMakeLists.txt
#	cmake/externals/vhacd/CMakeLists.txt
#	cmake/init.cmake
#	cmake/ports/hifi-deps/CONTROL
#	cmake/ports/sdl2/CONTROL
#	cmake/ports/sdl2/disable-hidapi-for-uwp.patch
#	cmake/ports/sdl2/enable-winrt-cmake.patch
#	cmake/ports/sdl2/fix-arm64-headers.patch
#	cmake/ports/sdl2/fix-x86-windows.patch
#	cmake/ports/sdl2/portfile.cmake
#	cmake/ports/sdl2/vcpkg-cmake-wrapper.cmake
#	cmake/ports/tbb/portfile.cmake
#	hifi_vcpkg.py
#	interface/src/avatar/MyAvatar.h
#	libraries/avatars-renderer/src/avatars-renderer/Avatar.h
#	libraries/avatars/src/AvatarData.h
#	libraries/entities-renderer/src/RenderableEntityItem.h
#	libraries/entities/src/EntityItem.cpp
#	libraries/entities/src/EntityItem.h
#	libraries/fbx/src/GLTFSerializer.cpp
#	libraries/graphics-scripting/src/graphics-scripting/Forward.h
#	libraries/networking/src/AddressManager.cpp
#	libraries/networking/src/DomainHandler.h
#	libraries/procedural/src/procedural/ProceduralMaterialCache.cpp
#	libraries/render-utils/src/HighlightEffect.cpp
#	libraries/render-utils/src/MeshPartPayload.cpp
#	libraries/render-utils/src/Model.cpp
#	libraries/render-utils/src/RenderShadowTask.cpp
#	libraries/script-engine/src/WebSocketClass.cpp
2020-04-09 16:46:27 +12:00
HifiExperiments
9b1635f9cc improve performance of MyAvatar::simulate when you have lots of entity descendants 2020-04-07 15:56:32 -07:00
Kasen IO
115c40bd54 Lots of renamings, more to come. 2020-04-07 04:56:02 -04:00
David Rowe
7ed117dfcb Replace links to docs.highfidelity.com 2020-01-24 10:18:55 +13:00
David Rowe
0666c3bbb1 Document that MyAvatar goto methods have safe landing 2020-01-20 21:31:50 +13:00
David Rowe
b816d7053a Update models used in JSDoc examples 2020-01-20 21:07:33 +13:00
David Rowe
eae3336f57 Fix up docs links 2020-01-20 15:06:32 +13:00
David Rowe
1a4266a64a Review JSDoc updates from recent commits 2020-01-20 14:33:06 +13:00
David Rowe
d79c87b2d4 Change Avatar Package docs links 2020-01-05 16:59:51 +13:00
David Rowe
934311b54a Change default Avatar Packager project directory 2020-01-05 16:15:04 +13:00
David Rowe
7364ac5521 Fix scaled avatar walk speed 2020-01-04 11:43:28 +13:00
David Rowe
00bd81b8c3 using MyAvatar.getTargetAvatar or AvatarList.getAvatar. 2019-12-24 09:52:19 +13:00
David Rowe
a04e57d82d Miscellaneous JSDoc fixes noticed in passing 2019-12-19 11:38:17 +13:00
David Rowe
ccc4be5312 Revise extended avatar blend shapes JSDoc 2019-12-18 12:54:56 +13:00
David Rowe
9d67b4aff2 Fix up MyAvatar JSDoc on sitting property and methods 2019-12-18 10:02:03 +13:00
David Rowe
427aa851b3 Fix up links to avatar standards guide 2019-12-18 09:51:34 +13:00
David Rowe
13a8ede1ac Fix up MyAvatar reaction methods' JSDoc 2019-12-18 09:19:26 +13:00
David Rowe
28f5046ab2 Fix MyAvatar.gotoLocation()'s "withSafeLanding" parameter JSDoc 2019-12-18 08:31:57 +13:00
David Rowe
34958ddb71 Address some JSDoc issues identified by makitsune 2019-12-18 08:01:20 +13:00
Brad Hefta-Gaub
2d56d7c026
Merge pull request #16551 from ctrlaltdavid/DEV-1943
DEV-1943: Make MyAvatar.getAvatarEntityData() return all properties
2019-12-13 10:53:24 -08:00
David Rowe
afdbbb95b1 DriveKey type and update MyAvatar JSDoc 2019-12-06 21:27:34 +13:00
David Rowe
3eadec3eaa DriveKeys JSDoc 2019-12-06 21:26:59 +13:00
David Rowe
91581ef3c5 Update JSDoc 2019-12-01 21:59:47 +13:00
David Rowe
200ff2499e Include localVelocity etc. to match Entity.getEntityProperties() 2019-12-01 21:24:40 +13:00
David Rowe
c7f82a8264 Add new MyAvatar.getAvatarEntityData() implementation for API 2019-11-28 17:10:19 +13:00
David Rowe
9144e78cb9 Rename current getAvatarEntityData() method and use internally 2019-11-28 16:30:26 +13:00
Anthony Thibault
edfad97b64
Merge pull request #16517 from hyperlogic/feature/facecap-osc-plugin
Input plugin for streaming blendshapes from an iPhone
2019-11-23 11:49:51 -08:00
Anthony J. Thibault
98c951702d Added DEFAULT_GAZE_DISTANCE constant 2019-11-22 09:29:21 -08:00
Anthony J. Thibault
404d1a3c93 Fix several bugs for eye tracking from input plugins to function 2019-11-21 17:57:44 -08:00
Anthony J. Thibault
9d6ce44131 Head is now computed in proper sensor space
Eye tracking now works.
2019-11-20 15:30:16 -08:00
Shannon Romano
37a46d91fa
Merge pull request #16513 from DouglasWilcox/Fix_seated_rotation_edge_case_bounce
Edge case fix for seated rotation - it would bounce forward if you let go of Q/E at exact right time.
2019-11-20 09:27:36 -08:00
DouglasWilcox
19aacde3a2 Fix case where Avatar could get stuck facing camera if rotating camera quickly and avatar faced backward. 2019-11-19 14:32:51 -08:00
DouglasWilcox
8ccdfaf220 Clamp rotation velocity if hit trigger angle, but only bounce forward if cameraYaw is true. 2019-11-19 12:05:25 -08:00
jennaingersoll
451ffcd1e0
Merge pull request #16492 from jennaingersoll/jsdoc-revisions
DOC-208: Revisions to JSDoc added by developers since July 2019
2019-11-19 11:01:18 -08:00
Brad Hefta-Gaub
0f428f0afb
Merge pull request #16498 from DouglasWilcox/improve_seated_rotation
Improve seated rotation
2019-11-19 10:22:08 -08:00
ingerjm0
d2118f0aac DOC-208 revisions 2019-11-18 20:05:08 -08:00
Sabrina Shanman
518d6a530a
Merge pull request #16507 from highfidelity/master
Merge master into instancing
2019-11-18 13:54:33 -08:00
DouglasWilcox
ddbb8d70ed Speed up acceleration and blends slightly per Joshua, add kicks to turn anim. 2019-11-15 17:04:51 -08:00
DouglasWilcox
d9065affad comment explaining seatedrot deceleration section, and transition-> turn works 2019-11-14 17:18:43 -08:00
DouglasWilcox
37010648be Abandon exponential acceleration and use constant acceleration. Hook up turn->sit transitions. 2019-11-14 13:12:01 -08:00
Andrew Meadows
7692e858a1 use EntityItemID rather than QUuid 2019-11-14 09:59:43 -08:00
Andrew Meadows
3546bab19a use std::vector<> instead of QVector<> 2019-11-14 09:59:43 -08:00
Andrew Meadows
9d92546a8b revert the revert of PR-16307 2019-11-14 09:59:43 -08:00
DouglasWilcox
11e1c4e6fe linear acceleration experiment 2019-11-14 09:23:16 -08:00
ingerjm0
ed9db81bed Fix for displaying moved properties' documentation in docs 2019-11-13 14:58:32 -08:00
Anthony J. Thibault
365b132c30 Bugfix for t-pose avatar when moving
The android specific optimized IK animation graph was out of date, it was referencing
animations that have been deleted, hence the t-pose.  This PR updates and renames the
android/optimized ik animation graph to the latest.
2019-11-12 15:33:41 -08:00
ingerjm0
dda69bf91a JSDoc revisions for PR16245 2019-11-12 14:47:09 -08:00
ingerjm0
ce174696c0 JSDoc revisions for PR 16144 2019-11-12 14:38:51 -08:00
ingerjm0
11cb6ac6e0 JSDoc updates for PR15974 2019-11-12 14:18:12 -08:00
DouglasWilcox
9d86e49a0b Pretty good exponential acceleration, need to simplify 2019-11-12 11:59:39 -08:00
DouglasWilcox
995f5f92cd Do not use turningSpeed when setting seatedTurn vars, and iterate acceleration formula 2019-11-12 11:11:19 -08:00
DouglasWilcox
c36c4a17b1 first pass hookup of seated rotation with acceleration and animation response 2019-11-11 11:31:34 -08:00
Sabrina Shanman
eebb9ad51f
Merge pull request #16475 from highfidelity/master
Merge master into instancing
2019-11-08 10:10:50 -08:00
Anthony Thibault
8f0ca7b6db
Merge pull request #16447 from luiscuenca/hideNeckSecondPass
DEV-2461: Head woes in 1st person part 2
2019-11-06 12:11:59 -08:00
sabrina-shanman
7b14c00540 Merge branch 'master' into instancing 2019-11-05 10:22:24 -08:00
luiscuenca
de2d2de938
Head woes in 1st person part 2 2019-11-04 13:33:00 -07:00
Anthony J. Thibault
101ec9d753 Remove LipsUpperOpen and LipsLowerOpen, the last of the legacy faceshift blendshapes
These blendshapes are not present in ARKit and are not used by any of our procedural
face animations (talking, blinking etc).  This change should have been part of #16400 but
was accidently left out.
2019-11-04 09:49:24 -08:00
Sabrina Shanman
05ac16536e
Merge pull request #16436 from highfidelity/master
Merge master into instancing
2019-10-31 17:39:15 -07:00
Anthony J. Thibault
4b34311a0a Hooked up seated version of aim offset animation 2019-10-31 16:23:29 -07:00
Anthony Thibault
f99bb3ec77
Merge pull request #16400 from hyperlogic/feature/arkit-blendshapes
Extended avatar blendshape support for ARKit compatiblity
2019-10-31 12:33:50 -07:00
Shannon Romano
8d6434fbca
Merge pull request #16367 from ctrlaltdavid/DOC-199
DOC-199: AudioScope JSDoc
2019-10-30 13:45:13 -07:00
Shannon Romano
9948a181dc
Merge pull request #16392 from kitely/load-avatar-entities-after-skeleton
In Bookmarks, attach avatar entities after the skeleton is loaded
2019-10-30 09:29:51 -07:00
Sabrina Shanman
e8b963b59a
Merge pull request #16425 from highfidelity/master
Merge master into instancing
2019-10-30 09:16:04 -07:00
Shannon Romano
8fc135d972
Merge pull request #16423 from hyperlogic/bug-fix/third-person-look-at-fix-2
DEV-2302: Fix for head not turning in third person look at camera mode
2019-10-29 13:41:13 -07:00
Brad Hefta-Gaub
206e519b5e
Merge pull request #16390 from kitely/fix-walk-speed
Fixed the sprint speeds of Desktop vs HMD
2019-10-29 13:04:45 -07:00
Anthony J. Thibault
e753010411 Fix for head not turning in third person look at camera mode
If MyAvatar::setSkeletonModelURL() is called with the same url that has already been loaded the
SkeletonModel::skeletonLoaded signal will not be triggered.  In this case the MyAvatar local variable
MyAvatar::_skeletonModelLoaded will be set to false and never re-set to true.  This, in turn,
caused MyAvatar::updateHeadLookAt() to skip setting the proper blend values that would turn the head.

Rather then try to make MyAvatar::_skeletonModelLoaded handle all the possible edge cases. It has
been removed.  All conditionals that used to use it have been replased with _skeletonModel->isLoaded().
2019-10-29 12:38:06 -07:00
luiscuenca
ab6631fae3
Fix look at update and allow to release control 2019-10-28 17:51:29 -07:00
Oren Hurvitz
70c3bb2748 Emit an event when failing to load an avatar.
Previously, MyAvatar only emitted an event (onLoadComplete) if the load succeeded.
Now it also emits an event (onLoadFailed) if the load failed.
2019-10-27 10:55:31 +02:00
Oren Hurvitz
62e5b50e24 Fixed the sprint speeds of Desktop vs HMD (they were flipped) 2019-10-27 09:33:59 +02:00