* Reverted the Simulator.ParcelOverlay change to an array of enums, Buffer.BlockCopy and Array.Copy both barf. Added a comment that you can typecast afterward to decode the byte
* Finished TerrainManager.DecompressWind() and added TerrainManager.WindSpeeds. Holds a 16x16 array of Vector2s, each one representing the wind speed at a 16x16m area * Added a WindCommand to TestClient to print the wind speed where the avatar is standing git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@2241 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
28
Programs/examples/TestClient/Commands/Land/WindCommand.cs
Normal file
28
Programs/examples/TestClient/Commands/Land/WindCommand.cs
Normal file
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user