aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/world/World.cs
diff options
context:
space:
mode:
authorgareth2007-02-28 17:01:25 +0000
committergareth2007-02-28 17:01:25 +0000
commitb9f7e6c69f47ecdd5b24013e892d850764a67f49 (patch)
tree3d67139111de513265ecd9c09da862b6e85a9552 /src/world/World.cs
parentImported MW's terrain encoder/decoder (diff)
downloadopensim-SC-b9f7e6c69f47ecdd5b24013e892d850764a67f49.zip
opensim-SC-b9f7e6c69f47ecdd5b24013e892d850764a67f49.tar.gz
opensim-SC-b9f7e6c69f47ecdd5b24013e892d850764a67f49.tar.bz2
opensim-SC-b9f7e6c69f47ecdd5b24013e892d850764a67f49.tar.xz
Got LayerData working, need asset management to get the avatar to display
Diffstat (limited to 'src/world/World.cs')
-rw-r--r--src/world/World.cs26
1 files changed, 18 insertions, 8 deletions
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);