Commit graph

604 commits

Author SHA1 Message Date
Anthony J. Thibault
8e5785cdf8 Avatar animations are now stored locally
Improves FTUE, by no longer going over the network to download default avatar animations.
This also includes support for relative animation urls within the animation.json
2016-04-19 16:11:14 -07:00
Zach Pomerantz
fc61f85bf9 Merge pull request #7698 from hyperlogic/tony/avatar-on-load-complete-callback
Added MyAvatar onLoadComplete Callback
2016-04-19 10:36:20 -07:00
Anthony J. Thibault
1f383680aa Rig: removed unnecessary emitOnLoadComplete method 2016-04-18 13:35:13 -07:00
Omega Hereon [J.L.]
b3b58b8176 Fix instances of error: isnan was not declared in this scope with GCC5.3/Ubuntu 16.04
In all but these 3 files isnan is glm::isnan
2016-04-18 18:45:15 +00:00
Anthony J. Thibault
1682598be7 Added onLoadComplete signal to MyAvatar
This can be used in javaScript to detect when the model has finished loading because the url has changed or the model has been reset.
2016-04-18 11:37:02 -07:00
Joe Large [Omega Heron]
be208ba682 Revert "Correct references to isnan to glm::isnan for compat with Ubuntu 16.04/GCC 5.3"
Moving this to a branch.

This reverts commit b88fc62b97.
2016-04-16 18:24:50 -04:00
Joe Large [Omega Heron]
b88fc62b97 Correct references to isnan to glm::isnan for compat with Ubuntu 16.04/GCC 5.3 2016-04-16 17:46:37 -04:00
Brad Hefta-Gaub
a7b5ea50d7 Merge pull request #7670 from hyperlogic/tony/validate-anim-state-handler-args
Validate arguments to MyAvatar.addAnimationStateHandler()
2016-04-15 14:26:22 -07:00
Anthony J. Thibault
38418d0169 Moved isListOfStrings into shared/ScriptValueUtils
Also fixed some single line ifs.
2016-04-15 13:47:30 -07:00
Howard Stearns
e4f8a67e60 Merge pull request #7649 from hyperlogic/tony/simplify-away-mode
away.js: fix for permanent disabling avatar IK
2016-04-15 13:35:14 -07:00
Brad Hefta-Gaub
21f30f1a10 Merge pull request #7672 from zzmp/fix/name-caches
Name exposed cache objects
2016-04-14 18:02:36 -07:00
Zach Pomerantz
bb02af793c Name exposed cache objects 2016-04-14 17:00:18 -07:00
Anthony J. Thibault
253e4cbb73 validate arguments to MyAvatar.addAnimationStateHandler()
Also validate arguments to MyAvatar.removeAnimationStateHandler() and the return result from the user provided callback function.
2016-04-14 16:25:17 -07:00
Anthony J. Thibault
a1bbb63ec4 Rig: save and restore user animations across resets 2016-04-12 14:51:17 -07:00
Atlante45
05895f628a Revert to using a Resource 2016-04-12 13:51:11 -07:00
Atlante45
5eb4f63573 Use ResourceManager in anim loader 2016-04-12 13:51:11 -07:00
Atlante45
afdfef1482 Make sure we don't use raw resource ptr 2016-04-12 13:51:11 -07:00
Zach Pomerantz
9d3abe5513 Release texs when models are cached 2016-03-31 17:02:40 -07:00
Anthony J. Thibault
80dfed77d7 Fix for flickering eyeballs
Calling glm::axis() on an identity quaternion does not result in a normalized vector.
This vector was used within Rig::updateEyeJoint() to limit the rotation of the eye balls,
to prevent the eyes from rolling back into the avatar's head.

If the avatar was looking straight ahead, this could result in bad quaternions in the eye ball
joint matrices, which in turn would cause the eye ball mesh or any mesh influenced by the eyeball joints
not to render.
2016-03-29 10:01:10 -07:00
Anthony J. Thibault
b4e70d9101 WIP: checkpoint
* bug fix in AABox::operator+=
* added AABox::emiggen
* Avatar now has a default bound for it's skinned mesh.
* WIP: AABox tests;  NEED MORE
* Model: split collision and model mesh render items.
  Because ModelMeshRenderItems need special handling to update bounds for animated joints.
