Updated Animator documentation

This commit is contained in:
Pascal Serrarens 2023-01-05 15:53:42 +01:00
parent 9f8f819666
commit afb4a704ef
5 changed files with 82 additions and 23 deletions

View File

@ -1,15 +0,0 @@
namespace Passer.Humanoid {
/// \page AnimatorDoc Animator
///
/// Animations can be used when other trackers are not tracking or not available. They
/// can be enabled using the Animator option in the Input section of the Humanoid
/// Control script.
/// By default, the animator uses a builtin procedural animation. This is overridden
/// when setting the Runtime Animator Controller parameter which is standard Unity
/// Animator Controller.
/// Humanoid Control can control the animator controller using a number of float Animation
/// Parameters. These can be set in the Params section and refer to the Animation
/// Parameters of the Animator Controller.
}

View File

@ -0,0 +1,70 @@
namespace Passer.Humanoid {
/// \page AnimatorDoc Animator
///
/// Animations can be used when other trackers are not tracking or not available. They
/// can be enabled using the Animator option in the Input section of the Humanoid
/// Control script.
///
/// By default, the animator uses a builtin procedural animation. This is overridden
/// when setting the Runtime Animator Controller parameter which is standard
/// [Unity Animator Controller](https://docs.unity3d.com/Manual/class-AnimatorController.html).
///
/// Humanoid Control can control the animator controller using a number of float Animation
/// Parameters. These can be set in the Params section and refer to the
/// [Animation Parameters](https://docs.unity3d.com/Manual/AnimationParameters.html)
/// of the Animator Controller.
///
/// float Forward Speed | The forward/backward speed. Negative is backward walking. Unit is units(meters) per second.
/// float Sideward Speed | The left/right speed. Negative is left strafing. Unit is units(meters) per second
/// float Turn Speed | The turning speed around the Y axis. Negative is turning left. Unit is full rotations (360 degrees) per second.
/// float Head Height | The head height relative to the standing position. Negative is crouching. Positive is reaching up. Unit is meters.
///
/// Please note the unit of the parameters. Great care should be paid to this when creating the animations,
/// because it is not possible to use root motion (see below).
/// If the animation root speed does not match the required units of speed,
/// you can adjust them using the Speed parameter of the Animation State (see
/// [Unity3d Animation States](https://docs.unity3d.com/Manual/class-State.html)).
/// For example, when the turning animation is set up such that it takes 4 seconds for a full rotation,
/// the Speed parameter should be set to 0.25.
///
/// Root Motion
/// ===========
/// or the animations to work well they should not contain root motion.
/// This is because we need to be able to move the character from the VR headset,
/// not from the animation, or players will get motion sickness.
///
/// To get the right behaviour, ensure that the following options are checked on the imported animations:
///
/// Loop Time -> Loop Pose
/// Root Transform Rotation -> Bake Into PoseRoot Transform Position(Y) -> Bake Into Pose
/// Root Transform Position(XZ) -> Bake Into Pose
///
/// Animation Restrictions
/// ======================
/// The animations are controlled by the Animation Parameters which are derived from the head movements.
/// In order to match the movements of the player, the animations should be set in a specific way.
///
/// - The animation being player when Forward Speed = 1 should ensure
/// that the head speed is exactly 1 unit(meter) per second.
/// If the head speed in the animation is different you may see feet slipping
/// over the ground because the animation is played too fast or too slow.
/// - The Forward Speed should only have effect on the forward/backward (Z-axis) speed of the avatar.
/// If this is not ensured, the animations will be wrong.
/// For example when the head moves to the left when forward speed = 1, the sideward speed will also be activated,
/// resulting in unwanted animations.
/// - The same is true for the Sideward Speed and Turn Speed,
/// but then limited to the sideward (X-axis) motion and rotation along the Y axis.
/// - The Head height is used to change the vertical position of the avatar.
/// A value of -0.3 can result in a crouching with even lower values resulting in a crawling position.
/// Positive values like 0.1 can result in a reaching position when the avatar stands on his toes.
/// - As with the other parameters, the Head Height parameter should only have effect
/// on the Y position of the head.All other movements must be avoided in this animation.
///
/// Targets
/// =======
/// When the Animation option is enabled on the Humanoid Control script,
/// it is possible to select whether procedural animation should be used for each target.
/// If Procedural Animation is deselected the animation controlled by the Runtime Animator Controller
/// set in the Humanoid Control script will be used.
/// If the Runtime Animator Controller is not set, no animation will be used.
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 900575d4e62003c41b95e2470e3eb96d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 27a15f11d0d3b87448f074297239431c
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -64,7 +64,7 @@ namespace Passer.Humanoid {
/// Procedural and Mecanim animations are supported for body parts not being tracked by an input device. /// Procedural and Mecanim animations are supported for body parts not being tracked by an input device.
/// Mecanim animation is used when an appropriate Animation %Controller is selected as parameter. /// Mecanim animation is used when an appropriate Animation %Controller is selected as parameter.
/// Built-in procedural animation will be used when no Animation %Controller is selected. See also /// Built-in procedural animation will be used when no Animation %Controller is selected. See also
/// <a href="http://passervr.com/documentation/animations/">Animations</a>. /// \ref AnimatorDoc "Animator".
/// ///
/// Pose /// Pose
/// ==== /// ====