示例#1
0
        public YAMLNode ExportYAML(IExportContainer container)
        {
#warning TODO: values acording to read version (current 2017.3.0f3)
            YAMLMappingNode node = new YAMLMappingNode();
            node.AddSerializedVersion(GetSerializedVersion(container.Version));
            node.Add("m_RootX", RootX.ExportYAML(container));
            node.Add("m_Skeleton", Skeleton.ExportYAML(container));
            node.Add("m_SkeletonPose", SkeletonPose.ExportYAML(container));
            node.Add("m_LeftHand", LeftHand.ExportYAML(container));
            node.Add("m_RightHand", RightHand.ExportYAML(container));
            node.Add("m_Handles", GetExportHandles(container.Version).ExportYAML(container));
            node.Add("m_ColliderArray", GetExportColliderArray(container.Version).ExportYAML(container));
            node.Add("m_HumanBoneIndex", HumanBoneIndex.ExportYAML(true));
            node.Add("m_HumanBoneMass", HumanBoneMass.ExportYAML());
            node.Add("m_ColliderIndex", GetExportColliderIndex(container.Version).ExportYAML(true));
            node.Add("m_Scale", Scale);
            node.Add("m_ArmTwist", ArmTwist);
            node.Add("m_ForeArmTwist", ForeArmTwist);
            node.Add("m_UpperLegTwist", UpperLegTwist);
            node.Add("m_LegTwist", LegTwist);
            node.Add("m_ArmStretch", ArmStretch);
            node.Add("m_LegStretch", LegStretch);
            node.Add("m_FeetSpacing", FeetSpacing);
            node.Add("m_HasLeftHand", HasLeftHand);
            node.Add("m_HasRightHand", HasRightHand);
            node.Add("m_HasTDoF", HasTDoF);
            return(node);
        }
示例#2
0
        public void Read(AssetReader reader)
        {
            RootX.Read(reader);
            if (IsVector3(reader.Version))
            {
                LookAtPosition.Read3(reader);
            }
            else
            {
                LookAtPosition.Read(reader);
            }
            LookAtWeight.Read(reader);
            m_goalArray = reader.ReadAssetArray <HumanGoal>();
            LeftHandPose.Read(reader);
            RightHandPose.Read(reader);
            m_doFArray = reader.ReadSingleArray();

            if (IsReadTArray(reader.Version))
            {
                if (IsVector3(reader.Version))
                {
                    m_TDoFArray = reader.ReadVector3Array();
                }
                else
                {
                    m_TDoFArray = reader.ReadAssetArray <Vector4f>();
                }
            }
        }
示例#3
0
        public YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = new YAMLMappingNode();

            node.AddSerializedVersion(GetSerializedVersion(container.ExportVersion));
            node.Add(RootXName, RootX.ExportYAML(container));
            node.Add(SkeletonName, Skeleton.ExportYAML(container));
            node.Add(SkeletonPoseName, SkeletonPose.ExportYAML(container));
            node.Add(LeftHandName, LeftHand.ExportYAML(container));
            node.Add(RightHandName, RightHand.ExportYAML(container));
            node.Add(HandlesName, GetExportHandles(container.Version).ExportYAML(container));
            node.Add(ColliderArrayName, GetExportColliderArray(container.Version).ExportYAML(container));
            node.Add(HumanBoneIndexName, HumanBoneIndex.ExportYAML(true));
            node.Add(HumanBoneMassName, HumanBoneMass.ExportYAML());
            node.Add(ColliderIndexName, GetExportColliderIndex(container.Version).ExportYAML(true));
            node.Add(ScaleName, Scale);
            node.Add(ArmTwistName, ArmTwist);
            node.Add(ForeArmTwistName, ForeArmTwist);
            node.Add(UpperLegTwistName, UpperLegTwist);
            node.Add(LegTwistName, LegTwist);
            node.Add(ArmStretchName, ArmStretch);
            node.Add(LegStretchName, LegStretch);
            node.Add(FeetSpacingName, FeetSpacing);
            node.Add(HasLeftHandName, HasLeftHand);
            node.Add(HasRightHandName, HasRightHand);
            node.Add(HasTDoFName, HasTDoF);
            return(node);
        }
示例#4
0
 public void Read(AssetStream stream)
 {
     RootX.Read(stream);
     Skeleton.Read(stream);
     SkeletonPose.Read(stream);
     LeftHand.Read(stream);
     RightHand.Read(stream);
     if (IsReadHandles(stream.Version))
     {
         m_handles       = stream.ReadArray <Handle>();
         m_colliderArray = stream.ReadArray <Collider>();
     }
     m_humanBoneIndex = stream.ReadInt32Array();
     m_humanBoneMass  = stream.ReadSingleArray();
     if (IsReadColliderIndex(stream.Version))
     {
         m_colliderIndex = stream.ReadInt32Array();
     }
     Scale         = stream.ReadSingle();
     ArmTwist      = stream.ReadSingle();
     ForeArmTwist  = stream.ReadSingle();
     UpperLegTwist = stream.ReadSingle();
     LegTwist      = stream.ReadSingle();
     ArmStretch    = stream.ReadSingle();
     LegStretch    = stream.ReadSingle();
     FeetSpacing   = stream.ReadSingle();
     HasLeftHand   = stream.ReadBoolean();
     HasRightHand  = stream.ReadBoolean();
     if (IsReadHasTDoF(stream.Version))
     {
         HasTDoF = stream.ReadBoolean();
     }
     stream.AlignStream(AlignType.Align4);
 }
