Example #1
0
        public STBone CreateGenericBone(SELib.SEModel seModel, SELib.SEModelBone seBone)
        {
            STBone bone = new STBone(skeleton);

            bone.Text         = seBone.BoneName;
            bone.parentIndex  = seBone.BoneParent;
            bone.RotationType = STBone.BoneRotationType.Euler;

            Vector3 rotEular = ToEular(seBone.LocalRotation);

            bone.position = new float[] { (float)seBone.LocalPosition.X, (float)seBone.LocalPosition.Y, (float)seBone.LocalPosition.Z };
            bone.scale    = new float[] { (float)seBone.Scale.X, (float)seBone.Scale.Y, (float)seBone.Scale.Z };
            bone.rotation = new float[] { rotEular.X, rotEular.Y, rotEular.Z, 0 };

            return(bone);
        }
Example #2
0
        /// <summary>
        /// Adds a new bone to the model with the given information
        /// </summary>
        /// <param name="Name">The tag name of this bone</param>
        /// <param name="ParentIndex">The parent index of this bone, -1 for a root bone</param>
        /// <param name="GlobalPosition">The global space position of this bone</param>
        /// <param name="GlobalRotation">The global space rotation of this bone</param>
        /// <param name="LocalPosition">The local parent space position of this bone</param>
        /// <param name="LocalRotation">The local parent space rotation of this bone</param>
        /// <param name="Scale">The scale of this bone, 1.0 is default</param>
        public void AddBone(string Name, int ParentIndex, Vector3 GlobalPosition, Quaternion GlobalRotation, Vector3 LocalPosition, Quaternion LocalRotation, Vector3 Scale)
        {
            var Bone = new SEModelBone()
            {
                BoneName = Name, BoneParent = ParentIndex
            };

            // Set matricies
            Bone.GlobalPosition = GlobalPosition;
            Bone.GlobalRotation = GlobalRotation;
            Bone.LocalPosition  = LocalPosition;
            Bone.LocalRotation  = LocalRotation;

            // Set scale
            Bone.Scale = Scale;

            // Add
            Bones.Add(Bone);
        }
Example #3
0
        public STBone CreateGenericBone(SELib.SEModel seModel, SELib.SEModelBone seBone)
        {
            STBone bone = new STBone(skeleton);

            bone.Text         = seBone.BoneName;
            bone.parentIndex  = seBone.BoneParent;
            bone.RotationType = STBone.BoneRotationType.Euler;

            bone.Position = new Vector3(
                (float)seBone.LocalPosition.X,
                (float)seBone.LocalPosition.Y,
                (float)seBone.LocalPosition.Z);
            bone.Scale = new Vector3(
                (float)seBone.Scale.X,
                (float)seBone.Scale.Y,
                (float)seBone.Scale.Z);
            bone.Rotation = new Quaternion(
                (float)seBone.LocalRotation.X,
                (float)seBone.LocalRotation.Y,
                (float)seBone.LocalRotation.Z,
                (float)seBone.LocalRotation.W);

            return(bone);
        }
Example #4
0
        private static SELib.SEModelBone SaveBone(STBone bone)
        {
            var seBone = new SELib.SEModelBone();

            return(seBone);
        }