internal static W3dTimeCodedAnimationChannel Parse(BinaryReader reader, W3dParseContext context)
        {
            return(ParseChunk(reader, context, header =>
            {
                var result = new W3dTimeCodedAnimationChannel
                {
                    NumTimeCodes = reader.ReadUInt32(),
                    Pivot = reader.ReadUInt16(),
                    VectorLength = reader.ReadByte(),
                    ChannelType = reader.ReadByteAsEnum <W3dAnimationChannelType>()
                };

                W3dAnimationChannel.ValidateChannelDataSize(result.ChannelType, result.VectorLength);

                var data = new W3dTimeCodedDatum[result.NumTimeCodes];
                for (var i = 0; i < result.NumTimeCodes; i++)
                {
                    data[i] = W3dTimeCodedDatum.Parse(reader, result.ChannelType);
                }

                result.Data = data;

                return result;
            }));
        }
        internal static W3dTimeCodedDatum Parse(BinaryReader reader, W3dAnimationChannelType channelType)
        {
            var result = new W3dTimeCodedDatum();

            result.TimeCode = reader.ReadUInt32();

            // MSB is used to indicate a binary (non interpolated) movement
            if ((result.TimeCode >> 31) == 1)
            {
                result.NonInterpolatedMovement = true;
                // TODO: non-interpolated movement.

                result.TimeCode &= ~(1 << 31);
            }

            result.Value = W3dAnimationChannelDatum.Parse(reader, channelType);

            return(result);
        }