mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Thanks jonc, for a patch that adds rendering of classic clouds.
First part of Mantis #964, the necessary clouds image will follow separately.
This commit is contained in:
@@ -1360,7 +1360,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send the region heightmap to the client
|
||||
/// Send the wind matrix to the client
|
||||
/// </summary>
|
||||
/// <param name="windSpeeds">16x16 array of wind speeds</param>
|
||||
public virtual void SendWindData(Vector2[] windSpeeds)
|
||||
@@ -1369,13 +1369,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send terrain layer information to the client.
|
||||
/// Send the cloud matrix to the client
|
||||
/// </summary>
|
||||
/// <param name="windSpeeds">16x16 array of cloud densities</param>
|
||||
public virtual void SendCloudData(float[] cloudDensity)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendCloudData), (object)cloudDensity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send wind layer information to the client.
|
||||
/// </summary>
|
||||
/// <param name="o"></param>
|
||||
private void DoSendWindData(object o)
|
||||
{
|
||||
Vector2[] windSpeeds = (Vector2[])o;
|
||||
|
||||
TerrainPatch[] patches = new TerrainPatch[2];
|
||||
patches[0] = new TerrainPatch();
|
||||
patches[0].Data = new float[16 * 16];
|
||||
@@ -1393,10 +1401,33 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
LayerDataPacket layerpack = TerrainCompressor.CreateLayerDataPacket(patches, TerrainPatch.LayerType.Wind);
|
||||
layerpack.Header.Zerocoded = true;
|
||||
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Wind);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send cloud layer information to the client.
|
||||
/// </summary>
|
||||
/// <param name="o"></param>
|
||||
private void DoSendCloudData(object o)
|
||||
{
|
||||
float[] cloudCover = (float[])o;
|
||||
TerrainPatch[] patches = new TerrainPatch[1];
|
||||
patches[0] = new TerrainPatch();
|
||||
patches[0].Data = new float[16 * 16];
|
||||
|
||||
for (int y = 0; y < 16; y++)
|
||||
{
|
||||
for (int x = 0; x < 16; x++)
|
||||
{
|
||||
patches[0].Data[y * 16 + x] = cloudCover[y * 16 + x];
|
||||
}
|
||||
}
|
||||
|
||||
LayerDataPacket layerpack = TerrainCompressor.CreateLayerDataPacket(patches, TerrainPatch.LayerType.Cloud);
|
||||
layerpack.Header.Zerocoded = true;
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Cloud);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tell the client that the given neighbour region is ready to receive a child agent.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user