Commit graph

17 commits

Author SHA1 Message Date
Anthony J. Thibault
401995fb06 Leg IK fixes
Fixes for raising legs and sometimes squatting while in HMD mode.
2018-07-30 10:55:52 -07:00
Anthony J. Thibault
49a95089d1 Remove hacks for debug rendering of IK targets
A AnimContext class was introduced.  This context is passed into every node during evaluation/overlay.
It holds non-animVar "global" data passed from the application.

(cherry picked from commit a028d3ba58)
2017-03-24 16:27:27 -07:00
Anthony J. Thibault
89ae3b3d6e Revert "Merge pull request #8691 from highfidelity/out-of-body-experience"
This reverts commit efe9571ab8, reversing
changes made to 333e9ec7f4.
2016-12-05 15:18:03 -08:00
Anthony J. Thibault
a028d3ba58 Remove hacks for debug rendering of IK targets
A AnimContext class was introduced.  This context is passed into every node during evaluation/overlay.
It holds non-animVar "global" data passed from the application.
2016-09-19 15:03:46 -07:00
Anthony J. Thibault
d24a024726 MyAvatar: added standing and run landing animations 2016-02-05 17:53:50 -08:00
Anthony J. Thibault
a8e092272c AnimStateMachine: added new State parameter interpType
interpType defines how the interpolation between two states is performed.

   * SnapshotBoth: Stores two snapshots, the previous animation before interpolation begins and the target state at the
     interTarget frame.  Then during the interpolation period the two snapshots are interpolated to produce smooth motion between them.
   * SnapshotPrev: Stores a snapshot of the previous animation before interpolation begins.  However the target state is
     evaluated dynamically.  During the interpolation period the previous snapshot is interpolated with the target pose
     to produce smooth motion between them.  This mode is useful for interping into a blended animation where the actual
     blend factor is not known at the start of the interp or is might change dramatically during the interp.
2016-02-04 10:32:58 -08:00
Anthony J. Thibault
936c55a94e New MyAvatar animation JS interface
JavaScript changes:

* removed MyAvatar.playAnimation
* removed MyAvatar.stopAnimation
* removed MyAVatar.getGetAnimationDetails
* removed MyAvatar.startAnimationByRole
* removed MyAvatar.stopAnimationByRole
* removed MyAVatar.getGetAnimationDetailsByRole
* removed MyAVatar.clearJointPriorities

* added MyAvatar.overrideAnimation(url, fps, loop, firstFrame, lastFrame)
* added MyAvatar.restoreAnimation()
* added MyAvatar.getAnimationRoles()
* added MyAvatar.overrideRoleAnimation(role, url, fps, loop, firstFrame, lastFrame)
* added MyAvatar.restoreRoleAnimation(role)
* added MyAvatar.prefetchAnimation(url)

* update kneel.js with new api.
* added theBird.js to test role override api.

C++ changes:

* Added getParent() and replaceChild() to AnimNode
* Added findByName() and traverse() to AnimNode
* Changed AnimStateMachine to hold nodes by childIndex instead of smart pointer.
  This allows script to replace nodes dynamically via overrideRoleAnimation
2015-11-10 16:34:38 -08: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
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
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
Anthony J. Thibault
bef136d811 AnimGraph: prefer QString over std::string 2015-09-17 11:21:14 -07:00
Anthony J. Thibault
46b3a7fd23 Improved default avatar.json state machine.
Now triggers 7 states.
Idle, WalkFwd, WalkBwd, StrafeLeft, StrafeRight, TurnLeft & TurnRight.
As well as variable speed walking to match current velocity.
2015-09-02 17:28:06 -07:00
Anthony J. Thibault
91fbbf7d4e Updated copyright boiler plate. 2015-09-02 13:35:26 -07:00
Anthony J. Thibault
0d98ab3365 Normalize scale on AnimSkeleton bind pose. 2015-08-31 17:27:23 -07:00
Anthony J. Thibault
9786954585 Added support for onDone and onLoop triggers. 2015-08-31 12:13:05 -07:00
Anthony J. Thibault
19e91bb392 Added basic interpolation support to AnimStateMachine 2015-08-27 21:26:31 -07:00
Anthony J. Thibault
3286a32afc Initial version of AnimStateMachine.
No interpolation support, but basic avatar.json is working
with two states and two transitions between them.
2015-08-27 20:41:53 -07:00