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.
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.
* 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.
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.
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).
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.
* 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.
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.
* 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.
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.