Now back to compiling, just no terrain generation at the moment

0.1-prestable
MW 2007-04-06 19:08:24 +00:00
parent e0b84e0aa1
commit 0311fef244
7 changed files with 16 additions and 15 deletions

View File

@ -49,7 +49,7 @@ namespace OpenSim.Physics.Manager
public abstract void GetResults();
public abstract void SetTerrain(float[,] heightMap);
public abstract void SetTerrain(float[] heightMap);
public abstract void DeleteTerrain();
@ -87,7 +87,7 @@ namespace OpenSim.Physics.Manager
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("NullPhysicsScene : GetResults()");
}
public override void SetTerrain(float[,] heightMap)
public override void SetTerrain(float[] heightMap)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("NullPhysicsScene : SetTerrain({0} items)", heightMap.Length);
}

View File

@ -173,7 +173,7 @@ namespace OpenSim.Physics.OdePlugin
}
}
public override void SetTerrain(float[,] heightMap)
public override void SetTerrain(float[] heightMap)
{
for (int i = 0; i < 65536; i++)
{

View File

@ -173,7 +173,7 @@ namespace OpenSim.Physics.PhysXPlugin
}
}
public override void SetTerrain(float[,] heightMap)
public override void SetTerrain(float[] heightMap)
{
if (this._heightMap != null)
{

View File

@ -156,7 +156,7 @@ namespace OpenSim
m_console.WriteLine("Main.cs:Startup() - Starting up messaging system");
LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine); //should be reading from the config file what physics engine to use
LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.map);
LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D());
//should be passing a IGenericConfig object to these so they can read the config data they want from it
GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey);

View File

@ -195,7 +195,7 @@ namespace OpenSim.world
lock (this.LockPhysicsEngine)
{
this.phyScene.SetTerrain(Terrain.map);
this.phyScene.SetTerrain(Terrain.getHeights1D());
}
this.localStorage.SaveMap(this.Terrain.map);
@ -215,7 +215,7 @@ namespace OpenSim.world
this.Terrain.map = newMap;
lock (this.LockPhysicsEngine)
{
this.phyScene.SetTerrain(this.Terrain.map);
this.phyScene.SetTerrain(this.Terrain.getHeights1D());
}
this.localStorage.SaveMap(this.Terrain.map);
@ -236,7 +236,7 @@ namespace OpenSim.world
{
lock (this.LockPhysicsEngine)
{
this.phyScene.SetTerrain(this.Terrain.map);
this.phyScene.SetTerrain(this.Terrain.getHeights1D());
}
this.localStorage.SaveMap(this.Terrain.map);
@ -290,7 +290,7 @@ namespace OpenSim.world
patches[2] = x + 2 + y * 16;
patches[3] = x + 3 + y * 16;
Packet layerpack = TerrainManager.CreateLandPacket(Terrain.map, patches);
Packet layerpack = TerrainManager.CreateLandPacket(Terrain.getHeights1D(), patches);
RemoteClient.OutPacket(layerpack);
}
}
@ -312,7 +312,7 @@ namespace OpenSim.world
//patches[2] = patchx + 2 + patchy * 16;
//patches[3] = patchx + 3 + patchy * 16;
Packet layerpack = TerrainManager.CreateLandPacket(Terrain.map, patches);
Packet layerpack = TerrainManager.CreateLandPacket(Terrain.getHeights1D(), patches);
RemoteClient.OutPacket(layerpack);
}

View File

@ -118,11 +118,11 @@ namespace OpenSim.Storage.LocalStorageDb4o
}
}
public float[] LoadWorld()
public float[,] LoadWorld()
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LoadWorld() - Loading world....");
//World blank = new World();
float[] heightmap = null;
float[,] heightmap = null;
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LoadWorld() - Looking for a heightmap in local DB");
IObjectSet world_result = db.Get(typeof(MapStorage));
if (world_result.Count > 0)
@ -137,7 +137,8 @@ namespace OpenSim.Storage.LocalStorageDb4o
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LoadWorld() - No heightmap found, generating new one");
HeightmapGenHills hills = new HeightmapGenHills();
// blank.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
heightmap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
// heightmap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
heightmap = new float[256, 256];
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LoadWorld() - Saving heightmap to local database");
MapStorage map = new MapStorage();
map.Map = heightmap; //blank.LandMap;
@ -147,7 +148,7 @@ namespace OpenSim.Storage.LocalStorageDb4o
return heightmap;
}
public void SaveMap(float[] heightmap)
public void SaveMap(float[,] heightmap)
{
IObjectSet world_result = db.Get(typeof(MapStorage));
if (world_result.Count > 0)

View File

@ -6,7 +6,7 @@ namespace OpenSim.Storage.LocalStorageDb4o
{
public class MapStorage
{
public float[] Map;
public float[,] Map;
public MapStorage()
{