本文整理汇总了C#中EndianBinaryReader.ReadSingles方法的典型用法代码示例。如果您正苦于以下问题:C# EndianBinaryReader.ReadSingles方法的具体用法?C# EndianBinaryReader.ReadSingles怎么用?C# EndianBinaryReader.ReadSingles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EndianBinaryReader
的用法示例。
在下文中一共展示了EndianBinaryReader.ReadSingles方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OrientedBoundingBox
public OrientedBoundingBox(EndianBinaryReader er)
: base(er)
{
CenterPosition = er.ReadVector3();
OrientationMatrix = er.ReadSingles(3 * 3);
Size = er.ReadVector3();
}
示例2: CMDL
public CMDL(EndianBinaryReader er)
{
Type = er.ReadUInt32();
Signature = er.ReadString(Encoding.ASCII, 4);
if (Signature != "CMDL") throw new SignatureNotCorrectException(Signature, "CMDL", er.BaseStream.Position);
Revision = er.ReadUInt32();
NameOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
Unknown2 = er.ReadUInt32();
Unknown3 = er.ReadUInt32();
Flags = er.ReadUInt32();
IsBranchVisible = er.ReadUInt32() == 1;
NrChildren = er.ReadUInt32();
Unknown7 = er.ReadUInt32();
NrAnimationGroupDescriptions = er.ReadUInt32();
AnimationGroupDescriptionsDictOffset =er.ReadUInt32();
if (AnimationGroupDescriptionsDictOffset != 0) AnimationGroupDescriptionsDictOffset += (UInt32)er.BaseStream.Position - 4;
Scale = er.ReadVector3();
Rotation = er.ReadVector3();
Translation = er.ReadVector3();
LocalMatrix = er.ReadSingles(4 * 3);
WorldMatrix = er.ReadSingles(4 * 3);
NrMeshes = er.ReadUInt32();
MeshOffsetsOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
NrMaterials = er.ReadUInt32();
MaterialsDictOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
NrShapes = er.ReadUInt32();
ShapeOffsetsOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
NrMeshNodes = er.ReadUInt32();
MeshNodeVisibilitiesDictOffset = er.ReadUInt32();
if (MeshNodeVisibilitiesDictOffset != 0) MeshNodeVisibilitiesDictOffset += (UInt32)er.BaseStream.Position - 4;
Unknown23 = er.ReadUInt32();
Unknown24 = er.ReadUInt32();
Unknown25 = er.ReadUInt32();
if ((Type & 0x80) != 0) SkeletonInfoSOBJOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
long curpos = er.BaseStream.Position;
er.BaseStream.Position = NameOffset;
Name = er.ReadStringNT(Encoding.ASCII);
if (AnimationGroupDescriptionsDictOffset != 0)
{
er.BaseStream.Position = AnimationGroupDescriptionsDictOffset;
AnimationInfoDict = new DICT(er);
}
er.BaseStream.Position = MeshOffsetsOffset;
MeshOffsets = new UInt32[NrMeshes];
for (int i = 0; i < NrMeshes; i++)
{
MeshOffsets[i] = (UInt32)er.BaseStream.Position + er.ReadUInt32();
}
er.BaseStream.Position = MaterialsDictOffset;
MaterialsDict = new DICT(er);
Materials = new MTOB[NrMaterials];
for (int i = 0; i < NrMaterials; i++)
{
er.BaseStream.Position = MaterialsDict[i].DataOffset;
Materials[i] = new MTOB(er);
}
er.BaseStream.Position = ShapeOffsetsOffset;
ShapeOffsets = new UInt32[NrShapes];
for (int i = 0; i < NrShapes; i++)
{
ShapeOffsets[i] = (UInt32)er.BaseStream.Position + er.ReadUInt32();
}
if (MeshNodeVisibilitiesDictOffset != 0)
{
er.BaseStream.Position = MeshNodeVisibilitiesDictOffset;
MeshNodeVisibilitiesDict = new DICT(er);
}
AnimationGroupDescriptions = new GraphicsAnimationGroup[NrAnimationGroupDescriptions];
for (int i = 0; i < NrAnimationGroupDescriptions; i++)
{
er.BaseStream.Position = AnimationInfoDict[i].DataOffset;
AnimationGroupDescriptions[i] = new GraphicsAnimationGroup(er);
}
Meshes = new Mesh[NrMeshes];
for (int i = 0; i < NrMeshes; i++)
{
er.BaseStream.Position = MeshOffsets[i];
Meshes[i] = new Mesh(er);
}
Shapes = new SeparateDataShape[NrShapes];
for (int i = 0; i < NrShapes; i++)
{
er.BaseStream.Position = ShapeOffsets[i];
Shapes[i] = new SeparateDataShape(er);
}
MeshNodeVisibilities = new MeshNodeVisibilityCtr[NrMeshNodes];
for (int i = 0; i < NrMeshNodes; i++)
{
er.BaseStream.Position = MeshNodeVisibilitiesDict[i].DataOffset;
MeshNodeVisibilities[i] = new MeshNodeVisibilityCtr(er);
}
//.........这里部分代码省略.........
示例3: VertexParamAttributeCtr
public VertexParamAttributeCtr(EndianBinaryReader er)
: base(er)
{
FormatType = (DataType)er.ReadUInt32();
NrComponents = er.ReadUInt32();
Scale = er.ReadSingle();
NrAttributes = er.ReadUInt32();
AttributeArrayOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
long curpos = er.BaseStream.Position;
er.BaseStream.Position = AttributeArrayOffset;
Attributes = er.ReadSingles((int)NrAttributes);
er.BaseStream.Position = curpos;
}
示例4: Bone
public Single[] WorldMatrix; //4x3
#endregion Fields
#region Constructors
public Bone(EndianBinaryReader er)
{
NameOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
Flags = (BoneFlags)er.ReadUInt32();
JointID = er.ReadUInt32();
ParentID = er.ReadInt32();
if (ParentID == -1) ParentOffset = er.ReadUInt32();
else ParentOffset = (UInt32)(er.BaseStream.Position + er.ReadInt32());
ChildOffset = er.ReadUInt32();
if (ChildOffset != 0) ChildOffset += (UInt32)(er.BaseStream.Position - 4);
PreviousSiblingOffset = er.ReadUInt32();
if (PreviousSiblingOffset != 0) PreviousSiblingOffset += (UInt32)(er.BaseStream.Position - 4);
NextSiblingOffset = er.ReadUInt32();
if (NextSiblingOffset != 0) NextSiblingOffset += (UInt32)(er.BaseStream.Position - 4);
Scale = new Vector3(er.ReadSingle(), er.ReadSingle(), er.ReadSingle());
Rotation = new Vector3(er.ReadSingle(), er.ReadSingle(), er.ReadSingle());
Translation = new Vector3(er.ReadSingle(), er.ReadSingle(), er.ReadSingle());
LocalMatrix = er.ReadSingles(4 * 3);
WorldMatrix = er.ReadSingles(4 * 3);
InverseBaseMatrix = er.ReadSingles(4 * 3);
BillboardMode = (BBMode)er.ReadUInt32();
Unknown6 = er.ReadUInt32();
Unknown7 = er.ReadUInt32();
long curpos = er.BaseStream.Position;
er.BaseStream.Position = NameOffset;
Name = er.ReadStringNT(Encoding.ASCII);
er.BaseStream.Position = curpos;
}
示例5: TextureCoordinatorCtr
public TextureCoordinatorCtr(EndianBinaryReader er)
{
SourceCoordinate = er.ReadUInt32();
MappingMethod = er.ReadUInt32();
ReferenceCamera = er.ReadInt32();
MatrixMode = er.ReadUInt32();
Scale = new Vector2(er.ReadSingle(), er.ReadSingle());
Rotate = er.ReadSingle();
Translate = new Vector2(er.ReadSingle(), er.ReadSingle());
Unknown3 = er.ReadUInt32();
Matrix = er.ReadSingles(4 * 3);
}