aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
authorMelanie2012-04-13 03:03:44 +0100
committerMelanie2012-04-13 03:03:44 +0100
commit5e3a76361fa097a2c47f6d37884786ec5777590c (patch)
tree85d791855e6e3646194a572fae5f2fb3d7a84110 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation
parentMerge branch 'master' into careminster (diff)
parentmake llGetGeometricCenter() work as in current SL. Now this is not real geom ... (diff)
downloadopensim-SC-5e3a76361fa097a2c47f6d37884786ec5777590c.zip
opensim-SC-5e3a76361fa097a2c47f6d37884786ec5777590c.tar.gz
opensim-SC-5e3a76361fa097a2c47f6d37884786ec5777590c.tar.bz2
opensim-SC-5e3a76361fa097a2c47f6d37884786ec5777590c.tar.xz
Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs31
1 files changed, 23 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 783650c..23158b9 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)