* Replace Scene.GetLandHeight() with a straight query to Scene.Heightmap (which is used in other contexts)

0.6.4-rc1
Justin Clarke Casey 2009-03-05 21:10:39 +00:00
parent 3d70dbd01d
commit 11e1948b57
5 changed files with 13 additions and 20 deletions

View File

@ -88,7 +88,8 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
} }
// TODO: Get proper AVG Height // TODO: Get proper AVG Height
float localAVHeight = 1.56f; float localAVHeight = 1.56f;
float posZLimit = (float)avatar.Scene.GetLandHeight((int)position.X, (int)position.Y);
float posZLimit = (float)avatar.Scene.Heightmap[(int)position.X, (int)position.Y];
float newPosZ = posZLimit + localAVHeight; float newPosZ = posZLimit + localAVHeight;
if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
{ {

View File

@ -3019,11 +3019,6 @@ namespace OpenSim.Region.Framework.Scenes
m_eventManager.TriggerOnPluginConsole(args); m_eventManager.TriggerOnPluginConsole(args);
} }
public double GetLandHeight(int x, int y)
{
return Heightmap[x, y];
}
public UUID GetLandOwner(float x, float y) public UUID GetLandOwner(float x, float y)
{ {
ILandObject land = LandChannel.GetLandObject(x, y); ILandObject land = LandChannel.GetLandObject(x, y);

View File

@ -710,7 +710,7 @@ namespace OpenSim.Region.Framework.Scenes
// TODO: Get proper AVG Height // TODO: Get proper AVG Height
float localAVHeight = 1.56f; float localAVHeight = 1.56f;
float posZLimit = (float)avatar.Scene.GetLandHeight((int)position.X, (int)position.Y); float posZLimit = (float)avatar.Scene.Heightmap[(int)position.X, (int)position.Y];
float newPosZ = posZLimit + localAVHeight; float newPosZ = posZLimit + localAVHeight;
if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
{ {

View File

@ -848,7 +848,7 @@ namespace OpenSim.Region.Framework.Scenes
localAVHeight = m_avHeight; localAVHeight = m_avHeight;
} }
float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y); float posZLimit = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y];
float newPosZ = posZLimit + localAVHeight / 2; float newPosZ = posZLimit + localAVHeight / 2;
if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
{ {

View File

@ -1007,17 +1007,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
int y = (int)(pos.Y + offset.y); int y = (int)(pos.Y + offset.y);
// Clamp to valid position // Clamp to valid position
if (x<0) if (x < 0)
x = 0; x = 0;
else if (x>=World.Heightmap.Width) else if (x >= World.Heightmap.Width)
x = World.Heightmap.Width-1; x = World.Heightmap.Width - 1;
if (y<0) if (y < 0)
y = 0; y = 0;
else if (y>=World.Heightmap.Height) else if (y >= World.Heightmap.Height)
y = World.Heightmap.Height-1; y = World.Heightmap.Height - 1;
return World.Heightmap[x, y];
return World.GetLandHeight(x, y);
} }
public LSL_Float llCloud(LSL_Vector offset) public LSL_Float llCloud(LSL_Vector offset)
@ -2794,15 +2793,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
public void llSetHoverHeight(double height, int water, double tau) public void llSetHoverHeight(double height, int water, double tau)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
Vector3 pos = m_host.GetWorldPosition(); Vector3 pos = m_host.GetWorldPosition();
int x = (int)(pos.X); int x = (int)(pos.X);
int y = (int)(pos.Y); int y = (int)(pos.Y);
float landHeight = (float)World.GetLandHeight(x, y); float landHeight = (float)World.Heightmap[x, y];
float targetHeight = landHeight + (float)height; float targetHeight = landHeight + (float)height;
if (water == 1) if (water == 1)
{ {