Commit graph

476 commits

Author SHA1 Message Date
Howard Stearns
502cc7f580 Don't copy while converting. 2015-10-29 16:44:01 -07:00
Howard Stearns
303491817b assert to get hard error in dev, warning and no-op in release. 2015-10-29 16:35:59 -07:00
Anthony J. Thibault
f7b6fab0c3 Merge branch 'master' into tony/anim-sync-blend 2015-10-29 11:35:48 -07:00
Howard Stearns
4083c5c71b Handle wrapping of very long-lived sessions. 2015-10-29 10:31:36 -07:00
Howard Stearns
d79d0bc5c5 Merge branch 'master' of https://github.com/highfidelity/hifi into expose-anim-vars 2015-10-29 08:25:41 -07:00
Howard Stearns
697b9fb60b Merge pull request #6205 from hyperlogic/tony/eye-lookat-fix
Fixes locally rendered eye gaze
2015-10-28 21:39:54 -07:00
Anthony J. Thibault
5e73af9272 Rig: Removed dt from updateFromEyeParameters() 2015-10-28 18:10:41 -07:00
Anthony J. Thibault
b3734b5ddb Rig: removed redundant method updateEyeJoints()
Instead we call updateEyeJoint() twice, once for each eye.
2015-10-28 10:46:09 -07:00
Anthony J. Thibault
f9dc05c989 Rig::computeMotionAnimationState better filtering of small dt velocities.
Only update _lastVelocity when dt is sufficiently large.
2015-10-27 18:59:02 -07:00
Anthony J. Thibault
ae8938cadc Fix for local eye tracking in AnimGraph
Also moved Rig::updateAnimations() now occurs after
Rig::updateFromHeadParameters() and Rig::updateFromHandParameters().
This should remove a frame of lag for head and hand IK targets.

