Exemplo n.º 1
0
        /// <summary>
        /// Adds a transform into the pose. Editor only.
        /// </summary>
        /// <param name="bone">Transform.</param>
        /// <param name="position">Position.</param>
        /// <param name="rotation">Rotation.</param>
        /// <param name="scale">Scale.</param>
        public void AddBone(Transform bone, Vector3 position, Quaternion rotation, Vector3 scale)
        {
            PoseBone pose = new PoseBone();

            pose.bone     = bone.name;
            pose.hash     = UMAUtils.StringToHash(bone.name);
            pose.position = position - bone.localPosition;
            pose.rotation = Quaternion.Inverse(bone.localRotation) * rotation;
            pose.scale    = new Vector3(scale.x / bone.localScale.x,
                                        scale.y / bone.localScale.y,
                                        scale.z / bone.localScale.z);

            ArrayUtility.Add(ref poses, pose);
        }
Exemplo n.º 2
0
		/// <summary>
		/// Adds a transform into the pose. Editor only.
		/// </summary>
		/// <param name="bone">Transform.</param>
		/// <param name="position">Position.</param>
		/// <param name="rotation">Rotation.</param>
		/// <param name="scale">Scale.</param>
		public void AddBone(Transform bone, Vector3 position, Quaternion rotation, Vector3 scale)
		{
			PoseBone pose = new PoseBone();
			pose.bone = bone.name;
			pose.hash = UMAUtils.StringToHash(bone.name);
			pose.position = position - bone.localPosition;
			pose.rotation = Quaternion.Inverse(bone.localRotation) * rotation;
			pose.scale = new Vector3(scale.x / bone.localScale.x,
									scale.y / bone.localScale.y,
									scale.z / bone.localScale.z);

			ArrayUtility.Add(ref poses, pose);
		}