public void OnAgentEnteredRegion(ScenePresence avatar) { Vector3 apos; if (m_ready) { if (avatar.HasSafePosition(out apos)) { // Quantize the position to a 16 x 16 x 3 meter box. This reduces // the number of calls into the wind plugin when the avatar density // is high. apos.X = (((int)apos.X) / 16) * 16; apos.Y = (((int)apos.Y) / 16) * 16; apos.Z = (((int)apos.Z) / 3) * 3; if (m_activeWindPlugin != null && apos != windZpos) { // Ask wind plugin to generate a LL wind array for the specified position windSpeeds = m_activeWindPlugin.WindLLClientArray(apos); windZpos = apos; } avatar.ControllingClient.SendWindData(windSpeeds); } } }