Rig::updateFromEyeParameters() occurs after Rig::updateAnimations().
But now the eye JointStates are re-computed, this is the actual
fix for the local eye tracking issue.
2015-10-27 18:30:35 -07:00
Anthony J. Thibault
485e36d824 Bug fix for hand IK when using the Owen avatar.
The IK was assiming that the "Hips" bone index was always 0.
This was not the case for Owen.  Now we lookup the Hips index
and cache it for use during the hipsOffset computation.
2015-10-26 17:17:46 -07:00
Howard Stearns
4b4907c9ef Allow multiple scripts to register, and allow them to specify the specific anim vars they are interested in. 2015-10-26 10:04:55 -07:00
Howard Stearns
e11b0add9a Update safety trampoline with correct arguments. 2015-10-24 15:29:49 -07:00
Anthony J. Thibault
06de087802 Filter out velocities computed from position delta if dt is small
While in the HMD, updates can occur with very small deltaTime values.
These this makes the position delta method of computing a velocity very
susceptible to noise and precision errors.
2015-10-23 18:27:20 -07:00
Anthony J. Thibault
e639d53139 Use #include<> for headers not in current working directory. 2015-10-23 08:55:38 -07:00
Howard Stearns
84cfeaec13 Linux QT wants .h-less headers. 2015-10-22 17:01:06 -07:00
howard-stearns
92ddedd44b Make msvc happy. 2015-10-22 16:44:15 -07:00
Anthony J. Thibault
8689170415 Removed sync and timescale from AnimBlendLinear node.
AnimBlendLinearMove will now be used instead.
2015-10-22 16:40:53 -07:00
Anthony J. Thibault
a66f31bb20 Added AnimBlendLinearMove node
AnimBlendLinearMove is now in use by forward, backward and strafe movements.
Tuned rig moving average speeds to be more sensitive.
2015-10-22 16:33:31 -07:00
Howard Stearns
2b7ceffd64 Get rid of globalObject().property("MyAvatar").property("animationStateHandlerResult"). 2015-10-22 16:23:09 -07:00
Howard Stearns
913842ac30 Thread check, for consistency. 2015-10-22 15:31:17 -07:00
Howard Stearns
ecc920199d Return id suitable for use with remover, per comments. 2015-10-22 15:24:24 -07:00
Howard Stearns
1d0464ede5 Name change and thread checks per comments. 2015-10-22 15:15:10 -07:00
Howard Stearns
759e652506 Thread test per comments. 2015-10-22 15:13:14 -07:00
Howard Stearns
30429e8138 Don't use late-breaking results that got reported after the handler was removed. 2015-10-22 11:43:22 -07:00
Howard Stearns
b5ccd49959 Make ubuntu happy. 2015-10-22 11:42:50 -07:00
Howard Stearns
9fd61907f5 Call back to Javascript asynchronously, so that we don't block and the script's engine doesn't have thread conflicts. 2015-10-21 20:50:07 -07:00
Anthony J. Thibault
c83af43d0e Added strafe and backward blending 2015-10-21 17:34:09 -07:00
Anthony J. Thibault
41cce4320a Merge branch 'tony/anim-sync-blend' into test 2015-10-20 17:39:13 -07:00
Howard Stearns
3d2f00c609 Cleaner intgerface, including cleanup. 2015-10-20 17:01:45 -07:00
Anthony J. Thibault
5cd2786c1d First pass at Rig timeScaling and blending between slow, walk and run. 2015-10-20 16:37:05 -07:00
Howard Stearns
4c6867bb9c Merge branch 'master' of https://github.com/highfidelity/hifi into expose-anim-vars 2015-10-20 12:17:00 -07:00
Anthony J. Thibault
11f2d29bf8 AnimBlendLinear: bugfixes for sync flag added timeScale 2015-10-20 10:36:37 -07:00
Andrew Meadows
341bc3666f Merge pull request #6093 from sethalves/hold-action-changes
Hold action changes
2015-10-20 09:19:48 -07:00
Howard Stearns
2213a4bb02 Do not set (just rightHand) anim var if a script has done so. 2015-10-19 20:09:48 -07:00
Anthony J. Thibault
073cec41c4 AnimClip & accumulateTime smoother looping anims
Looping animations should have an extra frame of interpolation between the start and end frames.
2015-10-19 15:49:52 -07:00
Anthony J. Thibault
9b9bd7fe26 AnimNodeLoader: Fix for crash condition
When a node with children had an error loading, it would
lead to a nullptr dereference.
2015-10-19 15:49:50 -07:00
Anthony J. Thibault
2b4788929f AnimBlendLinear: Untested implementation of sync flag.
Move accumulateTime into AnimUtil.
2015-10-19 15:49:49 -07:00
Anthony J. Thibault
3716800b98 Moved AnimPose class into it's own set of files 2015-10-19 15:49:48 -07:00
Andrew Meadows
917bfbf64e hack to reduce hand influence of hips in HMD mode 2015-10-19 15:19:32 -07:00
Howard Stearns
38a967ac54 Allow compiler after someone broke things. 2015-10-16 16:28:11 -07:00
Howard Stearns
91c2d31118 Merge branch 'master' of https://github.com/highfidelity/hifi into expose-anim-vars 2015-10-16 15:51:09 -07:00
Howard Stearns
f25cc93936 Initial prototype of exposing anim vars to javascript. 2015-10-16 10:48:36 -07:00
Seth Alves
462918ffcf cleanups 2015-10-15 14:55:17 -07:00
Seth Alves
4903db45b1 give other avatars an anim-skeleton 2015-10-15 14:21:06 -07:00
Seth Alves
a70ba4cd5a add some accessors 2015-10-15 11:42:53 -07:00
Anthony J. Thibault
e484a904a2 Rotate the avatar to align with the HMD while moving
MyAvatar: refactored updateFromHMDSensorMatrix() a bit by splitting it into several methods, because
it was getting quite large and becoming hard to follow.

* beginStraighteningLean() - can be called when we would like to trigger a re-centering action.
* shouldBeginStraighteningLean() - contains some of the logic to decide if we should begin a re-centering action.
  for now it encapulates the capsule check.
* processStraighteningLean() - performs the actual re-centering calculation.

New code was added to MyAvatar::updateFromHMDSensorMatrix() to trigger re-centering when the avatar speed rises
over a threshold.

Secondly the Rig::computeMotionAnimationState() state machine for animGraph added a state change hysteresis
of 100ms.  This hysteresis should help smooth over two issues.

