diff options
author | Teravus Ovares | 2007-12-23 13:14:56 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-12-23 13:14:56 +0000 |
commit | b2903c4a8a2e36f570d824a57587be2b24c24d36 (patch) | |
tree | b8a198d298780c2feeef7f60de13bae2a95ca55a /OpenSim | |
parent | Some log fixing for the LoadRegionsPlugin (diff) | |
download | opensim-SC_OLD-b2903c4a8a2e36f570d824a57587be2b24c24d36.zip opensim-SC_OLD-b2903c4a8a2e36f570d824a57587be2b24c24d36.tar.gz opensim-SC_OLD-b2903c4a8a2e36f570d824a57587be2b24c24d36.tar.bz2 opensim-SC_OLD-b2903c4a8a2e36f570d824a57587be2b24c24d36.tar.xz |
* Patch from Alondria - Added LLFunctions llGetMass(), llGetLandOwnerAt(), llGetVel(), llGround()
Diffstat (limited to 'OpenSim')
3 files changed, 39 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 89dc130..f12fb92 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1964,7 +1964,23 @@ namespace OpenSim.Region.Environment.Scenes | |||
1964 | { | 1964 | { |
1965 | m_eventManager.TriggerOnPluginConsole(args); | 1965 | m_eventManager.TriggerOnPluginConsole(args); |
1966 | } | 1966 | } |
1967 | 1967 | public double GetLandHeight(int x, int y) | |
1968 | { | ||
1969 | return Terrain.GetHeight(x, y); | ||
1970 | } | ||
1971 | public LLUUID GetLandOwner(float x, float y) | ||
1972 | { | ||
1973 | Land land = LandManager.getLandObject(x, y); | ||
1974 | if (land == null) | ||
1975 | { | ||
1976 | return LLUUID.Zero; | ||
1977 | } | ||
1978 | else | ||
1979 | { | ||
1980 | return land.landData.ownerID; | ||
1981 | } | ||
1982 | } | ||
1983 | |||
1968 | #endregion | 1984 | #endregion |
1969 | 1985 | ||
1970 | #region Script Engine | 1986 | #region Script Engine |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 5398de0..66fc53c 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -1225,6 +1225,22 @@ namespace OpenSim.Region.Environment.Scenes | |||
1225 | 1225 | ||
1226 | #endregion | 1226 | #endregion |
1227 | 1227 | ||
1228 | #region Physics | ||
1229 | |||
1230 | public float GetMass() | ||
1231 | { | ||
1232 | if (PhysActor != null) | ||
1233 | { | ||
1234 | return PhysActor.Mass; | ||
1235 | } | ||
1236 | else | ||
1237 | { | ||
1238 | return 0; | ||
1239 | } | ||
1240 | } | ||
1241 | |||
1242 | #endregion | ||
1243 | |||
1228 | #region Texture | 1244 | #region Texture |
1229 | 1245 | ||
1230 | /// <summary> | 1246 | /// <summary> |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs index a0cd43a..909b4e3 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs | |||
@@ -410,8 +410,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
410 | 410 | ||
411 | public double llGround(LSL_Types.Vector3 offset) | 411 | public double llGround(LSL_Types.Vector3 offset) |
412 | { | 412 | { |
413 | NotImplemented("llGround"); | 413 | int x = (int)(m_host.AbsolutePosition.X + offset.x); |
414 | return 0; | 414 | int y = (int)(m_host.AbsolutePosition.Y + offset.y); |
415 | return World.GetLandHeight(x, y); | ||
415 | } | 416 | } |
416 | 417 | ||
417 | public double llCloud(LSL_Types.Vector3 offset) | 418 | public double llCloud(LSL_Types.Vector3 offset) |
@@ -824,8 +825,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
824 | 825 | ||
825 | public LSL_Types.Vector3 llGetVel() | 826 | public LSL_Types.Vector3 llGetVel() |
826 | { | 827 | { |
827 | NotImplemented("llGetVel"); | 828 | return new LSL_Types.Vector3(m_host.Velocity.X, m_host.Velocity.Y, m_host.Velocity.Z); |
828 | return new LSL_Types.Vector3(); | ||
829 | } | 829 | } |
830 | 830 | ||
831 | public LSL_Types.Vector3 llGetAccel() | 831 | public LSL_Types.Vector3 llGetAccel() |
@@ -993,8 +993,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
993 | 993 | ||
994 | public double llGetMass() | 994 | public double llGetMass() |
995 | { | 995 | { |
996 | NotImplemented("llGetMass"); | 996 | return m_host.GetMass(); |
997 | return 0; | ||
998 | } | 997 | } |
999 | 998 | ||
1000 | public void llCollisionFilter(string name, string id, int accept) | 999 | public void llCollisionFilter(string name, string id, int accept) |
@@ -1922,8 +1921,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
1922 | 1921 | ||
1923 | public string llGetLandOwnerAt(LSL_Types.Vector3 pos) | 1922 | public string llGetLandOwnerAt(LSL_Types.Vector3 pos) |
1924 | { | 1923 | { |
1925 | NotImplemented("llGetLandOwnerAt"); | 1924 | return World.GetLandOwner((float)pos.x, (float)pos.y).ToString(); |
1926 | return ""; | ||
1927 | } | 1925 | } |
1928 | 1926 | ||
1929 | public string llGetNotecardLine(string name, int line) | 1927 | public string llGetNotecardLine(string name, int line) |