aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorUbitUmarov2016-08-05 22:50:15 +0100
committerUbitUmarov2016-08-05 22:50:15 +0100
commit9102f6e5da1731aab9d1f9a449dce781ffd0ba36 (patch)
tree4f70e80611b1ea0aa5eaee19bdca735f615d1cde /OpenSim/Region/ScriptEngine/Shared
parent remove country from avatars DetectParams, since it is only used on a cm func... (diff)
downloadopensim-SC_OLD-9102f6e5da1731aab9d1f9a449dce781ffd0ba36.zip
opensim-SC_OLD-9102f6e5da1731aab9d1f9a449dce781ffd0ba36.tar.gz
opensim-SC_OLD-9102f6e5da1731aab9d1f9a449dce781ffd0ba36.tar.bz2
opensim-SC_OLD-9102f6e5da1731aab9d1f9a449dce781ffd0ba36.tar.xz
fill data for llDetected funtions of collisions closer to the event. (xengine wasn't update with this on merge bc was not used there). fix some parameters
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Helpers.cs76
1 files changed, 58 insertions, 18 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
index d30a1c4..9f34c98 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
@@ -213,24 +213,6 @@ namespace OpenSim.Region.ScriptEngine.Shared
213 if (presence.PresenceType == PresenceType.Npc) 213 if (presence.PresenceType == PresenceType.Npc)
214 Type = 0x20; 214 Type = 0x20;
215 215
216 // Cope Impl. We don't use OS_NPC.
217 //if (presence.PresenceType != PresenceType.Npc)
218 //{
219 // Type = AGENT;
220 //}
221 //else
222 //{
223 // Type = OS_NPC;
224
225 // INPCModule npcModule = scene.RequestModuleInterface<INPCModule>();
226 // INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
227
228 // if (npcData.SenseAsAgent)
229 // {
230 // Type |= AGENT;
231 // }
232 //}
233
234 if (presence.Velocity != Vector3.Zero) 216 if (presence.Velocity != Vector3.Zero)
235 Type |= ACTIVE; 217 Type |= ACTIVE;
236 218
@@ -267,6 +249,64 @@ namespace OpenSim.Region.ScriptEngine.Shared
267 249
268 Velocity = new LSL_Types.Vector3(part.Velocity); 250 Velocity = new LSL_Types.Vector3(part.Velocity);
269 } 251 }
252
253 public void Populate(Scene scene, DetectedObject obj)
254 {
255 if(obj.keyUUID == UUID.Zero) // land
256 {
257 Position = new LSL_Types.Vector3(obj.posVector);
258 Rotation.s = 1.0;
259 return;
260 }
261
262 if((obj.colliderType & 0x21) != 0) // avatar or npc
263 {
264 ScenePresence presence = scene.GetScenePresence(obj.keyUUID);
265 if (presence == null)
266 return;
267
268 Name = obj.nameStr;
269 Owner = obj.keyUUID;
270 Group = obj.groupUUID;
271 Position = new LSL_Types.Vector3(obj.posVector);
272 Rotation = new LSL_Types.Quaternion(obj.rotQuat);
273 Velocity = new LSL_Types.Vector3(obj.velVector);
274 LinkNum = obj.linkNumber;
275 Type = obj.colliderType;
276 return;
277 }
278
279 SceneObjectPart part = scene.GetSceneObjectPart(obj.keyUUID);
280 if(part == null)
281 return;
282
283 Name = obj.nameStr;
284 Owner = obj.keyUUID;
285 Group = obj.groupUUID;
286 Position = new LSL_Types.Vector3(obj.posVector);
287 Rotation = new LSL_Types.Quaternion(obj.rotQuat);
288 Velocity = new LSL_Types.Vector3(obj.velVector);
289 LinkNum = obj.linkNumber;
290 if(obj.velVector == Vector3.Zero)
291 Type = 4;
292 else
293 Type = 2;
294
295 part = part.ParentGroup.RootPart;
296 foreach (SceneObjectPart p in part.ParentGroup.Parts)
297 {
298 if (p.Inventory.ContainsScripts())
299 {
300 // at sl a physical prim is active also if has active scripts
301 // assuming all scripts are in run state to save time
302 if((part.Flags & PrimFlags.Physics) != 0 )
303 Type = 10; // script + active
304 else
305 Type |= SCRIPTED; // Scripted
306 break;
307 }
308 }
309 }
270 } 310 }
271 311
272 /// <summary> 312 /// <summary>