From 723015e4f0b30b520a6b8e4aa88bacb74cca64c6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 16 Apr 2012 21:58:25 +0100 Subject: [PATCH 1/2] fix (http://opensimulator.org/mantis/view.php?id=5965) llGetObjectMass was bad for sitted avatars not checking for the null physicsactor --- .../Shared/Api/Implementation/LSL_Api.cs | 25 +++++++++++++++++-- 1 file 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 5b5e23e038..8e73eb1cef 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 // return total object mass SceneObjectGroup obj = World.GetGroupByPrim(World.Entities[key].LocalId); if (obj != null) - return (double)obj.GetMass(); + return obj.GetMass(); // the object is null so the key is for an avatar ScenePresence avatar = World.GetScenePresence(key); @@ -9990,7 +9990,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // child agents have a mass of 1.0 return 1; else - return (double)avatar.PhysicsActor.Mass; + return avatar.GetMass(); } catch (KeyNotFoundException) { @@ -11829,6 +11829,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return contacts[0]; } +/* + // not done: + private ContactResult[] testRay2NonPhysicalPhantom(Vector3 rayStart, Vector3 raydir, float raylenght) + { + ContactResult[] contacts = null; + World.ForEachSOG(delegate(SceneObjectGroup group) + { + if (m_host.ParentGroup == group) + return; + + if (group.IsAttachment) + return; + + if(group.RootPart.PhysActor != null) + return; + + contacts = group.RayCastGroupPartsOBBNonPhysicalPhantom(rayStart, raydir, raylenght); + }); + return contacts; + } +*/ public LSL_List llCastRay(LSL_Vector start, LSL_Vector end, LSL_List options) { From 36207b88ffc7801fb15e544e727cb3efaa25d6ea Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 17 Apr 2012 01:00:50 +0100 Subject: [PATCH 2/2] ubitODE: bug fix let avatars colide with volume detectors --- OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs index 3185aad7e4..9c1b87bea8 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs @@ -117,6 +117,7 @@ namespace OpenSim.Region.Physics.OdePlugin // Default, Collide with Other Geometries, spaces, bodies and characters. private CollisionCategories m_collisionFlags = (CollisionCategories.Character | CollisionCategories.Geom + | CollisionCategories.VolumeDtc ); // we do land collisions not ode | CollisionCategories.Land); public IntPtr Body = IntPtr.Zero;