protected override void Read(GrnBinaryReader reader) { reader.ReadBytes(4); this.Offset = reader.ReadUInt32(); reader.ReadBytes(8); int currentPosition = (Int32)reader.BaseStream.Position; reader.Seek((int)this.Offset, System.IO.SeekOrigin.Begin); this.NumTotalChildNodes = reader.ReadInt32(); reader.ReadBytes(12); int numChildren = this.NumTotalChildNodes; for (int i = 0; i < numChildren; i++) { GrnNodeType nodeType = (GrnNodeType)reader.ReadInt32(); GrnNode childNode = GrnNode.ReadByNodeType(reader, this, nodeType); this.ChildNodes.Add(childNode); numChildren -= childNode.NumTotalChildNodes; if (i > 0) { childNode.PreviousSibling = this.ChildNodes[i - 1]; childNode.PreviousSibling.NextSibling = childNode; } } reader.Seek(currentPosition, System.IO.SeekOrigin.Begin); }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); this.Width = reader.ReadInt32(); this.Height = reader.ReadInt32(); this.Unknown = reader.ReadInt32(); }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); this.Unknown = reader.ReadInt32(); this.TextureMapIndex = reader.ReadInt32(); this.Unknown2 = reader.ReadInt32(); }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); this.BoneIndex = reader.ReadInt32(); this.Unknown = reader.ReadSingle(); this.OBBMin = reader.ReadVector3D(); this.OBBMax = reader.ReadVector3D(); }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); for (int i = 0; i < this.GetReadDataLength() / 12; ++i) { this.Vertices.Add(reader.ReadVector3D()); } }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); for (int i = 0; i < this.GetReadDataLength() / 4; ++i) { this.TransformChannelIndices.Add(reader.ReadInt32()); } }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); for (int i = 0; i < this.GetReadDataLength() / 12; ++i) { this.Normals.Add(reader.ReadVector3D()); } }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); this.Unknown = reader.ReadInt32(); // maybe count for whether its UV or UVW for (int i = 0; i < this.GetReadDataLength() / 12; ++i) { this.TextureCoordinates.Add(reader.ReadVector3D()); } }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); this.ParentIndex = reader.ReadInt32(); this.Position = reader.ReadVector3D(); this.Rotation = reader.ReadQuaternion(); this.Scale = reader.ReadMatrix3x3(); if (this.GetReadDataLength() != this.GetWriteDataLength()) throw new Exception("bbb"); }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); this.StringTableIndex = reader.ReadInt32(); for (int i = 0; i < this.ChildNodes.Count; i++) { this.ChildNodes[i].ReadData(reader, directoryOffset); } }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); this.MeshIndex = reader.ReadInt32(); for (int i = 0; i < this.ChildNodes.Count; i++) { this.ChildNodes[i].ReadData(reader, directoryOffset); } }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); this.ParentIndex = reader.ReadInt32(); this.Position = reader.ReadVector3D(); this.Rotation = reader.ReadQuaternion(); this.Scale = reader.ReadMatrix3x3(); if (this.GetReadDataLength() != this.GetWriteDataLength()) { throw new Exception("bbb"); } }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); this.TransformChannelIndex = reader.ReadInt32(); if (this.PreviousSibling != null && ((GrnAnimationTransformTrackKeysNode)this.PreviousSibling).TransformChannelIndex == this.TransformChannelIndex) { return; } // read 5 unknowns for (int i = 0; i < 5; ++i) { this.Unknown[i] = reader.ReadInt32(); } int numPositions = reader.ReadInt32(); int numRotations = reader.ReadInt32(); int numTransforms = reader.ReadInt32(); // read 4 unknowns for (int i = 0; i < 4; ++i) { this.Unknown2[i] = reader.ReadInt32(); } for (int i = 0; i < numPositions; ++i) { this.PositionKeys.Add(reader.ReadSingle()); } for (int i = 0; i < numRotations; ++i) { this.RotationKeys.Add(reader.ReadSingle()); } for (int i = 0; i < numTransforms; ++i) { this.ScaleKeys.Add(reader.ReadSingle()); } for (int i = 0; i < numPositions; ++i) { this.Positions.Add(reader.ReadVector3D()); } for (int i = 0; i < numRotations; ++i) { this.Rotations.Add(reader.ReadQuaternion()); } for (int i = 0; i < numTransforms; ++i) { this.Scales.Add(reader.ReadMatrix3x3()); } }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); int count = reader.ReadInt32(); for (int i = 0; i < count; ++i) { int faceIndex = reader.ReadInt32(); this.TextureIndices.Add(faceIndex, new List<int>()); this.TextureIndices[faceIndex].Add(reader.ReadInt32()); this.TextureIndices[faceIndex].Add(reader.ReadInt32()); this.TextureIndices[faceIndex].Add(reader.ReadInt32()); } }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); Int32 numString = reader.ReadInt32(); Int32 stringDataLength = reader.ReadInt32(); Strings.Capacity = numString; for (int i = 0; i < numString; i++) { Strings.Add(reader.ReadString()); } //reader.ReadBytes((-stringDataLength) & 3); // padding }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); int count = reader.ReadInt32(); for (int i = 0; i < count; ++i) { int faceIndex = reader.ReadInt32(); this.TextureIndices.Add(faceIndex, new List <int>()); this.TextureIndices[faceIndex].Add(reader.ReadInt32()); this.TextureIndices[faceIndex].Add(reader.ReadInt32()); this.TextureIndices[faceIndex].Add(reader.ReadInt32()); } }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); for (int i = 0; i < this.GetReadDataLength() / 24; ++i) { this.Faces.Add(new Face()); this.Faces[i].Indices.Add((Int16)reader.ReadInt32()); this.Faces[i].Indices.Add((Int16)reader.ReadInt32()); this.Faces[i].Indices.Add((Int16)reader.ReadInt32()); this.Faces[i].NormalIndices.Add(reader.ReadInt32()); this.Faces[i].NormalIndices.Add(reader.ReadInt32()); this.Faces[i].NormalIndices.Add(reader.ReadInt32()); } }
public virtual void ReadData(GrnBinaryReader reader, int directoryOffset) { Int32 outputLength = this.GetReadDataLength(); if (outputLength > 0) { reader.Seek((int)this.Offset + directoryOffset, System.IO.SeekOrigin.Begin); Data = reader.ReadBytes(outputLength); } for (int i = 0; i < this.ChildNodes.Count; i++) { this.ChildNodes[i].ReadData(reader, directoryOffset); } }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); int weightsCount = reader.ReadInt32(); this.HighestBoneIndex = reader.ReadInt32(); // unknown (12 Jormund.grn) this.HighestVertexWeightCount = reader.ReadInt32(); // unknown (2 Jormund.grn) for (int i = 0; i < weightsCount; ++i) { this.VertexWeights.Add(new VertexWeight()); int boneCount = reader.ReadInt32(); for (int j = 0; j < boneCount; ++j) { this.VertexWeights[i].BoneIndices.Add(reader.ReadInt32()); this.VertexWeights[i].Weights.Add(reader.ReadSingle()); } } }
public override void ReadData(GrnBinaryReader reader, int directoryOffset) { reader.Seek((int)(this.Offset + directoryOffset), SeekOrigin.Begin); this.DataExtensionIndex = reader.ReadInt32(); }