diff options
author | UbitUmarov | 2012-04-16 21:58:25 +0100 |
---|---|---|
committer | UbitUmarov | 2012-04-16 21:58:25 +0100 |
commit | 723015e4f0b30b520a6b8e4aa88bacb74cca64c6 (patch) | |
tree | 642f42fc96ee4075783dba12f5646b7be41043dc /OpenSim/Region/ScriptEngine/Shared | |
parent | ubitODE: - fix remove characters from default raycasts filters as older code ... (diff) | |
download | opensim-SC_OLD-723015e4f0b30b520a6b8e4aa88bacb74cca64c6.zip opensim-SC_OLD-723015e4f0b30b520a6b8e4aa88bacb74cca64c6.tar.gz opensim-SC_OLD-723015e4f0b30b520a6b8e4aa88bacb74cca64c6.tar.bz2 opensim-SC_OLD-723015e4f0b30b520a6b8e4aa88bacb74cca64c6.tar.xz |
fix (http://opensimulator.org/mantis/view.php?id=5965) llGetObjectMass was bad for sitted avatars not checking for the null physicsactor
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5b5e23e..8e73eb1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -9980,7 +9980,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9980 | // return total object mass | 9980 | // return total object mass |
9981 | SceneObjectGroup obj = World.GetGroupByPrim(World.Entities[key].LocalId); | 9981 | SceneObjectGroup obj = World.GetGroupByPrim(World.Entities[key].LocalId); |
9982 | if (obj != null) | 9982 | if (obj != null) |
9983 | return (double)obj.GetMass(); | 9983 | return obj.GetMass(); |
9984 | 9984 | ||
9985 | // the object is null so the key is for an avatar | 9985 | // the object is null so the key is for an avatar |
9986 | ScenePresence avatar = World.GetScenePresence(key); | 9986 | ScenePresence avatar = World.GetScenePresence(key); |
@@ -9990,7 +9990,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9990 | // child agents have a mass of 1.0 | 9990 | // child agents have a mass of 1.0 |
9991 | return 1; | 9991 | return 1; |
9992 | else | 9992 | else |
9993 | return (double)avatar.PhysicsActor.Mass; | 9993 | return avatar.GetMass(); |
9994 | } | 9994 | } |
9995 | catch (KeyNotFoundException) | 9995 | catch (KeyNotFoundException) |
9996 | { | 9996 | { |
@@ -11829,6 +11829,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11829 | 11829 | ||
11830 | return contacts[0]; | 11830 | return contacts[0]; |
11831 | } | 11831 | } |
11832 | /* | ||
11833 | // not done: | ||
11834 | private ContactResult[] testRay2NonPhysicalPhantom(Vector3 rayStart, Vector3 raydir, float raylenght) | ||
11835 | { | ||
11836 | ContactResult[] contacts = null; | ||
11837 | World.ForEachSOG(delegate(SceneObjectGroup group) | ||
11838 | { | ||
11839 | if (m_host.ParentGroup == group) | ||
11840 | return; | ||
11841 | |||
11842 | if (group.IsAttachment) | ||
11843 | return; | ||
11844 | |||
11845 | if(group.RootPart.PhysActor != null) | ||
11846 | return; | ||
11847 | |||
11848 | contacts = group.RayCastGroupPartsOBBNonPhysicalPhantom(rayStart, raydir, raylenght); | ||
11849 | }); | ||
11850 | return contacts; | ||
11851 | } | ||
11852 | */ | ||
11832 | 11853 | ||
11833 | public LSL_List llCastRay(LSL_Vector start, LSL_Vector end, LSL_List options) | 11854 | public LSL_List llCastRay(LSL_Vector start, LSL_Vector end, LSL_List options) |
11834 | { | 11855 | { |