* Model: dynamically update the bound for rigidly bound animated meshes
* Rig: added access to geometryToRigTransform
* RenderableModelEntityItem: try to update bounds for skinned mesh to be the entity dimentions (this doesn't seem to be working)
* Geometry.cpp: removed unused bounds parameter in evalPartBounds
* ModelMeshPartPayload: bounds updating
   * non-animated: use existing _localBound
   * rigid bound mesh: use _localBound transformed by clusterMatrix joint transform
   * fully skinned mesh: use _skinnedMeshBound provided by the application.
2016-03-25 21:29:20 -07:00
Zach Pomerantz
aad40f5de0 Drop network data after processing 2016-03-25 09:58:34 -07:00
Brad Davis
0ac70049c7 Merge pull request #7431 from hyperlogic/tony/vive-rendering-work
OpenVR rendering & Nsight instrumentation improvements
2016-03-24 17:44:30 -07:00
Ozan
003af03b33 Merge pull request #7400 from Menithal/default-use-pre-post
Set UserAnimPreAndPostRotations true by Default
2016-03-24 09:57:03 -07:00
Anthony Thibault
50ac101d56 Avatar and Rig NSIGHT instrumentation 2016-03-22 10:36:32 -07:00
Anthony J. Thibault
df5afffc77 AnimUtil: prevent accumulateTime from looping forever
This might happen with large dts, large timeScales.
2016-03-21 11:58:13 -07:00
Menithal
cdbb7b2ad4 Set UserAnimPreAndPostRotations true by Default
If Blender avatars are animated by Blender animations, they have missing
Pre and Post rotations. This step is no longer necessary to have false,
and also makes sure all animations from Blender Work on all avatars (from
other platforms).

This commit make it default to be enabled:
2016-03-19 12:49:57 +02:00
Andrew Meadows
e81e49b32e prevent crash in SwingTwistConstraint 2016-03-18 15:59:25 -07:00
Brad Hefta-Gaub
447918d148 Merge pull request #7348 from hyperlogic/tony/cppcheck-fixes
Avatar & Animation cppcheck static analysis fixes
2016-03-14 18:58:25 -07:00
Anthony J. Thibault
16a57bda81 SwingTwistConstriant: fix for bad index. 2016-03-14 17:30:53 -07:00
Anthony Thibault
9f30556084 libraries/animation: cppcheck fixes
* Fix for potential bug in AnimLoop due to _maxFrameIndexHint being uninitialized.
* made more single argument constructors explicit.
2016-03-13 17:17:34 -07:00
Anthony Thibault
11fcf00b2a AnimSkeleton.h: made single argument ctors explicit 2016-03-13 16:55:34 -07:00
Anthony Thibault
02b2281def AnimVarient.h: cppcheck fixes
* make all constructors explicit.
* remove static string comparison in assert.
2016-03-13 16:51:57 -07:00
Andrew Meadows
48efbba335 use dynamic constraints for IK 2016-03-11 14:47:48 -08:00
Andrew Meadows
c9f988d340 dynamic adjustment for twist 2016-03-11 14:47:47 -08:00
Andrew Meadows
4b75144797 remove debug cruft 2016-03-11 14:47:47 -08:00
Andrew Meadows
749dcf2c1d dynamic adjustment for swing 2016-03-11 14:47:47 -08:00
Andrew Meadows
6ebb94b1f4 minor API cleanup of SwingLimitFunction API 2016-03-11 14:47:47 -08:00
Andrew Meadows
df9ccf76ab fix animation-tests 2016-03-11 14:47:47 -08:00
Anthony J. Thibault
9351d5edca Rig: warning fix & comments 2016-03-10 12:55:01 -08:00
Anthony J. Thibault
4a78300607 MyAvatar: Allow user to raise hands directly overhead.
Previously we were using a infinitely tall vertical cylinder
to push hand IK targets out of the body, this had the
side-effect of preventing the hands from being raised over
the head.  Now, we collide against the same 3d capsule
used by the physics system for avatar collisions.
2016-03-10 10:20:17 -08:00
Zach Pomerantz
54af58834a Mark Resource loaded after postprocessing 2016-03-09 10:34:07 -08:00
Chris Collins
7850ca3576 Merge pull request #7227 from hyperlogic/tony/eye-look-at-fixes
Avatar eye look at fixes for HMD and desktop
2016-03-07 11:50:16 -08:00
Andrew Meadows
c06d76f7f0 remove twist constraints on hands
also tighten swing limit on shoulder
2016-03-04 10:56:29 -08:00
Anthony J. Thibault
3cde972174 Rig: issue warnings for missing joints
Also, Removed Rig::computeEyesInRigFrame, it was causing warnings because it was looking up
Eye and Head joints for all models, not just avatars.
2016-03-01 11:07:22 -08:00
Anthony J. Thibault
460582239a Avatar eye look at fixes for HMDs
There were three things that were causing issues with eye look at vectors while wearing an HMD.

1) The matrix returned by AvatarUpdate->getHeadPose() was in the wrong space, it should be in avatar space.
   it was actually returning a matrix in sensor/room space.
2) The lookAtPosition was incorrect while wearing an HMD and with no avatars to look at.
3) The eye rotation limits in Rig::updateEyeJoint were relative to the model's zero orientation, NOT relative to the head.
   this was causing the eyes to hit limits when the avatar head turned.
