Skip to content

Instantly share code, notes, and snippets.

@createthis
Created July 25, 2017 01:12
Show Gist options
  • Save createthis/9b49714205812078795d1ab22e5d8fc2 to your computer and use it in GitHub Desktop.
Save createthis/9b49714205812078795d1ab22e5d8fc2 to your computer and use it in GitHub Desktop.
Final IK changes for positioning feet using hip tracker
diff --git a/Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVRLocomotion.cs b/Assets/Plugins/RootMotion/FinalIK/IK So
lvers/IKSolverVRLocomotion.cs
index 122de1b..0b16128 100644
--- a/Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVRLocomotion.cs
+++ b/Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVRLocomotion.cs
@@ -12,12 +12,6 @@ namespace RootMotion.FinalIK {
[System.Serializable]
public class Locomotion {
- [Tooltip("The toe/foot target.")]
- /// <summary>
- /// The toe/foot lookTarget.
- /// </summary>
- public Transform lookTarget;
-
[Tooltip("Used for blending in/out of procedural locomotion.")]
/// <summary>
/// Used for blending in/out of procedural locomotion.
@@ -216,13 +210,7 @@ namespace RootMotion.FinalIK {
Vector3 forward = spine.faceDirection;
Vector3 forwardY = V3Tools.ExtractVertical(forward, rootUp, 1f);
forward -= forwardY;
-
- Quaternion forwardRotation;
- if (lookTarget != null) {
- forwardRotation = Quaternion.LookRotation(lookTarget.forward, rootUp);
- } else {
- forwardRotation = Quaternion.LookRotation(forward, rootUp);
- }
+ Quaternion forwardRotation = Quaternion.LookRotation(forward, rootUp);^M
//centerOfMass = Vector3.Lerp(spine.pelvis.solverPosition, spine.head.solverPosition, 0.25f
) + rootBone.solverRotation * offset;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment