Thanks Michelle Argus for Mantis #0003742: Terrain editor - Flatten tool lowers Land

0.6.6-post-fixes
Dahlia Trimble 2009-06-18 23:02:12 +00:00
parent 2755f6b891
commit 00d042f3d1
4 changed files with 22 additions and 38 deletions

View File

@ -90,6 +90,7 @@ what it is today.
* M.Igarashi
* maimedleech
* Mic Bowman
* Michelle Argus
* Mike Pitman (IBM)
* mikkopa/_someone - RealXtend
* Mircea Kitsune

View File

@ -5028,7 +5028,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
handlerModifyTerrain = OnModifyTerrain;
if (handlerModifyTerrain != null)
{
modify.ModifyBlock.Height = -1; // Hack, i don't know why the value is wrong
handlerModifyTerrain(AgentId, modify.ModifyBlock.Height, modify.ModifyBlock.Seconds,
modify.ModifyBlock.BrushSize,
modify.ModifyBlock.Action, modify.ParcelData[i].North,

View File

@ -41,34 +41,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes
int x, y;
duration = 0.009; //MCP Should be read from ini file
// Disabled - just use the client value.
/*
if (rz < 0) {
double sum = 0.0;
double step2 = 0.0;
// compute delta map
for (x = 0; x < map.Width; x++)
{
for (y = 0; y < map.Height; y++)
{
double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
if (z > 0) // add in non-zero amount
{
sum += map[x, y] * z;
step2 += z;
}
}
}
rz = sum / step2;
}
*/
// blend in map
for (x = 0; x < map.Width; x++)
{
@ -77,19 +49,28 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes
if (!mask[x,y])
continue;
double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength) * duration;
if (z > 0) // add in non-zero amount
double z;
if (duration < 4.0)
{
if (z > 1.0)
z = 1.0;
map[x, y] = (map[x, y] * (1.0 - z)) + (rz * z);
z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength) * duration * 0.25;
}
else {
z = 1.0;
}
double delta = rz - map[x, y];
if (Math.Abs(delta) > 0.1)
delta *= 0.25;
{
if (z > 1.0)
{
z = 1.0;
}
else if (z < 0.0)
{
z = 0.0;
}
delta *= z;
}
if (delta != 0) // add in non-zero amount
{

View File

@ -299,7 +299,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain
/// <param name="agentId">UUID of script-owner</param>
public void ModifyTerrain(UUID user, Vector3 pos, byte size, byte action, UUID agentId)
{
client_OnModifyTerrain(user, (float)pos.Z, (float)0.25, size, action, pos.Y, pos.X, pos.Y, pos.X, agentId);
float duration = 0.25f;
if (action == 0)
duration = 4.0f;
client_OnModifyTerrain(user, (float)pos.Z, duration, size, action, pos.Y, pos.X, pos.Y, pos.X, agentId);
}
/// <summary>