Пример #1
0
 /// <summary>
 /// Construct a new instance of the ScriptSensorReplyEventArgs
 /// </summary>
 /// <param name="requestorID">The ID of the primitive sending the sensor</param>
 /// <param name="groupID">The ID of the group associated with the primitive</param>
 /// <param name="name">The name of the primitive sending the sensor</param>
 /// <param name="objectID">The ID of the primitive sending the sensor</param>
 /// <param name="ownerID">The ID of the owner of the primitive sending the sensor</param>
 /// <param name="position">The position of the primitive sending the sensor</param>
 /// <param name="range">The range the primitive specified to scan</param>
 /// <param name="rotation">The rotation of the primitive sending the sensor</param>
 /// <param name="type">The type of sensor the primitive sent</param>
 /// <param name="velocity">The velocity of the primitive sending the sensor</param>
 public ScriptSensorReplyEventArgs(UUID requestorID, UUID groupID, string name,
     UUID objectID, UUID ownerID, Vector3 position, float range, Quaternion rotation,
     ScriptSensorTypeFlags type, Vector3 velocity)
 {
     this.m_RequestorID = requestorID;
     this.m_GroupID = groupID;
     this.m_Name = name;
     this.m_ObjectID = objectID;
     this.m_OwnerID = ownerID;
     this.m_Position = position;
     this.m_Range = range;
     this.m_Rotation = rotation;
     this.m_Type = type;
     this.m_Velocity = velocity;
 }
Пример #2
0
        /// <summary>
        /// Requests script detection of objects and avatars
        /// </summary>
        /// <param name="name">name of the object/avatar to search for</param>
        /// <param name="searchID">UUID of the object or avatar to search for</param>
        /// <param name="type">Type of search from ScriptSensorTypeFlags</param>
        /// <param name="range">range of scan (96 max?)</param>
        /// <param name="arc">the arc in radians to search within</param>
        /// <param name="requestID">an user generated ID to correlate replies with</param>
        /// <param name="sim">Simulator to perform search in</param>
        public void RequestScriptSensor(string name, UUID searchID, ScriptSensorTypeFlags type, float range, float arc, UUID requestID, Simulator sim)
        {
            ScriptSensorRequestPacket request = new ScriptSensorRequestPacket();
            request.Requester.Arc = arc;
            request.Requester.Range = range;
            request.Requester.RegionHandle = sim.Handle;
            request.Requester.RequestID = requestID;
            request.Requester.SearchDir = Quaternion.Identity; // TODO: this needs to be tested
            request.Requester.SearchID = searchID;
            request.Requester.SearchName = Utils.StringToBytes(name);
            request.Requester.SearchPos = Vector3.Zero;
            request.Requester.SearchRegions = 0; // TODO: ?
            request.Requester.SourceID = Client.Self.AgentID;
            request.Requester.Type = (int)type;

            Client.Network.SendPacket(request, sim);
        }