Commit graph

872 commits

Author SHA1 Message Date
humbletim
08ccda9cfc rename libraries/model(src/model) -> libraries/graphics(src/graphics) 2018-01-16 12:44:44 -05:00
Anthony Thibault
0a54241fe3
Merge pull request #12092 from hyperlogic/feature/dual-quat
Fix tootsie roll wrists and shoulders with dual quaternion skinning
2018-01-12 16:30:03 -08:00
Anthony J. Thibault
bfd18e3696 unused variable warning fix 2018-01-12 09:07:50 -08:00
Anthony J. Thibault
983e1fe075 warning fixes: removed unused variable. 2018-01-11 17:57:58 -08:00
Anthony J. Thibault
4e4ac6c54d Merge branch 'master' into bug-fix/elbow-glitch-fix 2018-01-11 17:57:41 -08:00
Anthony J. Thibault
7753b8a0b5 Merge branch 'master' into feature/dual-quat 2018-01-11 17:31:29 -08:00
Anthony J. Thibault
467a7eaf2d Fix for elbow glitches
The pole vector constraint calculation within the IK system would sometimes compute the incorrect rotations.
This would be visible as an instantaneous snap of the elbow joint as the bicep was curled.

When applying pole vector constraints, there needs to be two methods of determining the current orientation of the elbow joint.
One for when the arm/elbow joint is bent, and one for when the arm/elbow is straight.
Previously, the way we would switch between these two solutions could cause a large rotation delta to accur between very small angles.
Now we use the more accurate method (1) more often, and we smoothly blend between the solutions as the joint gets straighter.
2018-01-11 15:40:53 -08:00
Anthony J. Thibault
ae997928c1 Bug fix to prevent wrists entering the avatar's torso.
This was inadvertently disabled in PR #11978.
2018-01-10 11:51:44 -08:00
Anthony J. Thibault
d08f94a74d Code review feedback
* Removed AnimPose::fuzzyEqual
* Fixed DualQuaternion ctor
2018-01-08 13:36:23 -08:00
Anthony J. Thibault
515d13a4c1 WIP checkpoint 2018-01-04 16:09:08 -08:00
Anthony J. Thibault
565875e823 WIP first attempt at dual quat skinning 2018-01-04 16:09:02 -08:00
Anthony J. Thibault
e2df9e29e2 Fix for crash in AnimSkeleton::getNumJoints()
When initAnimGraph is called it asynchronously loads the Animation graph in the background.
If the model url is changed, or the Model is deleted in between the initial load and it's completion,
It's possible to access a bad Rig::_animSkeleton pointer.
The fix is to hold onto the _animSkeleton pointer via a weak ref.
2017-12-15 16:46:27 -08: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
luiscuenca
bf0d55aa98 9267 Fix not restoring animations after changing view modes 2017-11-15 15:04:24 -07:00
Anthony J. Thibault
4169e11e77 Merge branch 'master' into bug-fix/div-by-zero 2017-11-10 10:15:26 -08:00
Anthony J. Thibault
9724a5e5b8 Fix for address sanitizer warning
This fixes a potential null pointer dereference.
2017-11-09 10:53:36 -08:00
luiscuenca
81509b3e92 coding standard 2017-11-02 10:34:57 -07:00
luiscuenca
9e0e1ab5a5 erase comment 2017-11-01 19:56:16 -07:00
luiscuenca
e201e82ec2 formatting 2017-11-01 19:45:56 -07:00
luiscuenca
6a2dc38fdd restoring previous roles 2017-11-01 19:38:37 -07:00
luiscuenca
da63e85699 Bug 8270 fixed 2017-11-01 09:17:04 -07:00
Andrew Meadows
c79bf3bc04 cleanup WANT_DETAILED_PROFILING 2017-10-19 14:31:50 -07:00
Andrew Meadows
339edc67c8 ifdef out more per-frame-per-entity profiling 2017-10-16 17:27:53 -07:00
Anthony J. Thibault
fe57a20979 div by zero fix 2017-10-10 16:22:49 -07:00
Anthony J. Thibault
18d723b6b4 div by zero fixes, detected by address sanitizer 2017-10-10 16:17:39 -07:00
SamGondelman
a6f2545511 fix local t pose 2017-10-03 12:51:37 -07:00
SamGondelman
b8ea6c22fa no tpose when switching avatars
(cherry picked from commit fcfac9efc0)
2017-09-29 13:47:09 -07:00
SamGondelman
306cf883fe don't reload animGraph if url didn't change 2017-09-26 18:18:41 -07:00
Anthony J. Thibault
573985c7c9 Merge branch 'master' into feature/ant-man 2017-08-28 09:27:04 -07:00
Anthony J. Thibault
5042b90052 Rig: Fix for debug mode assert 2017-08-24 10:47:48 -07:00
Brad Hefta-Gaub
afce8b547a Merge pull request #11197 from hyperlogic/bug-fix/prevent-rig-crash-in-lambda
Rig: Use a registry to prevent use after free crashes/corruption
2017-08-23 15:09:28 -07:00
Anthony J. Thibault
aef19c6f97 Rig: Use a registry to prevent use after free crashes/corruption
Create a global registry to hold all the currently active Rig instances.
Use this registry and it's mutex to prevent accessing the rig after it has already been destroyed,
or is in the process of being destroyed on the main thread.
2017-08-15 18:28:51 -07:00
Anthony J. Thibault
e9b8e5431d Fix for incorrectly scaled bounding volumes when switching avatars
Make sure to explicitly set the _geometryToRigTransform in Rig::initJointStates().

