void IDefinition.FromArray(byte[] buffer)
 {
     BinaryReader bin = new BinaryReader(new MemoryStream(buffer));
     X = bin.ReadRange();
     Y = bin.ReadRange();
     Z = bin.ReadRange();
     U = bin.ReadRange();
     V = bin.ReadRange();
 }
Example #2
0
        static byte[] GetRangeHandler(BinaryReader requestReader, World world)
        {
            var requestedRange = requestReader.ReadRange();
            var rangeData = world.GetRange(requestedRange);

            using(var responseStream = new MemoryStream())
            {
                using(var responseWriter = new BinaryWriter(responseStream))
                {
                    responseWriter.Write((byte)WorldResponse.Ok);
                    responseWriter.Write(rangeData.Range);
                    responseWriter.Write(rangeData.Data);
                }

                return responseStream.ToArray();
            }
        }
 public FlockDefinitionBlock(BinaryReader binaryReader)
 {
     this.bsp = binaryReader.ReadShortBlockIndex1();
     this.padding = binaryReader.ReadBytes(2);
     this.boundingVolume = binaryReader.ReadShortBlockIndex1();
     this.flags = (Flags)binaryReader.ReadInt16();
     this.ecologyMarginWusDistanceFromEcologyBoundaryThatCreatureBeginsToBeRepulsed = binaryReader.ReadSingle();
     {
         var count = binaryReader.ReadInt32();
         var address = binaryReader.ReadInt32();
         var elementSize = Marshal.SizeOf(typeof(FlockSourceBlock));
         this.sources = new FlockSourceBlock[count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < count; ++i)
             {
                 binaryReader.BaseStream.Position = address + i * elementSize;
                 this.sources[i] = new FlockSourceBlock(binaryReader);
             }
         }
     }
     {
         var count = binaryReader.ReadInt32();
         var address = binaryReader.ReadInt32();
         var elementSize = Marshal.SizeOf(typeof(FlockSinkBlock));
         this.sinks = new FlockSinkBlock[count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < count; ++i)
             {
                 binaryReader.BaseStream.Position = address + i * elementSize;
                 this.sinks[i] = new FlockSinkBlock(binaryReader);
             }
         }
     }
     this.productionFrequencyBoidsSecHowFrequentlyBoidsAreProducedAtOneOfTheSourcesLimitedByTheMaxBoidCount = binaryReader.ReadSingle();
     this.scale = binaryReader.ReadRange();
     this.creature = binaryReader.ReadTagReference();
     this.boidCount = binaryReader.ReadInt32();
     this.neighborhoodRadiusWorldUnitsDistanceWithinWhichOneBoidIsAffectedByAnother = binaryReader.ReadSingle();
     this.avoidanceRadiusWorldUnitsDistanceThatABoidTriesToMaintainFromAnother = binaryReader.ReadSingle();
     this.forwardScale01WeightGivenToBoidsDesireToFlyStraightAhead = binaryReader.ReadSingle();
     this.alignmentScale01WeightGivenToBoidsDesireToAlignItselfWithNeighboringBoids = binaryReader.ReadSingle();
     this.avoidanceScale01WeightGivenToBoidsDesireToAvoidCollisionsWithOtherBoidsWhenWithinTheAvoidanceRadius = binaryReader.ReadSingle();
     this.levelingForceScale01WeightGivenToBoidsDesireToFlyLevel = binaryReader.ReadSingle();
     this.sinkScale01WeightGivenToBoidsDesireToFlyTowardsItsSinks = binaryReader.ReadSingle();
     this.perceptionAngleDegreesAngleFromForwardWithinWhichOneBoidCanPerceiveAndReactToAnother = binaryReader.ReadSingle();
     this.averageThrottle01ThrottleAtWhichBoidsWillNaturallyFly = binaryReader.ReadSingle();
     this.maximumThrottle01MaximumThrottleApplicable = binaryReader.ReadSingle();
     this.positionScale01WeightGivenToBoidsDesireToBeNearFlockCenter = binaryReader.ReadSingle();
     this.positionMinRadiusWusDistanceToFlockCenterBeyondWhichAnAttractingForceIsApplied = binaryReader.ReadSingle();
     this.positionMaxRadiusWusDistanceToFlockCenterAtWhichTheMaximumAttractingForceIsApplied = binaryReader.ReadSingle();
     this.movementWeightThresholdTheThresholdOfAccumulatedWeightOverWhichMovementOccurs = binaryReader.ReadSingle();
     this.dangerRadiusWusDistanceWithinWhichBoidsWillAvoidADangerousObjectEGThePlayer = binaryReader.ReadSingle();
     this.dangerScaleWeightGivenToBoidsDesireToAvoidDanger = binaryReader.ReadSingle();
     this.randomOffsetScale01WeightGivenToBoidsRandomHeadingOffset = binaryReader.ReadSingle();
     this.randomOffsetPeriodSeconds = binaryReader.ReadRange();
     this.flockName = binaryReader.ReadStringID();
 }
 public ScenarioAtmosphericFogPalette(BinaryReader binaryReader)
 {
     this.name = binaryReader.ReadStringID();
     this.color = binaryReader.ReadColorR8G8B8();
     this.spreadDistanceWorldUnitsHowFarFogSpreadsIntoAdjacentClusters0DefaultsTo1 = binaryReader.ReadSingle();
     this.padding = binaryReader.ReadBytes(4);
     this.maximumDensity01FogDensityClampsToThisValue = binaryReader.ReadSingle();
     this.startDistanceWorldUnitsBeforeThisDistanceThereIsNoFog = binaryReader.ReadSingle();
     this.opaqueDistanceWorldUnitsFogBecomesOpaqueMaximumDensityAtThisDistanceFromViewer = binaryReader.ReadSingle();
     this.color0 = binaryReader.ReadColorR8G8B8();
     this.padding0 = binaryReader.ReadBytes(4);
     this.maximumDensity01FogDensityClampsToThisValue0 = binaryReader.ReadSingle();
     this.startDistanceWorldUnitsBeforeThisDistanceThereIsNoFog0 = binaryReader.ReadSingle();
     this.opaqueDistanceWorldUnitsFogBecomesOpaqueMaximumDensityAtThisDistanceFromViewer0 = binaryReader.ReadSingle();
     this.padding1 = binaryReader.ReadBytes(4);
     this.planarColor = binaryReader.ReadColorR8G8B8();
     this.planarMaxDensity01 = binaryReader.ReadSingle();
     this.planarOverrideAmount01 = binaryReader.ReadSingle();
     this.planarMinDistanceBiasWorldUnitsDontAsk = binaryReader.ReadSingle();
     this.padding2 = binaryReader.ReadBytes(44);
     this.patchyColor = binaryReader.ReadColorR8G8B8();
     this.padding3 = binaryReader.ReadBytes(12);
     this.patchyDensity01 = binaryReader.ReadSingle();
     this.patchyDistanceWorldUnits = binaryReader.ReadRange();
     this.padding4 = binaryReader.ReadBytes(32);
     this.patchyFog = binaryReader.ReadTagReference();
     {
         var count = binaryReader.ReadInt32();
         var address = binaryReader.ReadInt32();
         var elementSize = Marshal.SizeOf(typeof(ScenarioAtmosphericFogMixerBlock));
         this.mixers = new ScenarioAtmosphericFogMixerBlock[count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < count; ++i)
             {
                 binaryReader.BaseStream.Position = address + i * elementSize;
                 this.mixers[i] = new ScenarioAtmosphericFogMixerBlock(binaryReader);
             }
         }
     }
     this.amount01 = binaryReader.ReadSingle();
     this.threshold01 = binaryReader.ReadSingle();
     this.brightness01 = binaryReader.ReadSingle();
     this.gammaPower = binaryReader.ReadSingle();
     this.cameraImmersionFlags = (CameraImmersionFlags)binaryReader.ReadInt16();
     this.padding5 = binaryReader.ReadBytes(2);
 }
 public SoundSceneryDatumStruct(BinaryReader binaryReader)
 {
     this.volumeType = (VolumeType)binaryReader.ReadInt32();
     this.height = binaryReader.ReadSingle();
     this.overrideDistanceBounds = binaryReader.ReadRange();
     this.overrideConeAngleBounds = binaryReader.ReadRange();
     this.overrideOuterConeGainDb = binaryReader.ReadSingle();
 }
