corrade-vassal – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 vero 1 using System;
2 using OpenMetaverse;
3  
4 namespace OpenMetaverse.TestClient
5 {
6 public class WindCommand : Command
7 {
8 public WindCommand(TestClient testClient)
9 {
10 Name = "wind";
11 Description = "Displays current wind data";
12 Category = CommandCategory.Simulator;
13 }
14  
15 public override string Execute(string[] args, UUID fromAgentID)
16 {
17 // Get the agent's current "patch" position, where each patch of
18 // wind data is a 16x16m square
19 Vector3 agentPos = Client.Self.SimPosition;
20 int xPos = (int)Utils.Clamp(agentPos.X, 0.0f, 255.0f) / 16;
21 int yPos = (int)Utils.Clamp(agentPos.Y, 0.0f, 255.0f) / 16;
22  
23 Vector2 windSpeed = Client.Network.CurrentSim.WindSpeeds[yPos * 16 + xPos];
24  
25 return "Local wind speed is " + windSpeed.ToString();
26 }
27 }
28 }