diff options
author | UbitUmarov | 2019-11-09 23:59:19 +0000 |
---|---|---|
committer | UbitUmarov | 2019-11-09 23:59:19 +0000 |
commit | 53339d29704d3a9fb2d436ee48fc3ca99ab33108 (patch) | |
tree | bced7330f7391458403d2eefb61b124bd51acc1a /OpenSim/Region/Framework | |
parent | cosmetics (diff) | |
download | opensim-SC-53339d29704d3a9fb2d436ee48fc3ca99ab33108.zip opensim-SC-53339d29704d3a9fb2d436ee48fc3ca99ab33108.tar.gz opensim-SC-53339d29704d3a9fb2d436ee48fc3ca99ab33108.tar.bz2 opensim-SC-53339d29704d3a9fb2d436ee48fc3ca99ab33108.tar.xz |
terraforming changes: make sliders work, remove some brushs, etc. Feedback needed (run prebuild)
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IScenePresence.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/ITerrainModule.cs | 2 | ||||
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/Scene.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/TerrainChannel.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/TerrainUtil.cs | 13 |
5 files changed, 20 insertions, 23 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs index 0fe681f..412c86e 100644 --- a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs +++ b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs | |||
@@ -53,7 +53,8 @@ namespace OpenSim.Region.Framework.Interfaces | |||
53 | /// All add and remove attachment operations must synchronize on this for the lifetime of their operations. | 53 | /// All add and remove attachment operations must synchronize on this for the lifetime of their operations. |
54 | /// </remarks> | 54 | /// </remarks> |
55 | Object AttachmentsSyncLock { get; } | 55 | Object AttachmentsSyncLock { get; } |
56 | 56 | int MaxNumberAttachments { get; } | |
57 | int GetAttachmentsCount(); | ||
57 | /// <summary> | 58 | /// <summary> |
58 | /// The scene objects attached to this avatar. | 59 | /// The scene objects attached to this avatar. |
59 | /// </summary> | 60 | /// </summary> |
diff --git a/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs b/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs index 3fc5ce7..6b1ef1b 100644 --- a/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ITerrainModule.cs | |||
@@ -35,7 +35,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
35 | { | 35 | { |
36 | void LoadFromFile(string filename); | 36 | void LoadFromFile(string filename); |
37 | void SaveToFile(string filename); | 37 | void SaveToFile(string filename); |
38 | void ModifyTerrain(UUID user, Vector3 pos, byte size, byte action, UUID agentId); | 38 | void ModifyTerrain(UUID user, Vector3 pos, byte size, byte action); |
39 | 39 | ||
40 | /// <summary> | 40 | /// <summary> |
41 | /// Taint the terrain. This will lead to sending the terrain data to the clients again. | 41 | /// Taint the terrain. This will lead to sending the terrain data to the clients again. |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 03f46bb..ff1e922 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2963,7 +2963,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2963 | if (sceneObject.IsAttachmentCheckFull()) // Attachment | 2963 | if (sceneObject.IsAttachmentCheckFull()) // Attachment |
2964 | { | 2964 | { |
2965 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); | 2965 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); |
2966 | // sceneObject.RootPart.AddFlag(PrimFlags.Phantom); | ||
2967 | 2966 | ||
2968 | // Don't sent a full update here because this will cause full updates to be sent twice for | 2967 | // Don't sent a full update here because this will cause full updates to be sent twice for |
2969 | // attachments on region crossings, resulting in viewer glitches. | 2968 | // attachments on region crossings, resulting in viewer glitches. |
@@ -2984,13 +2983,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
2984 | // m_log.DebugFormat( | 2983 | // m_log.DebugFormat( |
2985 | // "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); | 2984 | // "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); |
2986 | 2985 | ||
2987 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | ||
2988 | |||
2989 | // We must currently not resume scripts at this stage since AttachmentsModule does not have the | 2986 | // We must currently not resume scripts at this stage since AttachmentsModule does not have the |
2990 | // information that this is due to a teleport/border cross rather than an ordinary attachment. | 2987 | // information that this is due to a teleport/border cross rather than an ordinary attachment. |
2991 | // We currently do this in Scene.MakeRootAgent() instead. | 2988 | // We currently do this in Scene.MakeRootAgent() instead. |
2989 | bool attached = false; | ||
2992 | if (AttachmentsModule != null) | 2990 | if (AttachmentsModule != null) |
2993 | AttachmentsModule.AttachObject(sp, grp, 0, false, false, true); | 2991 | attached = AttachmentsModule.AttachObject(sp, grp, 0, false, false, true); |
2992 | |||
2993 | if (attached) | ||
2994 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | ||
2995 | else | ||
2996 | m_log.DebugFormat("[SCENE]: Attachment {0} arrived but failed to attach, setting to temp", sceneObject.UUID); | ||
2994 | } | 2997 | } |
2995 | else | 2998 | else |
2996 | { | 2999 | { |
diff --git a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs index 96d2dc4..28bbdda 100644 --- a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs +++ b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs | |||
@@ -538,19 +538,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
538 | { | 538 | { |
539 | float cx = m_terrainData.SizeX * 0.5f; | 539 | float cx = m_terrainData.SizeX * 0.5f; |
540 | float cy = m_terrainData.SizeY * 0.5f; | 540 | float cy = m_terrainData.SizeY * 0.5f; |
541 | float h; | 541 | float h, b; |
542 | for (int x = 0; x < Width; x++) | 542 | for (int x = 0; x < Width; x++) |
543 | { | 543 | { |
544 | for (int y = 0; y < Height; y++) | 544 | for (int y = 0; y < Height; y++) |
545 | { | 545 | { |
546 | // h = (float)TerrainUtil.PerlinNoise2D(x, y, 2, 0.125) * 10; | 546 | h = 25 * TerrainUtil.SphericalFactor(x - cx, y - cy, 50); |
547 | h = 1.0f; | 547 | b = 10 * TerrainUtil.SphericalFactor(x - cx, y - cy, 100); |
548 | float spherFacA = (float)(TerrainUtil.SphericalFactor(x, y, cx, cy, 50) * 0.01d); | 548 | if (h < b) |
549 | float spherFacB = (float)(TerrainUtil.SphericalFactor(x, y, cx, cy, 100) * 0.001d); | 549 | h = b; |
550 | if (h < spherFacA) | ||
551 | h = spherFacA; | ||
552 | if (h < spherFacB) | ||
553 | h = spherFacB; | ||
554 | m_terrainData[x, y] = h; | 550 | m_terrainData[x, y] = h; |
555 | } | 551 | } |
556 | } | 552 | } |
diff --git a/OpenSim/Region/Framework/Scenes/TerrainUtil.cs b/OpenSim/Region/Framework/Scenes/TerrainUtil.cs index 7f76e01..4569c9b 100644 --- a/OpenSim/Region/Framework/Scenes/TerrainUtil.cs +++ b/OpenSim/Region/Framework/Scenes/TerrainUtil.cs | |||
@@ -32,15 +32,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
32 | { | 32 | { |
33 | public static class TerrainUtil | 33 | public static class TerrainUtil |
34 | { | 34 | { |
35 | public static double MetersToSphericalStrength(double size) | 35 | public static float SphericalFactor(float dx, float dy, float size) |
36 | { | 36 | { |
37 | //return Math.Pow(2, size); | 37 | float a = ((dx * dx) + (dy * dy))/ (size * size); |
38 | return (size + 1) * 1.35; // MCP: a more useful brush size range | 38 | if( a >= 1.0f) |
39 | } | 39 | return 0; |
40 | 40 | return 1.0f - a; | |
41 | public static double SphericalFactor(double x, double y, double rx, double ry, double size) | ||
42 | { | ||
43 | return size * size - ((x - rx) * (x - rx) + (y - ry) * (y - ry)); | ||
44 | } | 41 | } |
45 | 42 | ||
46 | public static double GetBilinearInterpolate(double x, double y, ITerrainChannel map) | 43 | public static double GetBilinearInterpolate(double x, double y, ITerrainChannel map) |