diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 2296379..4d7ead6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | |||
@@ -302,6 +302,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
302 | float dz; | 302 | float dz; |
303 | 303 | ||
304 | Quaternion q = SensePoint.RotationOffset; | 304 | Quaternion q = SensePoint.RotationOffset; |
305 | if (SensePoint.ParentGroup.RootPart.IsAttachment) | ||
306 | { | ||
307 | // In attachments, the sensor cone always orients with the | ||
308 | // avatar rotation. This may include a nonzero elevation if | ||
309 | // in mouselook. | ||
310 | |||
311 | ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.RootPart.AttachedAvatar); | ||
312 | q = avatar.Rotation; | ||
313 | } | ||
305 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); | 314 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); |
306 | LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); | 315 | LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); |
307 | double mag_fwd = LSL_Types.Vector3.Mag(forward_dir); | 316 | double mag_fwd = LSL_Types.Vector3.Mag(forward_dir); |