Commit graph

1352 commits

Author SHA1 Message Date
Dale Glass
d834a05053 Remove unused variable 2022-06-10 00:46:19 +02:00
Dale Glass
7d34a9233b Replace QTime with QElapsedTimer (deprecated) 2022-06-10 00:46:19 +02:00
Dale Glass
87ba20ecb4 Only whitespace changes 2022-06-10 00:46:19 +02:00
Kalila
03b5b83b67
Merge pull request #1339 from odysseus654/pr/make_shared
Housekeeping: use of std::make_shared / QSharedPointer::create.
2021-12-09 17:14:04 -05:00
Dale Glass
891d555679
Merge pull request #1352 from odysseus654/pr/q_disable_copy
Code Review: use of Q_DISABLE_COPY.
2021-09-25 20:33:20 +02:00
Heather Anderson
57a3cd3d63 replace the various disable-copy constructions with Q_DISABLE_COPY (or Q_DISABLE_COPY_MOVE) 2021-09-18 21:36:35 -07:00
Heather Anderson
bcce9a2091 convert explicit shared pointer creation (using "new") to make_shared where possible/appropriate 2021-09-11 15:15:04 -07:00
Heather Anderson
ab4d70760e review and cleanup of "#include <QtCore/QSharedPointer>" 2021-09-10 21:40:54 -07:00
Dale Glass
32c3725b5d Define _USE_MATH_DEFINES everywhere that uses math constants
On Win32, things are failing to build with messages like:

RenderableEntityItem.cpp(674,51): error C2065: 'M_PI': undeclared identifier

This is because as per Microsoft documentation, _USE_MATH_DEFINES is needed to
obtain constants like M_PI:

https://docs.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=msvc-160

It seems this worked previously due to some quirk of CMake, but stopped working
after some reordering. This change makes this definition explicit where it is needed.
2021-07-17 19:34:26 +02:00
David Rowe
4d11d1d515 Convert all "/**jsdoc" occurrences to "/*@jsdoc" 2021-05-12 10:54:45 +12:00
Julian Groß
ecb7c47f1a Rename fbx folder to model-serializers 2021-04-15 19:26:10 +02:00
Kalila L
df7fd920d7 Change INVALID_JOINT_INDEX to AnimSkeleton::INVALID_JOINT_INDEX 2021-02-25 23:28:00 -05:00
Kalila L
0e03eccbdf Change NO_PARENT_INDEX to INVALID_JOINT_INDEX. 2021-02-25 21:43:17 -05:00
Kalila L
4276ea295c Change -1 to NO_PARENT_INDEX. 2021-02-25 21:29:54 -05:00
Kalila
c79eb479f0
Update AnimInverseKinematics.cpp 2021-02-25 20:36:45 -05:00
Kalila
080d42be39
Update AnimInverseKinematics.cpp 2021-02-25 20:35:02 -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
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
Kasen IO
44e5bbb591 Add init for timer to constructor. 2020-07-04 00:48:03 -04:00
Kasen IO
0ad7e25b49 Revise names. 2020-07-03 14:40:56 -04:00
Kasen IO
aaf19db286 Debounce missing joint log spam to 30s intervals 2020-06-23 00:42: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
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
Dale Glass
68d10a2fe1 Make default copy constructors explicit
Recent versions of gcc generate a warning without this
2020-01-19 00:20:49 +01:00
David Rowe
2dd981493e Update classes' JSDoc per @hideconstructor 2019-12-23 14:13:48 +13:00
David Rowe
5eb6e9dadd Add recently added properties to caches' JSDoc 2019-11-26 17:00:13 +13: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
Sabrina Shanman
518d6a530a
Merge pull request #16507 from highfidelity/master
Merge master into instancing
2019-11-18 13:54:33 -08:00
DouglasWilcox
37010648be Abandon exponential acceleration and use constant acceleration. Hook up turn->sit transitions. 2019-11-14 13:12:01 -08:00
DouglasWilcox
b8e85aedc7 Merge branch 'master' into improve_seated_rotation 2019-11-13 13:11:30 -08:00
sabrina-shanman
516debdcb2 Fix code style / remove cruft 2019-11-13 12:50:13 -08:00
DouglasWilcox
a3de25618a Handle HMD in input vars and remove/fix json transitions in/out of HMD strafe states.
(cherry picked from commit f9f28fc286)
2019-11-13 09:52:56 -08:00
DouglasWilcox
f9f28fc286 Handle HMD in input vars and remove/fix json transitions in/out of HMD strafe states. 2019-11-12 14:15:19 -08:00
DouglasWilcox
995f5f92cd Do not use turningSpeed when setting seatedTurn vars, and iterate acceleration formula 2019-11-12 11:11:19 -08:00
Sabrina Shanman
769a332d22
Merge pull request #16485 from highfidelity/master
Merge master into instancing
2019-11-12 10:07:28 -08:00
DouglasWilcox
64634f51b1 Merge branch 'master' into improve_seated_rotation 2019-11-11 11:31:56 -08:00
DouglasWilcox
c36c4a17b1 first pass hookup of seated rotation with acceleration and animation response 2019-11-11 11:31:34 -08:00
dooglifeSF
055d5cdf9b Simplify boolean statements, revise several settle anims 2019-11-08 13:46:38 -08:00
Sabrina Shanman
eebb9ad51f
Merge pull request #16475 from highfidelity/master
Merge master into instancing
2019-11-08 10:10:50 -08:00
dooglifeSF
8e11d91c03 Merge branch 'master' into rand_settles_and_by_momentum 2019-11-07 15:09:10 -08:00
dooglifeSF
73202b9caf Different settle transition depending on momentum 2019-11-07 09:52:26 -08:00
Anthony J. Thibault
6e7f222608 Fix for assert in AnimBlendDirectional on startup
Specifically, std::vector subscript out of range.
2019-11-05 14:16:10 -08:00
Sabrina Shanman
05ac16536e
Merge pull request #16436 from highfidelity/master
Merge master into instancing
2019-10-31 17:39:15 -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
sabrina-shanman
4e0db5d641 Fix build warnings 2019-10-24 15:49:03 -07:00
Sabrina Shanman
6db993fe05
Merge pull request #16397 from sabrina-shanman/instancing_skinning
(DEV-561) First pass at skinning for GLTF
2019-10-23 15:41:12 -07:00