1) When the delta position is 0, because the physics timestep was not evaluated.
2) During re-centering due to desired motion, the avatar velocity can fluctuate causing undesired animation state fluctuation.
2015-10-13 17:36:00 -07:00
Andrew Meadows
8ebdd25b71 more cleanup 2015-10-12 14:07:23 -07:00
Andrew Meadows
22786dea7d cleanup 2015-10-12 13:35:26 -07:00
Andrew Meadows
44243aaa52 remove some debug code 2015-10-12 11:39:54 -07:00
U-GAPOS\andrew
f01847de14 experimental HMD hips tracking 2015-10-12 11:39:54 -07:00
Andrew Meadows
35d2a5b5ea track tipRotation for HmdHead target 2015-10-12 11:39:54 -07:00
Andrew Meadows
5f1068c404 cleanup and optimization of IK loop 2015-10-12 11:39:54 -07:00
Andrew Meadows
6a96d5f0c5 don't bother to create targets with bad types 2015-10-12 11:39:54 -07:00
Andrew Meadows
bc48f70877 move IKTarget into its own files 2015-10-12 11:39:54 -07:00
Andrew Meadows
56f038d5a7 simpler logic for tracking hips offset 2015-10-12 11:39:54 -07:00
Andrew Meadows
03eaa95258 initial hip translation from IK
works for 2D 3rd person but probably not well for HMD
2015-10-12 11:39:54 -07:00
Brad Davis
6f5f6450df Cleanup CMake files 2015-10-11 00:01:03 -07:00
Anthony J. Thibault
1c2f86f8b7 Fix for sending translation for non-animated joints.
Only the JointState._defaultTranslation needs to be multiplied
by the unitScale in JointState::translationIsDefault().  This
was incorrectly flagging some non-animated joints as animated.
2015-10-08 17:50:22 -07:00
Andrew Meadows
6c2a94fddb remove unused method declarations 2015-10-07 14:17:21 -07:00
Brad Hefta-Gaub
7a85e5b7a7 rename frameIndex to currentFrame 2015-10-07 13:02:58 -07:00
Brad Hefta-Gaub
ef054ffc6d Merge branch 'master' of https://github.com/highfidelity/hifi into animationGroupSettings
Conflicts:
	libraries/networking/src/udt/PacketHeaders.cpp
	libraries/networking/src/udt/PacketHeaders.h
2015-10-07 11:27:50 -07:00
Brad Hefta-Gaub
6eeb64b032 CR feedback 2015-10-07 11:23:24 -07:00
Andrew Meadows
224fc55033 put IK targets in skeleton's model-frame 2015-10-06 16:49:29 -07:00
Brad Hefta-Gaub
016bf4011d cleanup 2015-10-06 16:07:36 -07:00
Brad Hefta-Gaub
1319642a59 fix frame jumping behavior on restart 2015-10-06 15:59:35 -07:00
Brad Hefta-Gaub
be79101a93 Merge branch 'master' of https://github.com/highfidelity/hifi into animationGroupSettings 2015-10-06 15:20:37 -07:00
Anthony J. Thibault
75849db867 Changed (float)fabs() to fabsf() 2015-10-05 12:00:02 -07:00
Brad Hefta-Gaub
f618a2adfa gak - get streaming working again 2015-10-02 17:06:32 -07:00
Anthony J. Thibault
b6b57de1c6 animation lib warning fixes 2015-10-02 16:42:50 -07:00
Brad Hefta-Gaub
57bf69cc48 Merge branch 'master' of https://github.com/highfidelity/hifi into animationGroupSettings
Conflicts:
	libraries/entities/src/ModelEntityItem.cpp
	libraries/networking/src/udt/PacketHeaders.cpp