This should fix small bounding volume when switching from the Gamebot avatar (which has 0.008 scaling)
to another avatar (which ususally have 0.01 scaling).
2017-08-15 17:26:51 -07:00
Anthony J. Thibault
f46198c2fd Simplified/Improved avatar capsule calculation
IK is no longer performed during capsule calculation, This fixes an issue with the mannequin avatar in the marketplace.
Specifically, it was causing the hips to rise during IK which would result in an incorrectly sized and offset capsule.
2017-08-15 13:48:10 -07:00
Anthony J. Thibault
04006a9f76 code review feedback 2017-08-15 11:19:41 -07:00
Anthony J. Thibault
cd57c0706a more warning fixes 2017-08-11 17:46:50 -07:00
Anthony J. Thibault
9e1218b4a4 Use k-dop collision to prevent hands from entering body. 2017-08-11 14:50:00 -07:00
Anthony J. Thibault
25b5cb4762 Switch order of precondition and setSecondaryTargets 2017-08-01 13:17:33 -07:00
Anthony J. Thibault
2a45c6d3dc Removed eigen dependency, fixed Debug Draw IK Chains
Also, clarified for special case for secondary shoulder joint look-at constraint.
2017-07-26 16:55:12 -07:00
Anthony J. Thibault
c81875a280 Improved shoulder calibration using hard-coded measured shoulder width 2017-07-25 15:50:44 -07:00
Anthony J. Thibault
33a1d6e225 Merge branch 'master' into feature/secondary-pose-support 2017-07-24 17:27:33 -07:00
Anthony J. Thibault
9f6641ed10 Shoulder puck calibration work in progress
* AnimInverseKinematics: debug draw for secondary targets
* AnimInverseKienmatics: better clean up of ik target debug draw
* GeometryUtil: added findPlaneFromPoints()
* ViveControllerManager: external dependency on eigen
* ViveControllerManager: record history of left/right hand controllers
* ViveControllerManager: use history to determine user shoulder location for better calibration
* ViveControllerManager: pass defaultToReferenceMat by const ref to calibrate functions.
* CMake: added external depenency to eigen linear algebra library.
2017-07-24 17:22:48 -07:00
Andrew Meadows
5a4f56388b Merge pull request #10881 from hyperlogic/feature/smooth-ik-chains
Smooth IK when trackers are disabled / enabled.
2017-07-14 16:59:30 -07:00
Anthony J. Thibault
de199bff9d code review feedback 2017-07-14 09:47:37 -07:00
Anthony J. Thibault
c85e187c61 first stab at secondary target pose support 2017-07-13 18:12:33 -07:00
Anthony J. Thibault
b0177c2522 remove comment, it does indeed work 2017-07-10 16:25:37 -07:00
Anthony J. Thibault
1cdc0071f3 Fixed issue with hips and chest not ramping off properly. 2017-07-10 16:17:25 -07:00
Anthony J. Thibault
bd8d6280a8 Interpolate out of ik chains when they are disabled 2017-07-07 09:29:57 -07:00
Seth Alves
15d379cc5a coding style 2017-07-06 17:36:28 -07:00
Seth Alves
24c8267030 in Rig joint accessors, if on the Rig's thread use internalPoseSet, else use external 2017-07-06 13:22:14 -07:00
Seth Alves
e9bdbd7715 Merge branch 'calvin' of github.com:samcake/hifi into faster-getters-on-avatar-for-scripts 2017-07-06 11:09:38 -07:00
Anthony J. Thibault
06d512dab9 Warning fixes 2017-07-05 10:43:24 -07:00
Anthony J. Thibault
56cd31e92d Merge branch 'master' into feature/smooth-ik-chains 2017-07-05 09:33:22 -07:00
Anthony J. Thibault
1a24d4d8ec added safeLerp, shortest angle quat lerp with post normalize 2017-07-05 09:31:02 -07:00
Anthony J. Thibault
7ed1382ac9 ik level interpolation of incoming targets 2017-07-03 16:32:46 -07:00
Anthony J. Thibault
2f6a37ee53 Removed interpolation of hand controllers 2017-07-03 16:31:05 -07:00
Anthony J. Thibault
aba164b26e more clean up of Rig::computeAvatarBoundingCapsule 2017-06-30 13:27:53 -07:00
Anthony J. Thibault
237872e477 sizes and order of IKTargetVarVec and IKTargetVec are now the same.
Also, A change in how the bone name to bone index lookup occurs exposed a bug
in Rig::computeAvatarBoundingCapsule(), basically it was not actually preforming IK,
and the ik targets were in the wrong coordinate frame.  So when IK was actually
performed it would give bad results.  This bug is now fixed.
2017-06-30 12:47:01 -07:00
Brad Davis
6fc82bb351 Switch to preprocessor macro for blocking invokes to capture function information 2017-06-30 11:36:24 -07:00
Anthony J. Thibault
75e1a4a1e6 Refactor of JointChainInfo data structure 2017-06-30 09:28:39 -07:00
Anthony J. Thibault
c7e4bf931b WIP: first steps toward smoothing ik chains 2017-06-30 09:28:38 -07:00
Brad Davis
b52dd7b822 Don't use blocking connections on the main thread 2017-06-29 20:45:17 -07:00
Sam Gateau
f7a3b3a411 Experimenting faster getters on Avatar for scripts 2017-06-29 15:55:47 +02:00
Clément Brisset
a2c15c9794 Merge pull request #10770 from jherico/fix_deps_1
Cleanup entity dependencies
2017-06-28 10:48:58 -07:00
Brad Davis
8130a91b8c Cleanup entity dependencies 2017-06-27 19:15:49 -07:00
Anthony J. Thibault
d4122cff5a warning fix 2017-06-27 11:29:08 -07:00
Anthony J. Thibault
2814c94582 Hips should no longer waggle when feet are active 2017-06-26 17:43:51 -07:00
Anthony J. Thibault
8602d57a57 Eliminated to wiggle while pucks are enabled.
* Added new anim node AnimDefaultPose
* AnimNodeLoader was changed to support the addition of the AnimDefaultPose node
* Edited default avatar-animation.json to insert an AnimOverlay and AnimDefaultPose between the IK node and the rest of the "underPose".
* Rig uses this to fade in default pose for the toes when the hip/feet puck are active.
  This effectively deadens the toe animations, without effecting the hand animations.
