Skip to content

Commit

Permalink
Fixed eye rotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joen-UnLogick committed Apr 28, 2015
1 parent c47eb6d commit aa61a2a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
Expand Up @@ -93,11 +93,11 @@ public static void UpdateUMAFemaleDNABones(UMAData umaData, UMASkeleton skeleton
//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f));
skeleton.SetRotation(leftEyeHash,
Quaternion.Euler(new Vector3((umaDna.eyeRotation - 0.5f) * 20, -90, -180)));
skeleton.SetRotation(rightEyeHash,
Quaternion.Euler(new Vector3(-(umaDna.eyeRotation - 0.5f) * 20, -90, -180)));

skeleton.SetRotation(leftEyeAdjustHash,
Quaternion.Euler(new Vector3((umaDna.eyeRotation - 0.5f) * 20, 0, 0)));
skeleton.SetRotation(rightEyeAdjustHash,
Quaternion.Euler(new Vector3(-(umaDna.eyeRotation - 0.5f) * 20, 0, 0)));

//umaData.boneList["LeftEye"].boneTransform.localEulerAngles = new Vector3((umaDna.eyeRotation - 0.5f) * 20, -90, -180);
//umaData.boneList["RightEye"].boneTransform.localEulerAngles = new Vector3(-(umaDna.eyeRotation - 0.5f) * 20, -90, -180);
Expand Down
Expand Up @@ -97,10 +97,10 @@ public static void UpdateUMAMaleDNABones(UMAData umaData, UMASkeleton skeleton)
//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f));

skeleton.SetRotation(leftEyeHash,
Quaternion.Euler(new Vector3((umaDna.eyeRotation - 0.5f) * 20, -90, -180)));
skeleton.SetRotation(rightEyeHash,
Quaternion.Euler(new Vector3(-(umaDna.eyeRotation - 0.5f) * 20, -90, -180)));
skeleton.SetRotation(leftEyeAdjustHash,
Quaternion.Euler(new Vector3((umaDna.eyeRotation - 0.5f) * 20, 0, 0)));
skeleton.SetRotation(rightEyeAdjustHash,
Quaternion.Euler(new Vector3(-(umaDna.eyeRotation - 0.5f) * 20, 0, 0)));

//umaData.boneList["LeftEye"].boneTransform.localEulerAngles = new Vector3((umaDna.eyeRotation - 0.5f) * 20, -90, -180);
//umaData.boneList["RightEye"].boneTransform.localEulerAngles = new Vector3(-(umaDna.eyeRotation - 0.5f) * 20, -90, -180);
Expand Down
@@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using System.Collections;

namespace UMA
Expand All @@ -18,6 +18,8 @@ public class HumanoidDNAConverterBehaviour : DnaConverterBehaviour
static protected int rightOuterBreastHash;
static protected int leftEyeHash;
static protected int rightEyeHash;
static protected int leftEyeAdjustHash;
static protected int rightEyeAdjustHash;
static protected int spine1AdjustHash;
static protected int spineAdjustHash;
static protected int lowerBackBellyHash;
Expand Down Expand Up @@ -96,6 +98,8 @@ public override void Prepare()
rightOuterBreastHash = UMAUtils.StringToHash("RightOuterBreast");
leftEyeHash = UMAUtils.StringToHash("LeftEye");
rightEyeHash = UMAUtils.StringToHash("RightEye");
leftEyeAdjustHash = UMAUtils.StringToHash("LeftEyeAdjust");
rightEyeAdjustHash = UMAUtils.StringToHash("RightEyeAdjust");
spine1AdjustHash = UMAUtils.StringToHash("Spine1Adjust");
spineAdjustHash = UMAUtils.StringToHash("SpineAdjust");
lowerBackBellyHash = UMAUtils.StringToHash("LowerBackBelly");
Expand Down Expand Up @@ -166,4 +170,4 @@ public override void Prepare()
builtHashes = true;
}
}
}
}

0 comments on commit aa61a2a

Please sign in to comment.