Thanks Michelle Argus for Mantis #0003742: Terrain editor - Flatten tool lowers Land
parent
2755f6b891
commit
00d042f3d1
|
@ -90,6 +90,7 @@ what it is today.
|
||||||
* M.Igarashi
|
* M.Igarashi
|
||||||
* maimedleech
|
* maimedleech
|
||||||
* Mic Bowman
|
* Mic Bowman
|
||||||
|
* Michelle Argus
|
||||||
* Mike Pitman (IBM)
|
* Mike Pitman (IBM)
|
||||||
* mikkopa/_someone - RealXtend
|
* mikkopa/_someone - RealXtend
|
||||||
* Mircea Kitsune
|
* Mircea Kitsune
|
||||||
|
|
|
@ -5028,7 +5028,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
handlerModifyTerrain = OnModifyTerrain;
|
handlerModifyTerrain = OnModifyTerrain;
|
||||||
if (handlerModifyTerrain != null)
|
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,
|
handlerModifyTerrain(AgentId, modify.ModifyBlock.Height, modify.ModifyBlock.Seconds,
|
||||||
modify.ModifyBlock.BrushSize,
|
modify.ModifyBlock.BrushSize,
|
||||||
modify.ModifyBlock.Action, modify.ParcelData[i].North,
|
modify.ModifyBlock.Action, modify.ParcelData[i].North,
|
||||||
|
|
|
@ -41,34 +41,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes
|
||||||
|
|
||||||
int x, y;
|
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
|
// blend in map
|
||||||
for (x = 0; x < map.Width; x++)
|
for (x = 0; x < map.Width; x++)
|
||||||
{
|
{
|
||||||
|
@ -77,19 +49,28 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes
|
||||||
if (!mask[x,y])
|
if (!mask[x,y])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength) * duration;
|
double z;
|
||||||
|
if (duration < 4.0)
|
||||||
if (z > 0) // add in non-zero amount
|
|
||||||
{
|
{
|
||||||
if (z > 1.0)
|
z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength) * duration * 0.25;
|
||||||
|
}
|
||||||
|
else {
|
||||||
z = 1.0;
|
z = 1.0;
|
||||||
|
|
||||||
map[x, y] = (map[x, y] * (1.0 - z)) + (rz * z);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double delta = rz - map[x, y];
|
double delta = rz - map[x, y];
|
||||||
if (Math.Abs(delta) > 0.1)
|
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
|
if (delta != 0) // add in non-zero amount
|
||||||
{
|
{
|
||||||
|
|
|
@ -299,7 +299,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||||
/// <param name="agentId">UUID of script-owner</param>
|
/// <param name="agentId">UUID of script-owner</param>
|
||||||
public void ModifyTerrain(UUID user, Vector3 pos, byte size, byte action, UUID agentId)
|
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>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue