Commit graph

24 commits

Author SHA1 Message Date
Anthony J. Thibault
75849db867 Changed (float)fabs() to fabsf() 2015-10-05 12:00:02 -07:00
Anthony J. Thibault
b6b57de1c6 animation lib warning fixes 2015-10-02 16:42:50 -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
Seth Alves
50dd8eba45 Relay joint translations across network. Apply animation's root-joint translation to avatar. 2015-09-26 11:40:39 -07:00
Anthony J. Thibault
bef136d811 AnimGraph: prefer QString over std::string 2015-09-17 11:21:14 -07:00
Anthony J. Thibault
91fbbf7d4e Updated copyright boiler plate. 2015-09-02 13:35:26 -07:00
Anthony J. Thibault
9786954585 Added support for onDone and onLoop triggers. 2015-08-31 12:13:05 -07:00
Anthony J. Thibault
77b857031b Take timeScale into account during interps & setCurrentFrame() 2015-08-31 11:01:15 -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
Anthony J. Thibault
b7a9b54628 Better AnimDebugDraw rendering 2015-08-26 16:42:08 -07:00
Anthony J. Thibault
4abf0cbd63 AnimVariantMap is used in eval, MyAvatar loads avatar.json via url 2015-08-25 20:28:17 -07:00
Anthony J. Thibault
496c706bba Added AnimVariantMap argument to evaluate. 2015-08-25 11:59:24 -07:00
Anthony J. Thibault
4bdb00bbc5 Added setCurrentFrame interface to AnimClip.
This will recurse the tree and call setCurrentFrameInternal on each node.
This method can be overriden, currently the only meaningful implementation is AnimClip.
2015-08-25 09:58:36 -07:00
Anthony J. Thibault
1f8c8adbd6 Added AnimOverlay node, moved blend sub-routine into AnimUtil. 2015-08-05 17:05:53 -07:00
Anthony J. Thibault
5d83976e2a Added AnimBlendLinear + tests.
MyAvatar now does a sine wave blend between a walk
and a walk animation.
2015-08-04 18:14:50 -07:00
Anthony J. Thibault
559367db4a Got to the bottom of the bind pose question.
When TRUST_BIND_TRANSFORM is defined in AnimSkeleton, the bind pose is taken
from the FBXJoint::bindTransform field, which is correct for all joints
bound to actual geometry.  Basically it's not trust worthy for bones NOT bound to anything.

When TRUST_BIND_TRANSFORM is not defined, the bind pose is taken from the other
FBXJoint fields.  Unfortunatly these poses are NOT the bind pose, but instead
are taken from the FBX files 'resting' pose. i.e. frame 0.
2015-08-04 18:14:49 -07:00
Anthony J. Thibault
d8a20340a0 Found and fix source of memory corruption.
std::vector.reserve() and raw access do not mix.
raw access will only work if you push_back elements onto the vector
first.  However this worked fine on MacOSX, probably due to differences
in STL implementations.

Some code clean up and some commented out debugging lines.

Debug rendering of animaions of fight club model is not working.
Not sure what frame these transformations are in.
2015-08-04 18:14:49 -07:00
Anthony J. Thibault
55da34f713 Better debug rendering of animations.
* added mat4 cast and mat4 ctors to AnimPose.
2015-08-04 18:14:48 -07:00
Anthony J. Thibault
df79463750 WIP, animNode rendering 2015-08-04 18:14:48 -07:00
Anthony J. Thibault
f5dee717a1 Added fbx loading via animation cache.
* added AnimPose::copyFromNetworkAnim() which
  should, re-map bone ids to match the current
  skeleton, and fill in missing bones with bind
  pose frames.
* added ability to set a skeleton on a node.
  I might need to add a recursive version of this.
* it compiles!
* tests run!
2015-08-04 18:14:46 -07:00
Anthony J. Thibault
da809efcd6 WIP commit, DOES NOT BUILD.
* Added AnimSkeleton class
* Attempt to copy animation frames when _networkAnimation has
  finished loading.  Fill in the holes with bind pose.
2015-08-04 18:14:46 -07:00
Anthony J. Thibault
343b2ccf9d Added AnimNodeLoader which loads AnimClip nodes from json
* added tests and sample json file
2015-08-04 18:14:45 -07:00
Anthony J. Thibault
35196a0059 bare-bones AnimClip implementation with tests!
It accumulates time and handles looping, and should handle
onDone and onLoop events in the future.
2015-08-04 18:14:45 -07:00