* Also, the rig was changed to use the LimitCenter solution when the feet are enabled but the hips are not.
2017-06-26 14:09:10 -07:00
Anthony J. Thibault
b8c638b2b7 warning fixes 2017-06-23 14:36:59 -07:00
Anthony J. Thibault
f320610681 opened up shoulder constraint + other fixes
* bent elbows will be away from the body a bit more.
* sped up smoothing of pole vectors
2017-06-23 14:06:00 -07:00
Anthony J. Thibault
54af6af651 Fix for pole vector stability and knee pole vector computation 2017-06-23 10:38:21 -07:00
Anthony J. Thibault
2dcca2125b Merge branch 'master' into feature/pole-vector 2017-06-21 15:50:03 -07:00
Anthony J. Thibault
0f51236fb0 Rig.cpp: take avatar scale into account when computing elbow pole vector 2017-06-21 14:36:42 -07:00
Anthony J. Thibault
1979ed7f3a Disable elbow pole vector if arm/shoulder pucks are enabled 2017-06-19 16:58:11 -07:00
Anthony J. Thibault
c236afe68c Simplify passing data from MySkeletonModel to Rig 2017-06-19 16:54:39 -07:00
Anthony J. Thibault
6bbc5bfbea formatting on initializers 2017-06-19 13:42:39 -07:00
Brad Davis
ed6620fc51 Merge pull request #10718 from jherico/frame_thread
Cleanup and refactoring
2017-06-19 13:31:44 -07:00
Anthony J. Thibault
3f5aba2655 improved elbow pole vector calculation
Also, pole vectors are blended spherical linearly, this might help fast moving
pole vectors from rotating too quickly.
2017-06-19 13:21:12 -07:00
Anthony J. Thibault
81852cd91c warning fixes 2017-06-16 18:15:41 -07:00
Anthony J. Thibault
323dc62ef2 Merge branch 'master' into feature/pole-vector 2017-06-16 17:37:11 -07:00
Anthony J. Thibault
e7991579ef Enabled elbow pole vectors
There are still some issues with rotations of the elbow pole vectors.
* When the (hand - shoulder) vector approaches the normal vector used in Rig::calculateElbowPoleVector() unexpected twists can occur.
* Also, when the (hand - shoulder) vector approaches zero, the IK system starts to flutter between two states.
* The shoulder twist constraint probably needs to be opened up for more natural range of motion.
2017-06-16 17:29:56 -07:00
Brad Davis
a69cf31f4b PR feedback and cmake fixes 2017-06-16 16:59:58 -07:00
Anthony J. Thibault
cdfba52488 precondition initial solution before solving to reduce limb locking. 2017-06-15 15:02:42 -07:00
Anthony J. Thibault
fac21033e7 Fixed matthew sitting pose by opening up UpLeg twist constraint to +- 90 degrees. 2017-06-14 11:53:54 -07:00
Anthony J. Thibault
10f94c2d60 Fixed pole vectors on straight limbs by using reference vector 2017-06-14 11:35:53 -07:00
David Rowe
570ec8457d Refactor 2017-06-14 10:45:30 +12:00
Anthony J. Thibault
f20c03fa6e Pole vectors can be controlled via anim vars. 2017-06-13 15:36:05 -07:00
David Rowe
5eee2d8352 Code review 2017-06-13 12:39:46 +12:00
Anthony J. Thibault
7521d6124e WIP: added blend between hips and foot for knee pole vector 2017-06-12 17:23:23 -07:00
Anthony J. Thibault
0cde22d937 Bug fix for pole constraint on legs 2017-06-12 12:13:03 -07:00
David Rowe
3e126c0517 Smoothly ease hands from uncontrolled to controlled positions 2017-06-12 17:14:13 +12:00
Anthony J. Thibault
e8ca1a3060 WIP: added magnitude to damping rotation near singularities.
Also knee pole constraints don't work..  why?
2017-06-09 18:09:38 -07:00
Anthony J. Thibault
bb45fe0388 WIP, straight arm still rotates.. 2017-06-09 09:48:03 -07:00
Anthony J. Thibault
02f06d4d4e WIP pole vectors work.. but still have issues... 2017-06-09 09:48:02 -07:00
Anthony J. Thibault
6564cfd5d1 WIP 2017-06-09 09:48:00 -07:00
Anthony Thibault
e3c342aa77 Merge pull request #10595 from hyperlogic/feature/spine-spline
Spline IK target support
2017-06-08 18:09:55 -07:00
Anthony J. Thibault
8334dff610 compute rotation from derivative of spline
This should fix bad rotation values for the spine during bowing/touching toes.
2017-06-08 15:00:12 -07:00
Anthony J. Thibault
606c6415ae Merge branch 'master' into feature/spine-spline 2017-06-07 10:53:46 -07:00
David Rowe
5cb1918b80 Simplify code 2017-06-06 13:26:16 +12:00
David Rowe
ad848706ec Merge branch 'master' into 21202 2017-06-06 11:18:31 +12:00