Beispiel #1
0
 public static void Write(this BinaryWriter writer, Index3 idx)
 {
     writer.Write(idx.Index0);
     writer.Write(idx.Index1);
     writer.Write(idx.Index2);
 }
Beispiel #2
0
		public static BSPNode ReadBSPNode(BinaryReader reader)
		{
			var node = new BSPNode
			{
				flags = ((BSPNodeFlags)reader.ReadByte()),
				negChild = reader.ReadInt16(),
				posChild = reader.ReadInt16(),
				planeDist = reader.ReadPackedFloat()
			};

			var numIndices = reader.ReadUInt16();
			if (numIndices > 0)
			{
				var indices = new Index3[numIndices];
				for (var i = 0; i < numIndices; i++)
				{
					indices[i] = reader.ReadIndex3();
				}
				node.TriIndices = indices;
			}
			else
			{
				node.TriIndices = null;
			}

			return node;
		}