diff options
author | Melanie | 2010-04-21 19:44:19 +0100 |
---|---|---|
committer | Melanie | 2010-04-21 19:44:19 +0100 |
commit | 459323a931f6d4e23d813ef6414ea8e4d511dd76 (patch) | |
tree | ee58f65abc9e05256f9a9a2420df650193258466 /OpenSim/Region/ScriptEngine | |
parent | minor: change a comment and replace some magic numbers with the AssetType enum (diff) | |
download | opensim-SC_OLD-459323a931f6d4e23d813ef6414ea8e4d511dd76.zip opensim-SC_OLD-459323a931f6d4e23d813ef6414ea8e4d511dd76.tar.gz opensim-SC_OLD-459323a931f6d4e23d813ef6414ea8e4d511dd76.tar.bz2 opensim-SC_OLD-459323a931f6d4e23d813ef6414ea8e4d511dd76.tar.xz |
Make the detection cone in attachments face in the direction of the avatar,
not the relative rotation of the attachment towards the avatar.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-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); |