diff options
author | UbitUmarov | 2012-04-09 20:53:29 +0100 |
---|---|---|
committer | UbitUmarov | 2012-04-09 20:53:29 +0100 |
commit | 87fdb2ed7e27e9c161a4d10d9c5b9859dcde5b2d (patch) | |
tree | 89567ff543e05d700cf1cb0bf10be250bd4a925b /OpenSim | |
parent | sop.AddToPhysics(..) fixed and in use. For now it seems it needs to set sop.... (diff) | |
download | opensim-SC-87fdb2ed7e27e9c161a4d10d9c5b9859dcde5b2d.zip opensim-SC-87fdb2ed7e27e9c161a4d10d9c5b9859dcde5b2d.tar.gz opensim-SC-87fdb2ed7e27e9c161a4d10d9c5b9859dcde5b2d.tar.bz2 opensim-SC-87fdb2ed7e27e9c161a4d10d9c5b9859dcde5b2d.tar.xz |
llGetMass and llGetObjectMass (and push estimation) always use object mass as in current SL ( push is what makes sense or impulse will depend on what prim it is and not object). Added llGetMassMKS() that just returns 100 x llGetMass() as it seems to be in SL.
Diffstat (limited to 'OpenSim')
3 files changed, 30 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e71f027..2f61b70 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3176,17 +3176,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3176 | } | 3176 | } |
3177 | else | 3177 | else |
3178 | { | 3178 | { |
3179 | if (m_host.IsRoot) | 3179 | // new SL always returns object mass |
3180 | { | 3180 | // if (m_host.IsRoot) |
3181 | // { | ||
3181 | return m_host.ParentGroup.GetMass(); | 3182 | return m_host.ParentGroup.GetMass(); |
3182 | } | 3183 | // } |
3183 | else | 3184 | // else |
3184 | { | 3185 | // { |
3185 | return m_host.GetMass(); | 3186 | // return m_host.GetMass(); |
3186 | } | 3187 | // } |
3187 | } | 3188 | } |
3188 | } | 3189 | } |
3189 | 3190 | ||
3191 | |||
3192 | public LSL_Float llGetMassMKS() | ||
3193 | { | ||
3194 | return 100f * llGetMass(); | ||
3195 | } | ||
3196 | |||
3190 | public void llCollisionFilter(string name, string id, int accept) | 3197 | public void llCollisionFilter(string name, string id, int accept) |
3191 | { | 3198 | { |
3192 | m_host.AddScriptLPS(1); | 3199 | m_host.AddScriptLPS(1); |
@@ -4959,7 +4966,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4959 | { | 4966 | { |
4960 | float distance = (PusheePos - m_host.AbsolutePosition).Length(); | 4967 | float distance = (PusheePos - m_host.AbsolutePosition).Length(); |
4961 | float distance_term = distance * distance * distance; // Script Energy | 4968 | float distance_term = distance * distance * distance; // Script Energy |
4962 | float pusher_mass = m_host.GetMass(); | 4969 | // use total object mass and not part |
4970 | float pusher_mass = m_host.ParentGroup.GetMass(); | ||
4963 | 4971 | ||
4964 | float PUSH_ATTENUATION_DISTANCE = 17f; | 4972 | float PUSH_ATTENUATION_DISTANCE = 17f; |
4965 | float PUSH_ATTENUATION_SCALE = 5f; | 4973 | float PUSH_ATTENUATION_SCALE = 5f; |
@@ -9964,9 +9972,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9964 | { | 9972 | { |
9965 | try | 9973 | try |
9966 | { | 9974 | { |
9975 | /* | ||
9967 | SceneObjectPart obj = World.GetSceneObjectPart(World.Entities[key].LocalId); | 9976 | SceneObjectPart obj = World.GetSceneObjectPart(World.Entities[key].LocalId); |
9968 | if (obj != null) | 9977 | if (obj != null) |
9969 | return (double)obj.GetMass(); | 9978 | return (double)obj.GetMass(); |
9979 | */ | ||
9980 | // return total object mass | ||
9981 | SceneObjectGroup obj = World.GetGroupByPrim(World.Entities[key].LocalId); | ||
9982 | if (obj != null) | ||
9983 | return (double)obj.GetMass(); | ||
9984 | |||
9970 | // the object is null so the key is for an avatar | 9985 | // the object is null so the key is for an avatar |
9971 | ScenePresence avatar = World.GetScenePresence(key); | 9986 | ScenePresence avatar = World.GetScenePresence(key); |
9972 | if (avatar != null) | 9987 | if (avatar != null) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index b976dc3..5c528977 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | |||
@@ -148,7 +148,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
148 | LSL_Vector llGetLocalPos(); | 148 | LSL_Vector llGetLocalPos(); |
149 | LSL_Rotation llGetLocalRot(); | 149 | LSL_Rotation llGetLocalRot(); |
150 | LSL_Float llGetMass(); | 150 | LSL_Float llGetMass(); |
151 | void llGetNextEmail(string address, string subject); | 151 | LSL_Float llGetMassMKS(); |
152 | void llGetNextEmail(string address, string subject); | ||
152 | LSL_String llGetNotecardLine(string name, int line); | 153 | LSL_String llGetNotecardLine(string name, int line); |
153 | LSL_Key llGetNumberOfNotecardLines(string name); | 154 | LSL_Key llGetNumberOfNotecardLines(string name); |
154 | LSL_Integer llGetNumberOfPrims(); | 155 | LSL_Integer llGetNumberOfPrims(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index bf58d13..70c5fcd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | |||
@@ -581,6 +581,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
581 | return m_LSL_Functions.llGetMass(); | 581 | return m_LSL_Functions.llGetMass(); |
582 | } | 582 | } |
583 | 583 | ||
584 | public LSL_Float llGetMassMKS() | ||
585 | { | ||
586 | return m_LSL_Functions.llGetMassMKS(); | ||
587 | } | ||
588 | |||
584 | public void llGetNextEmail(string address, string subject) | 589 | public void llGetNextEmail(string address, string subject) |
585 | { | 590 | { |
586 | m_LSL_Functions.llGetNextEmail(address, subject); | 591 | m_LSL_Functions.llGetNextEmail(address, subject); |