Exemplo n.º 1
0
        public Track(BinaryReader br, bool reverse = false)
        {
            br.BaseStream.Position -= 4;

            Name              = br.ReadString(Constants.SizeTag);
            NrOfTracks        = br.ReadUInt32();
            InterpolationType = (MDLTRACKTYPE)br.ReadUInt32();
            GlobalSequenceId  = br.ReadInt32();

            Nodes = new CAnimatorNode <T> [NrOfTracks];
            for (int i = 0; i < NrOfTracks; i++)
            {
                uint Time  = br.ReadUInt32();
                T    Value = CreateInstance(br);

                if (InterpolationType > MDLTRACKTYPE.TRACK_LINEAR)
                {
                    T InTangent   = CreateInstance(br);
                    T OutTrangent = CreateInstance(br);

                    Nodes[i] = new CAnimatorNode <T>(Time, reverse, Value, InTangent, OutTrangent);
                }
                else
                {
                    Nodes[i] = new CAnimatorNode <T>(Time, reverse, Value);
                }
            }
        }
Exemplo n.º 2
0
        public IEnumerable <TType> Convert <TType>(MDLTRACKTYPE InterpolationType)
        {
            List <TType> values = new List <TType>();

            values.Add(Convert <TType>(Value));

            if (InterpolationType > MDLTRACKTYPE.TRACK_LINEAR)
            {
                values.Add(Convert <TType>(InTangent));
                values.Add(Convert <TType>(OutTangent));
            }

            return(values);
        }