public void Load(BinaryReader reader, bool endianMismatch = false) { uint numNodes = ReadDword(reader, endianMismatch); nodes = new List <AABBQuantizedNoLeafNode>((int)numNodes); for (int i = 0; i < numNodes; i++) { QuantizedAABB aabb = new QuantizedAABB(); aabb.centerX = ReadShort(reader, endianMismatch); aabb.centerY = ReadShort(reader, endianMismatch); aabb.centerZ = ReadShort(reader, endianMismatch); aabb.extentsX = ReadWord(reader, endianMismatch); aabb.extentsY = ReadWord(reader, endianMismatch); aabb.extentsZ = ReadWord(reader, endianMismatch); uint posData = ReadDword(reader, endianMismatch); uint negData = ReadDword(reader, endianMismatch); nodes.Add(new AABBQuantizedNoLeafNode(aabb, posData, negData)); } centerCoeff.X = ReadFloat(reader, endianMismatch); centerCoeff.Y = ReadFloat(reader, endianMismatch); centerCoeff.Z = ReadFloat(reader, endianMismatch); extentsCoeff.X = ReadFloat(reader, endianMismatch); extentsCoeff.Y = ReadFloat(reader, endianMismatch); extentsCoeff.Z = ReadFloat(reader, endianMismatch); }
public AABBQuantizedNoLeafNode(QuantizedAABB aabb, uint posData, uint negData) { this.aabb = aabb; this.posData = posData; this.negData = negData; }