public HumanPose(EndianBinaryReader reader, int[] version)
        {
            m_RootX          = new xform(reader, version);
            m_LookAtPosition = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? (object)reader.ReadVector3() : (object)reader.ReadVector4();//5.4 and up
            m_LookAtWeight   = reader.ReadVector4();

            int numGoals = reader.ReadInt32();

            m_GoalArray = new List <HumanGoal>(numGoals);
            for (int i = 0; i < numGoals; i++)
            {
                m_GoalArray.Add(new HumanGoal(reader, version));
            }

            m_LeftHandPose  = new HandPose(reader, version);
            m_RightHandPose = new HandPose(reader, version);

            int numDoFs = reader.ReadInt32();

            m_DoFArray = reader.ReadSingleArray(numDoFs);

            if (version[0] > 5 || (version[0] == 5 && version[1] >= 2))//5.2 and up
            {
                int numTDof = reader.ReadInt32();
                m_TDoFArray = new object[numTDof];
                for (int i = 0; i < numTDof; i++)
                {
                    m_TDoFArray[i] = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? (object)reader.ReadVector3() : (object)reader.ReadVector4();//5.4 and up
                }
            }
        }
        public ClipMuscleConstant(EndianBinaryReader reader, int[] version)
        {
            m_DeltaPose = new HumanPose(reader, version);
            m_StartX    = new xform(reader, version);
            if (version[0] > 5 || (version[0] == 5 && version[1] >= 5))//5.5 and up
            {
                m_StopX = new xform(reader, version);
            }
            m_LeftFootStartX  = new xform(reader, version);
            m_RightFootStartX = new xform(reader, version);
            if (version[0] < 5)//5.0 down
            {
                m_MotionStartX = new xform(reader, version);
                m_MotionStopX  = new xform(reader, version);
            }
            m_AverageSpeed        = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? (object)reader.ReadVector3() : (object)reader.ReadVector4();//5.4 and up
            m_Clip                = new Clip(reader, 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(reader));
            }
            if (version[0] > 5 || (version[0] == 5 && version[1] >= 3))//5.3 and up
            {
                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[0] > 5 || (version[0] == 5 && version[1] >= 5))//5.5 and up
            {
                m_StartAtOrigin = reader.ReadBoolean();
            }
            m_KeepOriginalOrientation = reader.ReadBoolean();
            m_KeepOriginalPositionY   = reader.ReadBoolean();
            m_KeepOriginalPositionXZ  = reader.ReadBoolean();
            m_HeightFromFeet          = reader.ReadBoolean();
            reader.AlignStream(4);
        }
 public HumanGoal(EndianBinaryReader reader, int[] version)
 {
     m_X       = new xform(reader, version);
     m_WeightT = reader.ReadSingle();
     m_WeightR = reader.ReadSingle();
     if (version[0] >= 5)                                                                                                                      //5.0 and up
     {
         m_HintT       = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? (object)reader.ReadVector3() : (object)reader.ReadVector4(); //5.4 and up
         m_HintWeightT = reader.ReadSingle();
     }
 }
        public HandPose(EndianBinaryReader reader, int[] version)
        {
            m_GrabX = new xform(reader, version);

            int numDoFs = reader.ReadInt32();

            m_DoFArray = reader.ReadSingleArray(numDoFs);

            m_Override  = reader.ReadSingle();
            m_CloseOpen = reader.ReadSingle();
            m_InOut     = reader.ReadSingle();
            m_Grab      = reader.ReadSingle();
        }