コード例 #1
0
        public void LoadFrom(Stream stream, uint version)
        {
            BinaryReader reader = new BinaryReader(stream);

            m_DeltaPose = new HumanPose(stream, version);
            m_StartX    = new xform(stream, version);
            if (version >= AssetCabinet.VERSION_5_5_0)
            {
                m_StopX = new xform(stream, version);
            }
            m_LeftFootStartX  = new xform(stream, version);
            m_RightFootStartX = new xform(stream, version);
            if (version < AssetCabinet.VERSION_5_0_0)
            {
                m_MotionStartX = new xform(stream, version);
                m_MotionStopX  = new xform(stream, version);
            }
            m_AverageSpeed        = version >= AssetCabinet.VERSION_5_4_1 ? (object)reader.ReadVector3() : (object)reader.ReadVector4();
            m_Clip                = new Clip(stream, version);
            m_StartTime           = reader.ReadSingle();
            m_StopTime            = reader.ReadSingle();
            m_OrientationOffsetY  = reader.ReadSingle();
            m_Level               = reader.ReadSingle();
            m_CycleOffset         = reader.ReadSingle();
            m_AverageAngularSpeed = reader.ReadSingle();

            int numIndices = reader.ReadInt32();

            m_IndexArray = reader.ReadInt32Array(numIndices);

            int numDeltas = reader.ReadInt32();

            m_ValueArrayDelta = new List <ValueDelta>(numDeltas);
            for (int i = 0; i < numDeltas; i++)
            {
                m_ValueArrayDelta.Add(new ValueDelta(stream));
            }
            if (version >= AssetCabinet.VERSION_5_0_0)
            {
                m_ValueArrayReferencePose = reader.ReadSingleArray(reader.ReadInt32());
            }

            m_Mirror               = reader.ReadBoolean();
            m_LoopTime             = reader.ReadBoolean();
            m_LoopBlend            = reader.ReadBoolean();
            m_LoopBlendOrientation = reader.ReadBoolean();
            m_LoopBlendPositionY   = reader.ReadBoolean();
            m_LoopBlendPositionXZ  = reader.ReadBoolean();
            if (version >= AssetCabinet.VERSION_5_5_0)
            {
                m_StartAtOrigin = reader.ReadBoolean();
            }
            m_KeepOriginalOrientation = reader.ReadBoolean();
            m_KeepOriginalPositionY   = reader.ReadBoolean();
            m_KeepOriginalPositionXZ  = reader.ReadBoolean();
            m_HeightFromFeet          = reader.ReadBoolean();
            stream.Position          += version < AssetCabinet.VERSION_5_5_0 ? 2 : 1;
        }
コード例 #2
0
        public void LoadFrom(Stream stream)
        {
            BinaryReader reader = new BinaryReader(stream);

            m_DeltaPose           = new HumanPose(stream);
            m_StartX              = new xform(stream);
            m_LeftFootStartX      = new xform(stream);
            m_RightFootStartX     = new xform(stream);
            m_MotionStartX        = new xform(stream);
            m_MotionStopX         = new xform(stream);
            m_AverageSpeed        = reader.ReadVector4();
            m_Clip                = new Clip(stream);
            m_StartTime           = reader.ReadSingle();
            m_StopTime            = reader.ReadSingle();
            m_OrientationOffsetY  = reader.ReadSingle();
            m_Level               = reader.ReadSingle();
            m_CycleOffset         = reader.ReadSingle();
            m_AverageAngularSpeed = reader.ReadSingle();

            int numIndices = reader.ReadInt32();

            m_IndexArray = reader.ReadInt32Array(numIndices);

            int numDeltas = reader.ReadInt32();

            m_ValueArrayDelta = new List <ValueDelta>(numDeltas);
            for (int i = 0; i < numDeltas; i++)
            {
                m_ValueArrayDelta.Add(new ValueDelta(stream));
            }

            m_Mirror                  = reader.ReadBoolean();
            m_LoopTime                = reader.ReadBoolean();
            m_LoopBlend               = reader.ReadBoolean();
            m_LoopBlendOrientation    = reader.ReadBoolean();
            m_LoopBlendPositionY      = reader.ReadBoolean();
            m_LoopBlendPositionXZ     = reader.ReadBoolean();
            m_KeepOriginalOrientation = reader.ReadBoolean();
            m_KeepOriginalPositionY   = reader.ReadBoolean();
            m_KeepOriginalPositionXZ  = reader.ReadBoolean();
            m_HeightFromFeet          = reader.ReadBoolean();
            reader.ReadBytes(2);
        }
コード例 #3
0
        public ClipMuscleConstant(uint version)
        {
            m_DeltaPose = new HumanPose(version);
            if (version >= AssetCabinet.VERSION_5_4_1)
            {
                m_StartX = new xform(new Vector3(), Quaternion.Identity, new Vector3(1, 1, 1));
                if (version >= AssetCabinet.VERSION_5_5_0)
                {
                    m_StopX = new xform(new Vector3(), Quaternion.Identity, new Vector3(1, 1, 1));
                }
                m_LeftFootStartX  = new xform(new Vector3(), Quaternion.Identity, new Vector3(1, 1, 1));
                m_RightFootStartX = new xform(new Vector3(), Quaternion.Identity, new Vector3(1, 1, 1));
                m_AverageSpeed    = new Vector3();
            }
            else
            {
                m_StartX          = new xform(new Vector4(), Quaternion.Identity, new Vector4(1, 1, 1, 1));
                m_LeftFootStartX  = new xform(new Vector4(), Quaternion.Identity, new Vector4(1, 1, 1, 1));
                m_RightFootStartX = new xform(new Vector4(), Quaternion.Identity, new Vector4(1, 1, 1, 1));
                if (version < AssetCabinet.VERSION_5_0_0)
                {
                    m_MotionStartX = new xform(new Vector4(), Quaternion.Identity, new Vector4(1, 1, 1, 1));
                    m_MotionStopX  = new xform(new Vector4(), Quaternion.Identity, new Vector4(1, 1, 1, 1));
                }
                m_AverageSpeed = new Vector4();
            }
            m_Clip = new Clip();

            int indexArrayLength =
                version < AssetCabinet.VERSION_5_0_0 ? 134 :
                version < AssetCabinet.VERSION_5_6_2 ? 155
                                : 161;

            m_IndexArray = new int[indexArrayLength];
            for (int i = 0; i < m_IndexArray.Length; i++)
            {
                m_IndexArray[i] = -1;
            }

            m_ValueArrayDelta         = new List <ValueDelta>();
            m_ValueArrayReferencePose = new float[0];
        }