2016-02-29 18:02:50 -08:00
Anthony J. Thibault
613b60658e Rig: prevent normalization of a zero vector 2016-02-18 10:24:36 -08:00
Anthony J. Thibault
73ac47724a Rig: Prevent the hand IK targets from entering the body.
Use a 2d circle/circle intersection test to keep the hands outside of the body.
2016-02-17 16:23:18 -08:00
Anthony J. Thibault
3426173d1d AnimInverseKinematics: open up shoulder swing constraint. 2016-02-17 11:44:11 -08:00
Anthony J. Thibault
2d1304e070 AnimInverseKinematics: use glm::clamp for clarity. 2016-02-16 18:00:45 -08:00
Anthony J. Thibault
b5a72225db AnimInverseKinematics: renamed variable for extra style points 2016-02-16 17:42:51 -08:00
Anthony J. Thibault
df21fffa4a AnimInverseKinematics: fix for extra twist in lowerSpine joints.
* When computing tipPosition, for the next iteration of the CCD,
  use the leverArm before it's projected onto the lowerSpine twist axis.
* fix for acos() that was going outside of valid domain. (-1.0, 1.0)
2016-02-16 17:31:39 -08:00
Andrew Meadows
d6a716a1aa only head and torso for bounding capsule radius 2016-02-15 10:29:29 -08:00
Seth Alves
af6bb50f74 fix warning 2016-02-10 12:09:28 -08:00
Seth Alves
6fea0b9396 also make sure tau is >= 1.0 2016-02-10 11:20:56 -08:00
Seth Alves
b3b053ce18 if delta-time is more than 1/30th of a second, clamp it to avoid crazy ik induced orbits when main thread is blocked 2016-02-10 09:52:29 -08:00
Seth Alves
43592fd699 Merge pull request #7048 from hyperlogic/tony/avatar-on-moving-platform
Better avatar animation when attached to a moving entity
2016-02-09 14:30:02 -08:00
Brad Davis
7d99f9e72f PR comments 2016-02-09 10:16:44 -08:00
Brad Davis
421160eeb6 Make the file parsing threads run at lower priority 2016-02-08 23:55:02 -08:00
Anthony J. Thibault
2667fe3c24 Merge branch 'master' into tony/avatar-on-moving-platform 2016-02-08 14:32:46 -08:00
Anthony J. Thibault
20a38f613e Rig: remove position delta based velocity.
In general, the physics body velocity is MUCH more behaved now.
2016-02-08 14:30:28 -08:00
Philip Rosedale
63afa8c1ed Merge pull request #7040 from hyperlogic/tony/landing-animation
MyAvatar: added standing and run landing animations
2016-02-08 11:38:12 -08:00
Brad Hefta-Gaub
eebf6f8883 Merge pull request #7021 from hyperlogic/tony/animation-mirror-support
AnimClip: Animation mirror support
2016-02-05 19:25:01 -08:00
Anthony J. Thibault
d24a024726 MyAvatar: added standing and run landing animations 2016-02-05 17:53:50 -08:00
Anthony J. Thibault
bfeace78f7 AnimInverseKinematics: warning fixes 2016-02-04 18:51:48 -08:00
Anthony J. Thibault
51189cfc50 AnimInverseKinematics: opened up UpLeg and Leg constraints
This improves the quality of the jump animations, while IK is enabled.
2016-02-04 17:56:41 -08:00
Anthony J. Thibault
8ca8550f26 MyAvatar: Standing Takeoff and In-Air Animations
Now there are two sets of of jump takeoff and in-air animations.
* Run - Used when the character jumps or falls with a small forward velocity.
* Standing - Used when the character jumps or falls in-place or backward.

