internal static W3dAdaptiveDeltaAnimationChannel Parse(BinaryReader reader, W3dParseContext context, W3dAdaptiveDeltaBitCount bitCount) { return(ParseChunk(reader, context, header => { var result = new W3dAdaptiveDeltaAnimationChannel { NumTimeCodes = reader.ReadUInt32(), Pivot = reader.ReadUInt16(), VectorLength = reader.ReadByte(), ChannelType = reader.ReadByteAsEnum <W3dAnimationChannelType>(), Scale = reader.ReadSingle(), }; W3dAnimationChannel.ValidateChannelDataSize(result.ChannelType, result.VectorLength); result.Data = W3dAdaptiveDeltaData.Parse( reader, result.NumTimeCodes, result.ChannelType, result.VectorLength, bitCount); // Skip 3 unknown bytes at chunk end. reader.BaseStream.Seek(3, SeekOrigin.Current); return result; })); }
internal static W3dMotionChannelAdaptiveDeltaData Parse( BinaryReader reader, uint numTimeCodes, W3dAnimationChannelType channelType, int vectorLen, W3dAdaptiveDeltaBitCount bitCount) { return(new W3dMotionChannelAdaptiveDeltaData { Scale = reader.ReadSingle(), Data = W3dAdaptiveDeltaData.Parse( reader, numTimeCodes, channelType, vectorLen, bitCount) }); }