2015-10-02 14:19:15 -07:00
Brad Hefta-Gaub
02536a5ab9 remove animationSettings from particles, add isEmitting 2015-10-02 14:17:01 -07:00
Brad Hefta-Gaub
e6fb587a8c Merge branch 'master' of https://github.com/highfidelity/hifi into animationGroupSettings 2015-10-02 13:04:14 -07:00
Brad Hefta-Gaub
b27396606b fix first run 2015-10-02 12:34:46 -07:00
Anthony J. Thibault
c0be32d359 Fix for model offset when using Rig Animations. 2015-10-02 11:40:46 -07:00
Anthony J. Thibault
fc7b6dee84 Merge branch 'master' into transmit-joint-translation 2015-10-02 11:40:33 -07:00
Anthony J. Thibault
a1b54945d6 Compute the model offset in the rig, using the bind pose of the hips. 2015-10-02 10:34:34 -07:00
Brad Hefta-Gaub
cf2693e712 working fistFrame lastFrame 2015-10-02 08:31:22 -07:00
Anthony J. Thibault
fa864d29f9 Merge branch 'master' into transmit-joint-translation 2015-10-01 16:55:24 -07:00
Howard Stearns
53e7d5fd7c Merge pull request #5975 from AndrewMeadows/cleanup-legacy-constraints
remove cruft relating to old verlet avatar skeleton simulation
2015-10-01 16:48:33 -07:00
Anthony J. Thibault
fe5ea471a1 AnimClip: read in translations from fbx file and pre-process them
Do the following things to the translations

  1. scale by the model offset, this should move the translations into the correct units (meters).
  2. compute the ratio between the bone length in the animation and the skeleton.
  3. subtract the anim translation from the first translation frame in the animation
     effectively turning it into a bind pose delta translation.
  4. apply bone length ratio to the resulting delta.
  5. set the final translation to be the skeleton rel bind pose + this scaled delta translation
2015-10-01 16:10:33 -07:00
Brad Hefta-Gaub
afe5075e10 Merge pull request #5971 from howard-stearns/AnimVariant-warning-squash
Squash compiler warning in AnimVariant.
2015-10-01 14:41:40 -07:00
Howard Stearns
739545794f Merge pull request #5944 from AndrewMeadows/ik-repairs-007
fix bug: IK attenuates fast underpose animations
2015-10-01 14:27:21 -07:00
Andrew Meadows
09ac01a5e7 remove cruft from old verlet avatar simulation 2015-10-01 13:44:50 -07:00
Brad Hefta-Gaub
91a27e3adf get animation to actually run again 2015-10-01 13:29:07 -07:00
Seth Alves
25cbebb66c Merge branch 'transmit-joint-translation' of github.com:sethalves/hifi into transmit-joint-translation 2015-10-01 13:24:04 -07:00
Seth Alves
8453043038 remove unused variable 2015-10-01 13:23:51 -07:00
Brad Hefta-Gaub
aca25bd76e connect up AnimationPropertyGroup to AnimationLoop 2015-10-01 11:05:16 -07:00
Howard Stearns
335d87134b Squash compiler warning in AnimVariant. 2015-10-01 10:58:31 -07:00
Anthony J. Thibault
d993d39718 Bug fix for deriveBodyFromHMDSensor calculations
The calculation that determined where the body position relative to the HMD
was incorrect, one of the components was in the wrong coordinate frame.

Now use the skeleton's bind pose to compute the proper avatar offsets for the eyes, neck and hips.
Use these offsets to calculate where the hips should be given a specific hmd position and orientation.