Example #6
0
 void IDefinition.FromArray(byte[] buffer)
 {
     BinaryReader bin = new BinaryReader(new MemoryStream(buffer));
     x = bin.ReadRange();
     y = bin.ReadRange();
     z = bin.ReadRange();
 }
 public GlobalGeometryCompressionInfoBlock(BinaryReader binaryReader)
 {
     this.positionBoundsX = binaryReader.ReadRange();
     this.positionBoundsY = binaryReader.ReadRange();
     this.positionBoundsZ = binaryReader.ReadRange();
     this.texcoordBoundsX = binaryReader.ReadRange();
     this.texcoordBoundsY = binaryReader.ReadRange();
     this.secondaryTexcoordBoundsX = binaryReader.ReadRange();
     this.secondaryTexcoordBoundsY = binaryReader.ReadRange();
 }
 public ErrorReportsBlock(BinaryReader binaryReader)
 {
     this.type = (Type)binaryReader.ReadInt16();
     this.flags = (Flags)binaryReader.ReadInt16();
     this.paddingtext = binaryReader.ReadBytes(8);
     this.sourceFilename = binaryReader.ReadString32();
     this.sourceLineNumber = binaryReader.ReadInt32();
     this.vertices = ReadVertices(binaryReader);
     this.vectors = ReadVectors(binaryReader);
     this.lines = ReadLines(binaryReader);
     this.triangles = ReadTriangles(binaryReader);
     this.quads = ReadQuads(binaryReader);
     this.comments = ReadComments(binaryReader);
     this.padding = binaryReader.ReadBytes(380);
     this.reportKey = binaryReader.ReadInt32();
     this.nodeIndex = binaryReader.ReadInt32();
     this.boundsX = binaryReader.ReadRange();
     this.boundsY = binaryReader.ReadRange();
     this.boundsZ = binaryReader.ReadRange();
     this.color = binaryReader.ReadVector4();
     this.padding0 = binaryReader.ReadBytes(84);
 }
 public StructureBspAudibilityBlock(BinaryReader binaryReader)
 {
     this.doorPortalCount = binaryReader.ReadInt32();
     this.clusterDistanceBounds = binaryReader.ReadRange();
     {
         var elementSize = Marshal.SizeOf(typeof(DoorEncodedPasBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.encodedDoorPas = new DoorEncodedPasBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.encodedDoorPas[i] = new DoorEncodedPasBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(ClusterDoorPortalEncodedPasBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.clusterDoorPortalEncodedPas = new ClusterDoorPortalEncodedPasBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.clusterDoorPortalEncodedPas[i] = new ClusterDoorPortalEncodedPasBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(AiDeafeningEncodedPasBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.aiDeafeningPas = new AiDeafeningEncodedPasBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.aiDeafeningPas[i] = new AiDeafeningEncodedPasBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(EncodedClusterDistancesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.clusterDistances = new EncodedClusterDistancesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.clusterDistances[i] = new EncodedClusterDistancesBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(OccluderToMachineDoorMapping));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.machineDoorMapping = new OccluderToMachineDoorMapping[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.machineDoorMapping[i] = new OccluderToMachineDoorMapping(binaryReader);
             }
         }
     }
 }
 public ErrorReportsBlock(BinaryReader binaryReader)
 {
     this.type = (Type)binaryReader.ReadInt16();
     this.flags = (Flags)binaryReader.ReadInt16();
     this.paddingtext = binaryReader.ReadBytes(8);
     this.sourceFilename = binaryReader.ReadString32();
     this.sourceLineNumber = binaryReader.ReadInt32();
     {
         var elementSize = Marshal.SizeOf(typeof(ErrorReportVerticesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.vertices = new ErrorReportVerticesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.vertices[i] = new ErrorReportVerticesBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(ErrorReportVectorsBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.vectors = new ErrorReportVectorsBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.vectors[i] = new ErrorReportVectorsBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(ErrorReportLinesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.lines = new ErrorReportLinesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.lines[i] = new ErrorReportLinesBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(ErrorReportTrianglesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.triangles = new ErrorReportTrianglesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.triangles[i] = new ErrorReportTrianglesBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(ErrorReportQuadsBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.quads = new ErrorReportQuadsBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.quads[i] = new ErrorReportQuadsBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(ErrorReportCommentsBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.comments = new ErrorReportCommentsBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.comments[i] = new ErrorReportCommentsBlock(binaryReader);
             }
         }
     }
     this.padding = binaryReader.ReadBytes(380);
     this.reportKey = binaryReader.ReadInt32();
     this.nodeIndex = binaryReader.ReadInt32();
     this.boundsX = binaryReader.ReadRange();
     this.boundsY = binaryReader.ReadRange();
     this.boundsZ = binaryReader.ReadRange();
     this.color = binaryReader.ReadVector4();
     this.padding0 = binaryReader.ReadBytes(84);
 }
 public StructureBspClusterBlock(BinaryReader binaryReader)
 {
     this.sectionInfo = new GlobalGeometrySectionInfoStruct(binaryReader);
     this.geometryBlockInfo = new Moonfish.Tags.GlobalGeometryBlockInfoStruct(binaryReader);
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspClusterDataBlockNew));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.clusterData = new StructureBspClusterDataBlockNew[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.clusterData[i] = new StructureBspClusterDataBlockNew(binaryReader);
             }
         }
     }
     this.boundsX = binaryReader.ReadRange();
     this.boundsY = binaryReader.ReadRange();
     this.boundsZ = binaryReader.ReadRange();
     this.scenarioSkyIndex = binaryReader.ReadByte();
     this.mediaIndex = binaryReader.ReadByte();
     this.scenarioVisibleSkyIndex = binaryReader.ReadByte();
     this.scenarioAtmosphericFogIndex = binaryReader.ReadByte();
     this.planarFogDesignator = binaryReader.ReadByte();
     this.visibleFogPlaneIndex = binaryReader.ReadByte();
     this.backgroundSound = binaryReader.ReadShortBlockIndex1();
     this.soundEnvironment = binaryReader.ReadShortBlockIndex1();
     this.weather = binaryReader.ReadShortBlockIndex1();
     this.transitionStructureBSP = binaryReader.ReadInt16();
     this.padding = binaryReader.ReadBytes(2);
     this.padding0 = binaryReader.ReadBytes(4);
     this.flags = (Flags)binaryReader.ReadInt16();
     this.padding1 = binaryReader.ReadBytes(2);
     {
         var elementSize = Marshal.SizeOf(typeof(PredictedResourceBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.predictedResources = new PredictedResourceBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.predictedResources[i] = new PredictedResourceBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspClusterPortalIndexBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.portals = new StructureBspClusterPortalIndexBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.portals[i] = new StructureBspClusterPortalIndexBlock(binaryReader);
             }
         }
     }
     this.checksumFromStructure = binaryReader.ReadInt32();
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspClusterInstancedGeometryIndexBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.instancedGeometryIndices = new StructureBspClusterInstancedGeometryIndexBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.instancedGeometryIndices[i] = new StructureBspClusterInstancedGeometryIndexBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(GlobalGeometrySectionStripIndexBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.indexReorderTable = new GlobalGeometrySectionStripIndexBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.indexReorderTable[i] = new GlobalGeometrySectionStripIndexBlock(binaryReader);
             }
         }
     }
     this.paddingcollisionMoppCode = binaryReader.ReadBytes(8);
 }
 public ScenarioStructureBSP(BinaryReader binaryReader)
 {
     {
         var elementSize = Marshal.SizeOf(typeof(GlobalTagImportInfoBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.importInfo = new GlobalTagImportInfoBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.importInfo[i] = new GlobalTagImportInfoBlock(binaryReader);
             }
         }
     }
     this.padding = binaryReader.ReadBytes(4);
     {
         var elementSize = Marshal.SizeOf(typeof(StructureCollisionMaterialsBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.collisionMaterials = new StructureCollisionMaterialsBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.collisionMaterials[i] = new StructureCollisionMaterialsBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(GlobalCollisionBspBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.collisionBSP = new GlobalCollisionBspBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.collisionBSP[i] = new GlobalCollisionBspBlock(binaryReader);
             }
         }
     }
     this.vehicleFloorWorldUnitsHeightBelowWhichVehiclesGetPushedUpByAnUnstoppableForce = binaryReader.ReadSingle();
     this.vehicleCeilingWorldUnitsHeightAboveWhichVehiclesGetPushedDownByAnUnstoppableForce = binaryReader.ReadSingle();
     {
         var elementSize = Marshal.SizeOf(typeof(UNUSEDStructureBspNodeBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.uNUSEDNodes = new UNUSEDStructureBspNodeBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.uNUSEDNodes[i] = new UNUSEDStructureBspNodeBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspLeafBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.leaves = new StructureBspLeafBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.leaves[i] = new StructureBspLeafBlock(binaryReader);
             }
         }
     }
     this.worldBoundsX = binaryReader.ReadRange();
     this.worldBoundsY = binaryReader.ReadRange();
     this.worldBoundsZ = binaryReader.ReadRange();
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspSurfaceReferenceBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.surfaceReferences = new StructureBspSurfaceReferenceBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.surfaceReferences[i] = new StructureBspSurfaceReferenceBlock(binaryReader);
             }
         }
     }
     this.paddingclusterData = binaryReader.ReadBytes(8);
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspClusterPortalBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.clusterPortals = new StructureBspClusterPortalBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.clusterPortals[i] = new StructureBspClusterPortalBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspFogPlaneBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.fogPlanes = new StructureBspFogPlaneBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.fogPlanes[i] = new StructureBspFogPlaneBlock(binaryReader);
             }
         }
     }
     this.padding0 = binaryReader.ReadBytes(24);
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspWeatherPaletteBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.weatherPalette = new StructureBspWeatherPaletteBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.weatherPalette[i] = new StructureBspWeatherPaletteBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspWeatherPolyhedronBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.weatherPolyhedra = new StructureBspWeatherPolyhedronBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.weatherPolyhedra[i] = new StructureBspWeatherPolyhedronBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspDetailObjectDataBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.detailObjects = new StructureBspDetailObjectDataBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.detailObjects[i] = new StructureBspDetailObjectDataBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspClusterBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.clusters = new StructureBspClusterBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.clusters[i] = new StructureBspClusterBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(GlobalGeometryMaterialBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.materials = new GlobalGeometryMaterialBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.materials[i] = new GlobalGeometryMaterialBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspSkyOwnerClusterBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.skyOwnerCluster = new StructureBspSkyOwnerClusterBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.skyOwnerCluster[i] = new StructureBspSkyOwnerClusterBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspConveyorSurfaceBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.conveyorSurfaces = new StructureBspConveyorSurfaceBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.conveyorSurfaces[i] = new StructureBspConveyorSurfaceBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspBreakableSurfaceBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.breakableSurfaces = new StructureBspBreakableSurfaceBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.breakableSurfaces[i] = new StructureBspBreakableSurfaceBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(PathfindingDataBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.pathfindingData = new PathfindingDataBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.pathfindingData[i] = new PathfindingDataBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspPathfindingEdgesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.pathfindingEdges = new StructureBspPathfindingEdgesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.pathfindingEdges[i] = new StructureBspPathfindingEdgesBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspBackgroundSoundPaletteBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.backgroundSoundPalette = new StructureBspBackgroundSoundPaletteBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.backgroundSoundPalette[i] = new StructureBspBackgroundSoundPaletteBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspSoundEnvironmentPaletteBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.soundEnvironmentPalette = new StructureBspSoundEnvironmentPaletteBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.soundEnvironmentPalette[i] = new StructureBspSoundEnvironmentPaletteBlock(binaryReader);
             }
         }
     }
     this.paddingsoundPASData = binaryReader.ReadBytes(8);
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspMarkerBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.markers = new StructureBspMarkerBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.markers[i] = new StructureBspMarkerBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspRuntimeDecalBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.runtimeDecals = new StructureBspRuntimeDecalBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.runtimeDecals[i] = new StructureBspRuntimeDecalBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspEnvironmentObjectPaletteBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.environmentObjectPalette = new StructureBspEnvironmentObjectPaletteBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.environmentObjectPalette[i] = new StructureBspEnvironmentObjectPaletteBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspEnvironmentObjectBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.environmentObjects = new StructureBspEnvironmentObjectBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.environmentObjects[i] = new StructureBspEnvironmentObjectBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspLightmapDataBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.lightmaps = new StructureBspLightmapDataBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.lightmaps[i] = new StructureBspLightmapDataBlock(binaryReader);
             }
         }
     }
     this.padding1 = binaryReader.ReadBytes(4);
     {
         var elementSize = Marshal.SizeOf(typeof(GlobalMapLeafBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.leafMapLeaves = new GlobalMapLeafBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.leafMapLeaves[i] = new GlobalMapLeafBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(GlobalLeafConnectionBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.leafMapConnections = new GlobalLeafConnectionBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.leafMapConnections[i] = new GlobalLeafConnectionBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(GlobalErrorReportCategoriesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.errors = new GlobalErrorReportCategoriesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.errors[i] = new GlobalErrorReportCategoriesBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspPrecomputedLightingBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.precomputedLighting = new StructureBspPrecomputedLightingBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.precomputedLighting[i] = new StructureBspPrecomputedLightingBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspInstancedGeometryDefinitionBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.instancedGeometriesDefinitions = new StructureBspInstancedGeometryDefinitionBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.instancedGeometriesDefinitions[i] = new StructureBspInstancedGeometryDefinitionBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspInstancedGeometryInstancesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.instancedGeometryInstances = new StructureBspInstancedGeometryInstancesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.instancedGeometryInstances[i] = new StructureBspInstancedGeometryInstancesBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspSoundClusterBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.ambienceSoundClusters = new StructureBspSoundClusterBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.ambienceSoundClusters[i] = new StructureBspSoundClusterBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspSoundClusterBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.reverbSoundClusters = new StructureBspSoundClusterBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.reverbSoundClusters[i] = new StructureBspSoundClusterBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(TransparentPlanesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.transparentPlanes = new TransparentPlanesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.transparentPlanes[i] = new TransparentPlanesBlock(binaryReader);
             }
         }
     }
     this.padding2 = binaryReader.ReadBytes(96);
     this.vehicleSpericalLimitRadiusDistancesThisFarAndLongerFromLimitOriginWillPullYouBackIn = binaryReader.ReadSingle();
     this.vehicleSpericalLimitCenterCenterOfSpaceInWhichVehicleCanMove = binaryReader.ReadVector3();
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspDebugInfoBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.debugInfo = new StructureBspDebugInfoBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.debugInfo[i] = new StructureBspDebugInfoBlock(binaryReader);
             }
         }
     }
     this.decorators = binaryReader.ReadTagReference();
     this.structurePhysics = new GlobalStructurePhysicsStruct(binaryReader);
     {
         var elementSize = Marshal.SizeOf(typeof(GlobalWaterDefinitionsBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.waterDefinitions = new GlobalWaterDefinitionsBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.waterDefinitions[i] = new GlobalWaterDefinitionsBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructurePortalDeviceMappingBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.portalDeviceMapping = new StructurePortalDeviceMappingBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.portalDeviceMapping[i] = new StructurePortalDeviceMappingBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspAudibilityBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.audibility = new StructureBspAudibilityBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.audibility[i] = new StructureBspAudibilityBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspFakeLightprobesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.objectFakeLightprobes = new StructureBspFakeLightprobesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.objectFakeLightprobes[i] = new StructureBspFakeLightprobesBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(DecoratorPlacementDefinitionBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.decorators0 = new DecoratorPlacementDefinitionBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.decorators0[i] = new DecoratorPlacementDefinitionBlock(binaryReader);
             }
         }
     }
 }