示例#5
0
        public void Read(AssetStream stream)
        {
            RootX.Read(stream);
            if (IsVector3(stream.Version))
            {
                LookAtPosition.Read3(stream);
            }
            else
            {
                LookAtPosition.Read(stream);
            }
            LookAtWeight.Read(stream);
            m_goalArray = stream.ReadArray <HumanGoal>();
            LeftHandPose.Read(stream);
            RightHandPose.Read(stream);
            m_doFArray = stream.ReadSingleArray();

            if (IsReadTArray(stream.Version))
            {
                if (IsVector3(stream.Version))
                {
                    m_TDoFArray = stream.ReadVector3Array();
                }
                else
                {
                    m_TDoFArray = stream.ReadArray <Vector4f>();
                }
            }
        }
示例#6
0
        public YAMLNode ExportYAML()
        {
            YAMLMappingNode node = new YAMLMappingNode();

            node.AddSerializedVersion(SerializedVersion);
            node.Add("m_RootX", RootX.ExportYAML());
            node.Add("m_Skeleton", Skeleton.ExportYAML());
            node.Add("m_SkeletonPose", SkeletonPose.ExportYAML());
            node.Add("m_LeftHand", LeftHand.ExportYAML());
            node.Add("m_RightHand", RightHand.ExportYAML());
            node.Add("m_Handles", Handles.ExportYAML());
            node.Add("m_ColliderArray", ColliderArray.ExportYAML());
            node.Add("m_HumanBoneIndex", HumanBoneIndex.ExportYAML(true));
            node.Add("m_HumanBoneMass", HumanBoneMass.ExportYAML());
            node.Add("m_ColliderIndex", ColliderIndex.ExportYAML(true));
            node.Add("m_Scale", Scale);
            node.Add("m_ArmTwist", ArmTwist);
            node.Add("m_ForeArmTwist", ForeArmTwist);
            node.Add("m_UpperLegTwist", UpperLegTwist);
            node.Add("m_LegTwist", LegTwist);
            node.Add("m_ArmStretch", ArmStretch);
            node.Add("m_LegStretch", LegStretch);
            node.Add("m_FeetSpacing", FeetSpacing);
            node.Add("m_HasLeftHand", HasLeftHand);
            node.Add("m_HasRightHand", HasRightHand);
            node.Add("m_HasTDoF", HasTDoF);
            return(node);
        }
示例#7
0
 public void Read(EndianStream stream)
 {
     RootX.Read(stream);
     Skeleton.Read(stream);
     SkeletonPose.Read(stream);
     LeftHand.Read(stream);
     RightHand.Read(stream);
     m_handles        = stream.ReadArray(() => new Handle(m_assetsFile));
     m_colliderArray  = stream.ReadArray(() => new Collider(m_assetsFile));
     m_humanBoneIndex = stream.ReadInt32Array();
     m_humanBoneMass  = stream.ReadSingleArray();
     m_colliderIndex  = stream.ReadInt32Array();
     Scale            = stream.ReadSingle();
     ArmTwist         = stream.ReadSingle();
     ForeArmTwist     = stream.ReadSingle();
     UpperLegTwist    = stream.ReadSingle();
     LegTwist         = stream.ReadSingle();
     ArmStretch       = stream.ReadSingle();
     LegStretch       = stream.ReadSingle();
     FeetSpacing      = stream.ReadSingle();
     HasLeftHand      = stream.ReadBoolean();
     HasRightHand     = stream.ReadBoolean();
     HasTDoF          = stream.ReadBoolean();
     stream.AlignStream(AlignType.Align4);
 }
示例#8
0
        public void Read(EndianStream stream)
        {
            RootX.Read(stream);
            if (IsVector3)
            {
                LookAtPosition3.Read(stream);
            }
            else
            {
                LookAtPosition4.Read(stream);
            }
            LookAtWeight.Read(stream);
            m_goalArray = stream.ReadArray(() => new HumanGoal(m_assetsFile));
            LeftHandPose.Read(stream);
            RightHandPose.Read(stream);
            m_doFArray = stream.ReadSingleArray();

            if (IsReadTArray)
            {
                if (IsVector3)
                {
                    m_TDoFArray3 = stream.ReadArray <Vector3f>();
                }
                else
                {
                    m_TDoFArray4 = stream.ReadArray <Vector4f>();
                }
            }
        }
示例#9
0
        public void Read(AssetReader reader)
        {
            RootX.Read(reader);
            Skeleton.Read(reader);
            SkeletonPose.Read(reader);
            LeftHand.Read(reader);
            RightHand.Read(reader);
            if (IsReadHandles(reader.Version))
            {
                m_handles       = reader.ReadAssetArray <Handle>();
                m_colliderArray = reader.ReadAssetArray <Collider>();
            }

            int[] HumanBoneIndex = reader.ReadInt32Array();
            m_humanBoneIndex = UpdateBoneArray(HumanBoneIndex, reader.Version);
            float[] HumanBoneMass = reader.ReadSingleArray();
            m_humanBoneMass = UpdateBoneArray(HumanBoneMass, reader.Version);
            if (IsReadColliderIndex(reader.Version))
            {
                int[] ColliderIndex = reader.ReadInt32Array();
                m_colliderIndex = UpdateBoneArray(ColliderIndex, reader.Version);
            }

            Scale         = reader.ReadSingle();
            ArmTwist      = reader.ReadSingle();
            ForeArmTwist  = reader.ReadSingle();
            UpperLegTwist = reader.ReadSingle();
            LegTwist      = reader.ReadSingle();
            ArmStretch    = reader.ReadSingle();
            LegStretch    = reader.ReadSingle();
            FeetSpacing   = reader.ReadSingle();
            HasLeftHand   = reader.ReadBoolean();
            HasRightHand  = reader.ReadBoolean();
            if (IsReadHasTDoF(reader.Version))
            {
                HasTDoF = reader.ReadBoolean();
            }
            reader.AlignStream(AlignType.Align4);
        }