Also, added a bug fix for Rig, which would cause a -1 index deference when an avatar was missing
certain named joints, such as, "LeftEye", "Neck" and "Head".
2015-09-30 16:28:33 -07:00
Andrew Meadows
b192d0a9cd make neck IK target type same as head 2015-09-29 17:39:17 -07:00
Anthony J. Thibault
5e2279ed4b AnimManipulator: Don't read defaultAbsPose.trans anim var.
At the moment the manipulator only supports rotations.
2015-09-29 16:37:43 -07:00
Andrew Meadows
a052f5e125 remove commented out debug line 2015-09-29 16:21:08 -07:00
Andrew Meadows
cdae16e07b fix bug: IK attenuates fast underpose animations 2015-09-29 16:11:27 -07:00
Howard Stearns
745a59af1c Default animation is anim graph.
Remove state change logging from animation graph state machine.
2015-09-29 12:48:57 -07:00
Seth Alves
4179e4aa74 merge from upstream 2015-09-28 15:28:10 -07:00
Seth Alves
04eed64c7c fix bug in JointState::translationIsDefault 2015-09-28 15:26:32 -07:00
Anthony J. Thibault
a495a45ed0 unset "lean" when headParams.enableLean is false
Also added AnimVariantMap::dump() which will print out all the
currently set anim vars and their values.
2015-09-28 11:10:22 -07:00
Anthony J. Thibault
c970ff0c0c Reset joint priorities back to 0 for new animation system.
Added Rig::clearJointStatePriorities() to do this.
2015-09-27 18:25:28 -07:00
Anthony J. Thibault
4b31d87bf5 renamed magic constant to FRAMES_PER_SECOND. 2015-09-27 17:52:53 -07:00
Anthony J. Thibault
5a24a020ca Fix for HMD rotation sticking between 2d & HMD mode
The main fix for this was to set the JointState animation priority to 3.0
The secondary fix was only noticed when we changed the animation priority
Basically, the debugRendering was using the JointStates after they were
manipulated by SkeletonModel to 'relax' them toward thier default pose for
IK purposes.
2015-09-27 17:44:54 -07:00
Anthony J. Thibault
a2562c92f4 Small changes to Anim System for Debugging
* Added constant for Rig animation fade time
* Added index output for AnimSkeleton::dump()
2015-09-27 16:24:55 -07:00
Seth Alves
50dd8eba45 Relay joint translations across network. Apply animation's root-joint translation to avatar. 2015-09-26 11:40:39 -07:00
Andrew Meadows
a97f556958 enforce IK target rotation 2015-09-25 15:13:57 -07:00
Howard Stearns
266c69fc70 Disable the old-school Rig::inverseKinematics during reset. 2015-09-24 15:33:52 -07:00
Andrew Meadows
59da684eb9 make IKTarget::setType() a one-liner 2015-09-24 13:15:03 -07:00
Andrew Meadows
17e3e9394f allow head translation for 3rd person screenie IK 2015-09-24 12:38:46 -07:00
Brad Hefta-Gaub
5e82b9c433 more warning fixes 2015-09-24 08:26:56 -07:00
Anthony J. Thibault
6b47373bcb Fix for precision error in AnimPose(glm::mat4) constructor.
Really the culprit is GLMHelpers extractRotation().
I have a separate unit test that demonstrates the bug.
2015-09-23 15:38:56 -07:00
Anthony J. Thibault
a454584496 Updated default avatar-animation.json 2015-09-23 10:59:52 -07:00
Anthony J. Thibault
a9848cd157 Merge branch 'master' into tony/lean-threshold 2015-09-23 10:54:12 -07:00
Anthony J. Thibault
9ce43a57f1 Better head IK when in an HMD.
Because the current IK system doesn't quite handle what we need
for the head and neck IK, we do it procedurally in the rig, and
manually set both neck and head IK targets.
2015-09-22 19:58:21 -07:00
Anthony J. Thibault
d53295655f Fixes for empty poses
This can happen when an animation is evaluated before it is finished loading.
2015-09-22 19:54:51 -07:00
Andrew Meadows
d25ba8946e fix animation attenuation from IK relaxation step 2015-09-22 17:20:26 -07:00
Howard Stearns
7e52d38870 Don't include the root rot, because it seems that this is already accounted for in the head params.
Restore the hmd conditional on setting head position. This had been removed when failing to pin it cause lean.
I believe that lean was being caused by coordinate system issues that are now addressed by the above and Andrew's big cleanup.
2015-09-22 10:12:59 -07:00
Howard Stearns
8f1dde69cc Always keep targets, even when both position and rotation are unset. (Get from underpose.)
Filtering these was necessary before when the underpose coordinate was wrong, but now that we have that working, there shouldn't be any need to filter.
2015-09-22 10:10:29 -07:00
Andrew Meadows
3869887610 splitting AnimNode implementation into two files 2015-09-21 17:53:59 -07:00
Andrew Meadows
e6776ef5eb split AnimIK::evaluate() into sub-functions
also IK targets now in model-frame instead of root-frame
2015-09-21 17:29:39 -07:00
Anthony J. Thibault
eadf212418 Updated avatar.json with talking idle animation. 2015-09-18 18:31:53 -07:00
Anthony J. Thibault
44eb448cbe Hooked up isTalking flag to Rig and AnimGraph. 2015-09-18 18:05:51 -07:00
Andrew Meadows
07f3abfc91 fix bugs 2015-09-18 12:01:23 -07:00
Andrew Meadows
4cb2249cda premature optimization: remove another branch 2015-09-18 10:16:19 -07:00
Andrew Meadows
a85afb5280 simplify logic of RotationAccumulator::add() 2015-09-18 10:13:21 -07:00
Andrew Meadows
6ed0a57d9f avoid unecessary computation of last absolutePose 2015-09-18 10:09:23 -07:00
Andrew Meadows
9e94e7f1d0 less complicated RotationAccumulator 2015-09-18 07:11:36 -07:00
Andrew Meadows
b6a153d926 split RotationAccumulator into its own files 2015-09-17 22:30:44 -07:00
Andrew Meadows
420acde720 blend IK effects between distinct end effectors 2015-09-17 22:11:59 -07:00
Andrew Meadows
4505d5999c route hand data differently for new Anim system 2015-09-17 16:04:00 -07:00
Andrew Meadows
9746d31f5e notes for moving hand updates 2015-09-17 16:04:00 -07:00
Anthony J. Thibault
bef136d811 AnimGraph: prefer QString over std::string 2015-09-17 11:21:14 -07:00
Andrew Meadows
e1fc1900ab remove IK 'flutter' bug 2015-09-16 17:02:12 -07:00
Andrew Meadows
d4ea661aca cleanup whitespace 2015-09-16 17:02:12 -07:00
Andrew Meadows
9a86fc2e62 build local list of IK targets every frame 2015-09-16 17:02:12 -07:00
Andrew Meadows
089c719612 minor cleanup 2015-09-16 17:02:12 -07:00
Anthony J. Thibault
5aeebba90e Renamed AnimController to AnimManipulator, Removed offsets on IK targets 2015-09-16 15:49:47 -07:00
Anthony J. Thibault
fae4b08eb0 AnimController Node Bug fixes
AnimController: proper support for alpha
AnimController: bug fix for translation.
AnimOverlay: renamed local var when building hand boneSets from head to hand.
2015-09-16 15:11:53 -07:00
Howard Stearns
f6b5f3925a Place head at requested position in all modes. (At least, until we can figure out how to get underpose position cleanly without tilt.) 2015-09-15 16:43:52 -07:00
Howard Stearns
848bb4fccb Merge pull request #5813 from hyperlogic/tony/anim-hand-state-machines
Added point and grab support to the AnimGraph
2015-09-15 15:47:19 -07:00
Anthony J. Thibault
1948829ca8 Improved state machine for right hand.
The hand state machine has the following features

