aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/world
diff options
context:
space:
mode:
authorgareth2007-02-28 17:01:25 +0000
committergareth2007-02-28 17:01:25 +0000
commitb9f7e6c69f47ecdd5b24013e892d850764a67f49 (patch)
tree3d67139111de513265ecd9c09da862b6e85a9552 /src/world
parentImported MW's terrain encoder/decoder (diff)
downloadopensim-SC_OLD-b9f7e6c69f47ecdd5b24013e892d850764a67f49.zip
opensim-SC_OLD-b9f7e6c69f47ecdd5b24013e892d850764a67f49.tar.gz
opensim-SC_OLD-b9f7e6c69f47ecdd5b24013e892d850764a67f49.tar.bz2
opensim-SC_OLD-b9f7e6c69f47ecdd5b24013e892d850764a67f49.tar.xz
Got LayerData working, need asset management to get the avatar to display
Diffstat (limited to 'src/world')
-rw-r--r--src/world/Avatar.cs4
-rw-r--r--src/world/TerrainDecoder.cs2
-rw-r--r--src/world/World.cs26
3 files changed, 21 insertions, 11 deletions
diff --git a/src/world/Avatar.cs b/src/world/Avatar.cs
index 863ce29..dfb739e 100644
--- a/src/world/Avatar.cs
+++ b/src/world/Avatar.cs
@@ -25,7 +25,7 @@ namespace OpenSim.world
25 mov.Data.RegionHandle = OpenSim_Main.cfg.RegionHandle; 25 mov.Data.RegionHandle = OpenSim_Main.cfg.RegionHandle;
26 // TODO - dynamicalise this stuff 26 // TODO - dynamicalise this stuff
27 mov.Data.Timestamp = 1169838966; 27 mov.Data.Timestamp = 1169838966;
28 mov.Data.Position = new LLVector3(100f, 100f, 22f); 28 mov.Data.Position = new LLVector3(100f, 100f, 35f);
29 mov.Data.LookAt = new LLVector3(0.99f, 0.042f, 0); 29 mov.Data.LookAt = new LLVector3(0.99f, 0.042f, 0);
30 30
31 Console.WriteLine("Sending AgentMovementComplete packet"); 31 Console.WriteLine("Sending AgentMovementComplete packet");
@@ -49,7 +49,7 @@ namespace OpenSim.world
49 handshake.RegionInfo.TerrainStartHeight10 = 20; 49 handshake.RegionInfo.TerrainStartHeight10 = 20;
50 handshake.RegionInfo.TerrainStartHeight11 = 20; 50 handshake.RegionInfo.TerrainStartHeight11 = 20;
51 handshake.RegionInfo.SimAccess = 13; 51 handshake.RegionInfo.SimAccess = 13;
52 handshake.RegionInfo.WaterHeight = 5; 52 handshake.RegionInfo.WaterHeight = 10;
53 handshake.RegionInfo.RegionFlags = 72458694; 53 handshake.RegionInfo.RegionFlags = 72458694;
54 handshake.RegionInfo.SimName = _enc.GetBytes(OpenSim_Main.cfg.RegionName + "\0"); 54 handshake.RegionInfo.SimName = _enc.GetBytes(OpenSim_Main.cfg.RegionName + "\0");
55 handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000"); 55 handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000");
diff --git a/src/world/TerrainDecoder.cs b/src/world/TerrainDecoder.cs
index 0f1b733..0c72c92 100644
--- a/src/world/TerrainDecoder.cs
+++ b/src/world/TerrainDecoder.cs
@@ -410,7 +410,7 @@ namespace OpenSim
410 return output; 410 return output;
411 } 411 }
412 412
413 public Packet CreateLayerPacket(float[] heightmap, int minX, int maxX, int minY, int maxY) 413 public Packet CreateLayerPacket(float[] heightmap, int minX, int minY, int maxX, int maxY)
414 { 414 {
415 //int minX = 0, maxX = 2, minY = 0, maxY = 1; //these should be passed to this function 415 //int minX = 0, maxX = 2, minY = 0, maxY = 1; //these should be passed to this function
416 LayerDataPacket layer = new LayerDataPacket(); 416 LayerDataPacket layer = new LayerDataPacket();
diff --git a/src/world/World.cs b/src/world/World.cs
index cf337a8..d7e3370 100644
--- a/src/world/World.cs
+++ b/src/world/World.cs
@@ -1,5 +1,6 @@
1using System; 1using System;
2using libsecondlife; 2using libsecondlife;
3using libsecondlife.Packets;
3using System.Collections.Generic; 4using System.Collections.Generic;
4using System.Text; 5using System.Text;
5 6
@@ -8,8 +9,10 @@ namespace OpenSim.world
8 public class World 9 public class World
9 { 10 {
10 public Dictionary<libsecondlife.LLUUID, Entity> Entities; 11 public Dictionary<libsecondlife.LLUUID, Entity> Entities;
11 public SurfacePatch[] LandMap; 12 public float[] LandMap;
12 public ScriptEngine Scripts; 13 public ScriptEngine Scripts;
14 public TerrainDecode terrainengine = new TerrainDecode();
15
13 16
14 public World() 17 public World()
15 { 18 {
@@ -18,13 +21,13 @@ namespace OpenSim.world
18 21
19 // We need a 16x16 array of 16m2 surface patches for a 256m2 sim 22 // We need a 16x16 array of 16m2 surface patches for a 256m2 sim
20 Console.WriteLine("World.cs - creating LandMap"); 23 Console.WriteLine("World.cs - creating LandMap");
21 LandMap = new SurfacePatch[16*16]; 24 terrainengine = new TerrainDecode();
22 int xinc; 25 LandMap = new float[65536];
23 int yinc; 26 for(int i =0; i < 65536; i++) {
24 for(xinc=0; xinc<16; xinc++) for(yinc=0; yinc<16; yinc++) { 27 LandMap[i] = 30.4989f;
25 LandMap[xinc+(yinc*16)]=new SurfacePatch(); 28 }
26 } 29
27 30
28 Console.WriteLine("World.cs - Creating script engine instance"); 31 Console.WriteLine("World.cs - Creating script engine instance");
29 // Initialise this only after the world has loaded 32 // Initialise this only after the world has loaded
30 Scripts = new ScriptEngine(this); 33 Scripts = new ScriptEngine(this);
@@ -38,6 +41,13 @@ namespace OpenSim.world
38 } 41 }
39 } 42 }
40 43
44 public void SendLayerData(OpenSimClient RemoteClient) {
45 for(int i=1; i<16; i++) {
46 Packet layerpack=this.terrainengine.CreateLayerPacket(LandMap, i,1,1,16);
47 RemoteClient.OutPacket(layerpack);
48 }
49 }
50
41 public void AddViewerAgent(OpenSimClient AgentClient) { 51 public void AddViewerAgent(OpenSimClient AgentClient) {
42 Console.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); 52 Console.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent");
43 Avatar NewAvatar = new Avatar(AgentClient); 53 Avatar NewAvatar = new Avatar(AgentClient);