CharacterController
* increased takeoff duration to 250 ms
* increased takeoff to fly duration to 1100 ms
* added standing jump and in-air animations
* added 250 milisecond delay between ground and hover, to prevent going into hover when walking over cracks.
* take-off to in-air transitions now use the new snapshotPrev interp type for a smoother tweening.
2016-02-04 17:56:07 -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
Andrew Meadows
861082964e Merge pull request #7017 from hyperlogic/tony/fly
MyAvatar: Improved Jump / InAir / Fly behavior
2016-02-03 12:22:30 -08:00
Stephen Birarda
93530fca72 fix the last of the current override warnings for OS X 2016-02-03 11:08:41 -08:00
Anthony J. Thibault
03d5bc885b AnimClip: added mirrorFlag anim var 2016-02-02 17:10:15 -08:00
Anthony J. Thibault
e6abc026c8 AnimClip: mirror animation support 2016-02-02 17:02:29 -08:00
Anthony J. Thibault
656608e2ff Fixes for away.js 2016-02-02 12:08:52 -08:00
Anthony J. Thibault
47f3ce3786 CharacterController jump is more reliable. 2016-02-02 11:26:16 -08:00
Anthony J. Thibault
2936811484 Added takeoff animation, WIP
Character controller still has some jump/in-air bugs.
2016-02-02 11:26:15 -08:00
Anthony J. Thibault
61c55ebf6c Updated character controller with a state enumeration
Also, adjusted checkForSupport logic such that very slanted walls are not considered support.
2016-02-02 11:26:15 -08:00
Anthony J. Thibault
e9fd439ffd Added inAir animations 2016-02-02 11:23:46 -08:00
Andrew Meadows
71664dffae change string comparisons to be CaseSensitive 2016-02-01 09:50:01 -08:00
Andrew Meadows
de54a0ac4b remove cruft 2016-01-29 14:51:24 -08:00
Andrew Meadows
14ec1b6295 reduce hand IK coupling to hip position 2016-01-29 14:28:56 -08:00
Andrew Meadows
a98459dfa8 minor IK optimization: changed accumulators only 2016-01-29 14:28:56 -08:00
Andrew Meadows
449d566d2a properly track lowestMovedIndex 2016-01-29 14:28:56 -08:00
Andrew Meadows
48f6a9c05f fix IK looping error after minor refactor 2016-01-29 14:28:56 -08:00
Andrew Meadows
7b3f688a17 pull CCD IK solution pass into protected method 2016-01-29 14:28:56 -08:00
Andrew Meadows
1b45f5cc0c tweaks to neck and spine constraints 2016-01-27 14:45:09 -08:00
Andrew Meadows
f67a20ee68 apply _hipsOffset in hips local-frame 2016-01-27 14:45:08 -08:00
Andrew Meadows
00715f1906 apply "hips offset" to root of state graph
(Somemtimes the hips are not the root.
I'm looking at YOU blender!)
2016-01-27 14:45:06 -08:00
Anthony Thibault
3cdd88e06c Merge pull request #6951 from ZappoMan/fixAnimationRestart
fix for animations stopping after domain restart
2016-01-27 14:31:27 -08:00
Howard Stearns
0d257b82fa Merge pull request #6934 from hyperlogic/tony/anim-pre-post-rot-support
Avatar Developer Menu: added animation debug options
2016-01-27 10:39:25 -08:00
Brad Hefta-Gaub
f178fc789c fix for animations stopping after domain restart 2016-01-26 18:44:34 -08:00
Anthony J. Thibault
33993b8c44 AnimClip: removed unused static member. 2016-01-26 13:34:21 -08:00
Anthony J. Thibault
69d833a6c0 AnimClip: consistent application of translations
Apply animation translation the same way regardless of state of usePreAndPostPoseFromAnimation.
2016-01-26 10:53:21 -08:00
U-GAPOS\andrew
2728290ffb fix bug in IK and tune head/neck constraints 2016-01-26 09:37:33 -08:00
Anthony J. Thibault
3b062b7a31 AnimClip: special case the translation on the eyes 2016-01-25 18:52:14 -08:00
Anthony J. Thibault
3cee3cbb5a Avatar Developer Menu: added animation debug options
This options are for for developers only and might help debug animation related issues.

* Enable Inverse Kinematics: this can be toggled to disable IK for the avatar.
* Enable Anim Pre and Post Rotations: this option can be used to use FBX pre-rotations from source avatar animations, instead of the current default, which is to use them from the source model.
  This only effects FBX files loaded by the animation system, it does not affect changing model orientations via JavaScript.
2016-01-25 18:52:13 -08:00
Anthony J. Thibault
1bdeeeceeb AnimSkeleton: Added getPre and Post rotation accessors 2016-01-25 18:52:12 -08:00
Anthony J. Thibault
7af20e90c8 Hooked up fly animation to json and Rig 2016-01-22 13:47:09 -08:00
Anthony J. Thibault
cac19b8579 grab animation work
Hand animations now have 5 states:

* idle
* open
* grasp
* point
* farGrasp

The handControllerGrab.js script now chooses one of these five animations, based on the state of the HandController object.

Also, removed hand trigger AnimVar setting from C++ Rig class.
2016-01-07 19:36:57 -08:00
Anthony J. Thibault
3e6ff0eb68 Moved hand animation control into grab script. 2016-01-05 19:56:56 -08:00
Brad Hefta-Gaub
02835fc960 Merge pull request #6702 from hyperlogic/tony/soft-attachments
Soft Attachment Support
2016-01-03 08:46:16 -10:00
Brad Davis
76eba89f7d Merge pull request #6745 from hyperlogic/tony/neuron-plugin
Support for Perception Neuron
2015-12-30 11:39:32 -05:00