mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
terraforming changes: make sliders work, remove some brushs, etc. Feedback needed (run prebuild)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user