diff --git a/OpenMetaverse/Simulator.cs b/OpenMetaverse/Simulator.cs
index f825976a..27b16fea 100644
--- a/OpenMetaverse/Simulator.cs
+++ b/OpenMetaverse/Simulator.cs
@@ -243,8 +243,9 @@ namespace OpenMetaverse
public string SimVersion = String.Empty;
///
public string Name = String.Empty;
- ///
- public ParcelOverlayType[] ParcelOverlay = new ParcelOverlayType[4096];
+ /// A 64x64 grid of parcel coloring values. The values stored
+ /// in this array are of the type
+ public byte[] ParcelOverlay = new byte[4096];
///
public int ParcelOverlaysReceived;
///
diff --git a/OpenMetaverse/TerrainManager.cs b/OpenMetaverse/TerrainManager.cs
index 77c0450e..e5211676 100644
--- a/OpenMetaverse/TerrainManager.cs
+++ b/OpenMetaverse/TerrainManager.cs
@@ -46,6 +46,7 @@ namespace OpenMetaverse
public event LandPatchCallback OnLandPatch;
public InternalDictionary SimPatches = new InternalDictionary();
+ public Vector2[] WindSpeeds = new Vector2[256];
private GridClient Client;
@@ -150,12 +151,34 @@ namespace OpenMetaverse
private void DecompressWind(Simulator simulator, BitPack bitpack, TerrainPatch.GroupHeader group)
{
- ;
+ int[] patches = new int[32 * 32];
+
+ // Ignore the simulator stride value
+ group.Stride = group.PatchSize;
+
+ // Each wind packet contains the wind speeds and direction for the entire simulator
+ // stored as two float arrays. The first array is the X value of the wind speed at
+ // each 16x16m block, second is the Y value.
+ // wind_speed = distance(x,y to 0,0)
+ // wind_direction = vec2(x,y)
+
+ // X values
+ TerrainPatch.Header header = TerrainCompressor.DecodePatchHeader(bitpack);
+ TerrainCompressor.DecodePatch(patches, bitpack, header, group.PatchSize);
+ float[] xvalues = TerrainCompressor.DecompressPatch(patches, header, group);
+
+ // Y values
+ header = TerrainCompressor.DecodePatchHeader(bitpack);
+ TerrainCompressor.DecodePatch(patches, bitpack, header, group.PatchSize);
+ float[] yvalues = TerrainCompressor.DecompressPatch(patches, header, group);
+
+ for (int i = 0; i < 256; i++)
+ WindSpeeds[i] = new Vector2(xvalues[i], yvalues[i]);
}
private void DecompressCloud(Simulator simulator, BitPack bitpack, TerrainPatch.GroupHeader group)
{
- ;
+ // FIXME:
}
private void LayerDataHandler(Packet packet, Simulator simulator)
diff --git a/Programs/Simian/Simian.cs b/Programs/Simian/Simian.cs
index 63f627d6..afa2297f 100644
--- a/Programs/Simian/Simian.cs
+++ b/Programs/Simian/Simian.cs
@@ -40,8 +40,6 @@ namespace Simian
public Simian()
{
- Agent lol = new Agent();
- OpenMetaverse.StructuredData.LLSD.SerializeMembers(lol);
}
public bool Start(int port, bool ssl)
diff --git a/Programs/examples/TestClient/Commands/Land/WindCommand.cs b/Programs/examples/TestClient/Commands/Land/WindCommand.cs
new file mode 100644
index 00000000..46459727
--- /dev/null
+++ b/Programs/examples/TestClient/Commands/Land/WindCommand.cs
@@ -0,0 +1,28 @@
+using System;
+using OpenMetaverse;
+
+namespace OpenMetaverse.TestClient
+{
+ public class WindCommand : Command
+ {
+ public WindCommand(TestClient testClient)
+ {
+ Name = "wind";
+ Description = "Displays current wind data";
+ Category = CommandCategory.Simulator;
+ }
+
+ public override string Execute(string[] args, UUID fromAgentID)
+ {
+ // Get the agent's current "patch" position, where each patch of
+ // wind data is a 16x16m square
+ Vector3 agentPos = Client.Self.SimPosition;
+ int xPos = (int)Utils.Clamp(agentPos.X, 0.0f, 255.0f) / 16;
+ int yPos = (int)Utils.Clamp(agentPos.Y, 0.0f, 255.0f) / 16;
+
+ Vector2 windSpeed = Client.Terrain.WindSpeeds[yPos * 16 + xPos];
+
+ return "Local wind speed is " + windSpeed.ToString();
+ }
+ }
+}