本文整理汇总了C#中System.IO.Stream.ReadFloat方法的典型用法代码示例。如果您正苦于以下问题:C# Stream.ReadFloat方法的具体用法?C# Stream.ReadFloat怎么用?C# Stream.ReadFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.Stream
的用法示例。
在下文中一共展示了Stream.ReadFloat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HvaReader
public HvaReader(Stream s)
{
// Index swaps for transposing a matrix
var ids = new byte[] { 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14 };
s.Seek(16, SeekOrigin.Begin);
FrameCount = s.ReadUInt32();
LimbCount = s.ReadUInt32();
// Skip limb names
s.Seek(16 * LimbCount, SeekOrigin.Current);
Transforms = new float[16 * FrameCount * LimbCount];
for (var j = 0; j < FrameCount; j++)
for (var i = 0; i < LimbCount; i++)
{
// Convert to column-major matrices and add the final matrix row
var c = 16 * (LimbCount * j + i);
Transforms[c + 3] = 0;
Transforms[c + 7] = 0;
Transforms[c + 11] = 0;
Transforms[c + 15] = 1;
for (var k = 0; k < 12; k++)
Transforms[c + ids[k]] = s.ReadFloat();
}
}
示例2: VxlReader
public VxlReader(Stream s)
{
if (!s.ReadASCII(16).StartsWith("Voxel Animation"))
throw new InvalidDataException("Invalid vxl header");
s.ReadUInt32();
LimbCount = s.ReadUInt32();
s.ReadUInt32();
BodySize = s.ReadUInt32();
s.Seek(770, SeekOrigin.Current);
// Read Limb headers
Limbs = new VxlLimb[LimbCount];
for (var i = 0; i < LimbCount; i++)
{
Limbs[i] = new VxlLimb();
Limbs[i].Name = s.ReadASCII(16);
s.Seek(12, SeekOrigin.Current);
}
// Skip to the Limb footers
s.Seek(802 + 28*LimbCount + BodySize, SeekOrigin.Begin);
var LimbDataOffset = new uint[LimbCount];
for (var i = 0; i < LimbCount; i++)
{
LimbDataOffset[i] = s.ReadUInt32();
s.Seek(8, SeekOrigin.Current);
Limbs[i].Scale = s.ReadFloat();
s.Seek(48, SeekOrigin.Current);
Limbs[i].Bounds = new float[6];
for (var j = 0; j < 6; j++)
Limbs[i].Bounds[j] = s.ReadFloat();
Limbs[i].Size = s.ReadBytes(3);
Limbs[i].Type = (NormalType)s.ReadByte();
}
for (var i = 0; i < LimbCount; i++)
{
s.Seek(802 + 28*LimbCount + LimbDataOffset[i], SeekOrigin.Begin);
ReadVoxelData(s, Limbs[i]);
}
}