terraforming changes: make sliders work, remove some brushs, etc. Feedback needed (run prebuild)

This commit is contained in:
UbitUmarov
2019-11-09 23:59:19 +00:00
parent 4b5a3308ad
commit 53339d2970
30 changed files with 160 additions and 1184 deletions

View File

@@ -53,7 +53,8 @@ namespace OpenSim.Region.Framework.Interfaces
/// All add and remove attachment operations must synchronize on this for the lifetime of their operations.
/// </remarks>
Object AttachmentsSyncLock { get; }
int MaxNumberAttachments { get; }
int GetAttachmentsCount();
/// <summary>
/// The scene objects attached to this avatar.
/// </summary>

View File

@@ -35,7 +35,7 @@ namespace OpenSim.Region.Framework.Interfaces
{
void LoadFromFile(string filename);
void SaveToFile(string filename);
void ModifyTerrain(UUID user, Vector3 pos, byte size, byte action, UUID agentId);
void ModifyTerrain(UUID user, Vector3 pos, byte size, byte action);
/// <summary>
/// Taint the terrain. This will lead to sending the terrain data to the clients again.

View File

@@ -2963,7 +2963,6 @@ namespace OpenSim.Region.Framework.Scenes
if (sceneObject.IsAttachmentCheckFull()) // Attachment
{
sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez);
// sceneObject.RootPart.AddFlag(PrimFlags.Phantom);
// Don't sent a full update here because this will cause full updates to be sent twice for
// attachments on region crossings, resulting in viewer glitches.
@@ -2984,13 +2983,17 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat(
// "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition);
RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
// We must currently not resume scripts at this stage since AttachmentsModule does not have the
// information that this is due to a teleport/border cross rather than an ordinary attachment.
// We currently do this in Scene.MakeRootAgent() instead.
bool attached = false;
if (AttachmentsModule != null)
AttachmentsModule.AttachObject(sp, grp, 0, false, false, true);
attached = AttachmentsModule.AttachObject(sp, grp, 0, false, false, true);
if (attached)
RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
else
m_log.DebugFormat("[SCENE]: Attachment {0} arrived but failed to attach, setting to temp", sceneObject.UUID);
}
else
{

View File

@@ -538,19 +538,15 @@ namespace OpenSim.Region.Framework.Scenes
{
float cx = m_terrainData.SizeX * 0.5f;
float cy = m_terrainData.SizeY * 0.5f;
float h;
float h, b;
for (int x = 0; x < Width; x++)
{
for (int y = 0; y < Height; y++)
{
// h = (float)TerrainUtil.PerlinNoise2D(x, y, 2, 0.125) * 10;
h = 1.0f;
float spherFacA = (float)(TerrainUtil.SphericalFactor(x, y, cx, cy, 50) * 0.01d);
float spherFacB = (float)(TerrainUtil.SphericalFactor(x, y, cx, cy, 100) * 0.001d);
if (h < spherFacA)
h = spherFacA;
if (h < spherFacB)
h = spherFacB;
h = 25 * TerrainUtil.SphericalFactor(x - cx, y - cy, 50);
b = 10 * TerrainUtil.SphericalFactor(x - cx, y - cy, 100);
if (h < b)
h = b;
m_terrainData[x, y] = h;
}
}

View File

@@ -32,15 +32,12 @@ namespace OpenSim.Region.Framework.Scenes
{
public static class TerrainUtil
{
public static double MetersToSphericalStrength(double size)
public static float SphericalFactor(float dx, float dy, float size)
{
//return Math.Pow(2, size);
return (size + 1) * 1.35; // MCP: a more useful brush size range
}
public static double SphericalFactor(double x, double y, double rx, double ry, double size)
{
return size * size - ((x - rx) * (x - rx) + (y - ry) * (y - ry));
float a = ((dx * dx) + (dy * dy))/ (size * size);
if( a >= 1.0f)
return 0;
return 1.0f - a;
}
public static double GetBilinearInterpolate(double x, double y, ITerrainChannel map)