From c8914d22ebb66fd9601161c9826d8b29ff6cb561 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sat, 12 Apr 2014 17:37:57 -0700 Subject: BulletSim: reduce the terrain collison margin to be the same as other objects in the world. This was originally changed in an attempt to make vehicles work better but the effect was not that large and it causes avatars to float above the terrain. --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 7 +++++++ OpenSim/Region/Framework/Scenes/TerrainCompressor.cs | 6 +++--- OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index d9fe4e2..f80f5a0 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -1251,6 +1251,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP { try { + /* test code using the terrain compressor in libOpenMetaverse + int[] patchInd = new int[1]; + patchInd[0] = px + (py * Constants.TerrainPatchSize); + LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(terrData.GetFloatsSerialized(), patchInd); + */ LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLandPacket(terrData, px, py); // When a user edits the terrain, so much data is sent, the data queues up fast and presents a sub optimal editing experience. @@ -1322,6 +1327,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (m_scene.RegionInfo.RegionSizeX > Constants.RegionSize || m_scene.RegionInfo.RegionSizeY > Constants.RegionSize) layerType = (byte)TerrainPatch.LayerType.WindExtended; + // LayerDataPacket layerpack = TerrainCompressor.CreateLayerDataPacket(patches, (TerrainPatch.LayerType)layerType); LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLayerDataPacket(patches, layerType, (int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY); layerpack.Header.Zerocoded = true; @@ -1351,6 +1357,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (m_scene.RegionInfo.RegionSizeX > Constants.RegionSize || m_scene.RegionInfo.RegionSizeY > Constants.RegionSize) layerType = (byte)TerrainPatch.LayerType.CloudExtended; + // LayerDataPacket layerpack = TerrainCompressor.CreateLayerDataPacket(patches, (TerrainPatch.LayerType)layerType); LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLayerDataPacket(patches, layerType, (int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY); layerpack.Header.Zerocoded = true; diff --git a/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs b/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs index b41691f..1107a2a 100644 --- a/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs +++ b/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs @@ -81,7 +81,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP BuildQuantizeTable16(); } - // Unused: left for historical reference. + // Used to send cloud and wind patches public static LayerDataPacket CreateLayerDataPacket(TerrainPatch[] patches, byte type, int pRegionSizeX, int pRegionSizeY) { @@ -275,7 +275,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } header.DCOffset = zmin; - header.Range = (int)(zmax - zmin + 1.0f); + header.Range = (int)((zmax - zmin) + 1.0f); return header; } @@ -491,7 +491,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP lineout[CopyMatrix16[uptr + column]] = (int)(total * QuantizeTable16[uptr + column]); } } - */ private static void DCTColumn16(float[] linein, int[] lineout, int column) { @@ -524,6 +523,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP lineout[CopyMatrix16[uptr + column]] = (int) (total*QuantizeTable16[uptr + column]); } } + */ private static int DCTColumn16Wbits(float[] linein, int[] lineout, int column, int wbits, int maxwbits) { diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index c977a5d..f2ad528 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs @@ -553,7 +553,7 @@ public static class BSParam new ParameterDefn("TerrainContactProcessingThreshold", "Distance from terrain to stop processing collisions" , 0.0f ), new ParameterDefn("TerrainCollisionMargin", "Margin where collision checking starts" , - 0.08f ), + 0.04f ), new ParameterDefn("AvatarFriction", "Factor to reduce movement against an avatar. Changed on avatar recreation.", 0.2f ), -- cgit v1.1