Files
libremetaverse/Programs/examples/TestClient/Commands/Land/WindCommand.cs
John Hurliman 9138fee6b0 * Handle "-0" values in wearable assets
* Login fix for Linux clients now that the null ID0 is blacklisted
* Change Parcel from a struct to a class (this object is huge!) and remove the redundant initializers in the constructor
* Moved Terrain and WindSpeed data from TerrainManager to the Simulator class
* Don't track wind data either if STORE_LAND_PATCHES is disabled

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3298 52acb1d6-8a22-11de-b505-999d5b087335
2010-04-21 00:00:54 +00:00

29 lines
927 B
C#

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.Network.CurrentSim.WindSpeeds[yPos * 16 + xPos];
return "Local wind speed is " + windSpeed.ToString();
}
}
}