/// <summary> /// Creates a new exterior location node. /// </summary> /// <param name="regionName">Region name.</param> /// <param name="locationName">Location name.</param> /// <returns>LocationNode.</returns> public LocationNode CreateExteriorLocationNode(string regionName, string locationName) { // Get location DFLocation location; if (!LoadDaggerfallLocation( regionName, locationName, out location)) { return(null); } // Reset ground plane texture cache textureManager.ClearGroundTextures(); // Create location node LocationNode locationNode = new LocationNode(location); // Get dimensions of exterior location array int width = location.Exterior.ExteriorData.Width; int height = location.Exterior.ExteriorData.Height; // Build exterior node from blocks for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { // Get final block name string name = blocksFile.CheckName( mapsFile.GetRmbBlockName(ref location, x, y)); // Create block position data SceneNode blockNode = CreateBlockNode(name, location.Climate, false); blockNode.Position = new Vector3( x * rmbSide, 0f, -(y * rmbSide)); // Add block to location node locationNode.Add(blockNode); } } return(locationNode); }
/// <summary> /// Creates a new dungeon location node. /// </summary> /// <param name="regionName">Region name.</param> /// <param name="locationName">Location name.</param> /// <returns>LocationNode.</returns> public LocationNode CreateDungeonLocationNode(string regionName, string locationName) { // Get location DFLocation location; if (!LoadDaggerfallLocation( regionName, locationName, out location)) { return(null); } // Exit if location does not have a dungeon if (!location.HasDungeon) { return(null); } // Create location node LocationNode locationNode = new LocationNode(location); // Create dungeon layout foreach (var block in location.Dungeon.Blocks) { // TODO: Handle duplicate block coordinates (e.g. Orsinium) // Create block position data SceneNode blockNode = CreateBlockNode(block.BlockName, null, false); blockNode.Position = new Vector3( block.X * rdbSide, 0f, -(block.Z * rdbSide)); // Add block to location node locationNode.Add(blockNode); } return(locationNode); }