diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 8356dce..dddf913 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | |||
@@ -209,7 +209,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
209 | // Is the sensor type is AGENT and not SCRIPTED then include agents | 209 | // Is the sensor type is AGENT and not SCRIPTED then include agents |
210 | if ((ts.type & (AGENT | AGENT_BY_USERNAME | NPC)) != 0 && (ts.type & SCRIPTED) == 0) | 210 | if ((ts.type & (AGENT | AGENT_BY_USERNAME | NPC)) != 0 && (ts.type & SCRIPTED) == 0) |
211 | { | 211 | { |
212 | sensedEntities.AddRange(doAgentSensor(ts)); | 212 | sensedEntities.AddRange(doAgentSensor(ts)); |
213 | } | 213 | } |
214 | 214 | ||
215 | // If SCRIPTED or PASSIVE or ACTIVE check objects | 215 | // If SCRIPTED or PASSIVE or ACTIVE check objects |
@@ -306,13 +306,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
306 | float dy; | 306 | float dy; |
307 | float dz; | 307 | float dz; |
308 | 308 | ||
309 | Quaternion q = SensePoint.RotationOffset; | 309 | // Quaternion q = SensePoint.RotationOffset; |
310 | Quaternion q = SensePoint.GetWorldRotation(); // non-attached prim Sensor *always* uses World rotation! | ||
310 | if (SensePoint.ParentGroup.IsAttachment) | 311 | if (SensePoint.ParentGroup.IsAttachment) |
311 | { | 312 | { |
312 | // In attachments, the sensor cone always orients with the | 313 | // In attachments, the sensor cone always orients with the |
313 | // avatar rotation. This may include a nonzero elevation if | 314 | // avatar rotation. This may include a nonzero elevation if |
314 | // in mouselook. | 315 | // in mouselook. |
315 | ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar); | 316 | ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar); |
317 | fromRegionPos = avatar.AbsolutePosition; | ||
316 | q = avatar.Rotation; | 318 | q = avatar.Rotation; |
317 | } | 319 | } |
318 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); | 320 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); |
@@ -435,6 +437,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
435 | // avatar rotation. This may include a nonzero elevation if | 437 | // avatar rotation. This may include a nonzero elevation if |
436 | // in mouselook. | 438 | // in mouselook. |
437 | ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar); | 439 | ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar); |
440 | if (avatar == null) | ||
441 | return sensedEntities; | ||
442 | fromRegionPos = avatar.AbsolutePosition; | ||
438 | q = avatar.Rotation; | 443 | q = avatar.Rotation; |
439 | } | 444 | } |
440 | 445 | ||