* There's a idle to point animation, followed by a looping point hold state.
* There's a point to idle animation.
* The grab state is composed of a linear blend between an open and closed pose.

Additionally the C++ code will ramp on the left and right hand overlays,
This allows the fingers to be animated normally when the user is not actively
pointing or grabbing.
2015-09-15 15:09:08 -07:00
Clément Brisset
cb1b70820a Merge pull request #5801 from AndrewMeadows/fix-animation-tests
fix animation unit tests
2015-09-15 17:53:06 +02:00
Anthony J. Thibault
90f46ba2c8 Added hand state machines to AnimGraph.
* Application: Forward trigger values to the MyAvatar's PalmData
* SkeletonModel: Pass PalmData to Rig via updateRigFromHandData() this is more explicit then
  the Rig::inverseKinematics methods.
* AnimNodeLoader & AnimOverlay: add support for LeftHand and RightHand bone sets
* Rig::updateRigFromHandData() read the triggers and set stateMachine trigger vars
* avatar.json - udpated with new hand state machine with temporary animations
2015-09-14 18:54:12 -07:00
Andrew Meadows
d74628720f fix bug using unitialized std::vector elements 2015-09-14 17:14:04 -07:00
Andrew Meadows
75ec142827 fix animation-tests 2015-09-14 16:42:57 -07:00
Andrew Meadows
a72199a7df minor IK tuning 2015-09-14 14:44:17 -07:00
Howard Stearns
4ffe2d0747 Merge pull request #5786 from AndrewMeadows/ik-with-constraints
inverse kinematics works with rotation constraints
2015-09-11 17:34:50 -07:00
Andrew Meadows
1500a36f72 oops forgot to uncomment constraint initialization 2015-09-11 16:49:49 -07:00
Howard Stearns
140ecc8e2c Get rid of implicit int->bool cast. 2015-09-11 16:28:41 -07:00
Andrew Meadows
d01c5d1ae5 fix crash bug 2015-09-11 15:01:31 -07:00
Andrew Meadows
2ba446d309 fix IK and constriants 2015-09-11 13:22:12 -07:00
Andrew Meadows
b0520acea9 remove warning about out-of-order-init 2015-09-11 13:22:11 -07:00