* Patch from Alondria - Added LLFunctions llGetMass(), llGetLandOwnerAt(), llGetVel(), llGround()

afrisby
Teravus Ovares 2007-12-23 13:14:56 +00:00
parent 984f2da17d
commit b2903c4a8a
3 changed files with 39 additions and 9 deletions

View File

@ -1964,7 +1964,23 @@ namespace OpenSim.Region.Environment.Scenes
{ {
m_eventManager.TriggerOnPluginConsole(args); m_eventManager.TriggerOnPluginConsole(args);
} }
public double GetLandHeight(int x, int y)
{
return Terrain.GetHeight(x, y);
}
public LLUUID GetLandOwner(float x, float y)
{
Land land = LandManager.getLandObject(x, y);
if (land == null)
{
return LLUUID.Zero;
}
else
{
return land.landData.ownerID;
}
}
#endregion #endregion
#region Script Engine #region Script Engine

View File

@ -1225,6 +1225,22 @@ namespace OpenSim.Region.Environment.Scenes
#endregion #endregion
#region Physics
public float GetMass()
{
if (PhysActor != null)
{
return PhysActor.Mass;
}
else
{
return 0;
}
}
#endregion
#region Texture #region Texture
/// <summary> /// <summary>

View File

@ -410,8 +410,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
public double llGround(LSL_Types.Vector3 offset) public double llGround(LSL_Types.Vector3 offset)
{ {
NotImplemented("llGround"); int x = (int)(m_host.AbsolutePosition.X + offset.x);
return 0; int y = (int)(m_host.AbsolutePosition.Y + offset.y);
return World.GetLandHeight(x, y);
} }
public double llCloud(LSL_Types.Vector3 offset) public double llCloud(LSL_Types.Vector3 offset)
@ -824,8 +825,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
public LSL_Types.Vector3 llGetVel() public LSL_Types.Vector3 llGetVel()
{ {
NotImplemented("llGetVel"); return new LSL_Types.Vector3(m_host.Velocity.X, m_host.Velocity.Y, m_host.Velocity.Z);
return new LSL_Types.Vector3();
} }
public LSL_Types.Vector3 llGetAccel() public LSL_Types.Vector3 llGetAccel()
@ -993,8 +993,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
public double llGetMass() public double llGetMass()
{ {
NotImplemented("llGetMass"); return m_host.GetMass();
return 0;
} }
public void llCollisionFilter(string name, string id, int accept) public void llCollisionFilter(string name, string id, int accept)
@ -1922,8 +1921,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
public string llGetLandOwnerAt(LSL_Types.Vector3 pos) public string llGetLandOwnerAt(LSL_Types.Vector3 pos)
{ {
NotImplemented("llGetLandOwnerAt"); return World.GetLandOwner((float)pos.x, (float)pos.y).ToString();
return "";
} }
public string llGetNotecardLine(string name, int line) public string llGetNotecardLine(string name, int line)