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.
0.8.0.3
Robert Adams 2014-04-12 17:37:57 -07:00
parent 574a11558d
commit c8914d22eb
3 changed files with 11 additions and 4 deletions

View File

@ -1251,6 +1251,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
try 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); 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. // 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) if (m_scene.RegionInfo.RegionSizeX > Constants.RegionSize || m_scene.RegionInfo.RegionSizeY > Constants.RegionSize)
layerType = (byte)TerrainPatch.LayerType.WindExtended; layerType = (byte)TerrainPatch.LayerType.WindExtended;
// LayerDataPacket layerpack = TerrainCompressor.CreateLayerDataPacket(patches, (TerrainPatch.LayerType)layerType);
LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLayerDataPacket(patches, layerType, LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLayerDataPacket(patches, layerType,
(int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY); (int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY);
layerpack.Header.Zerocoded = true; 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) if (m_scene.RegionInfo.RegionSizeX > Constants.RegionSize || m_scene.RegionInfo.RegionSizeY > Constants.RegionSize)
layerType = (byte)TerrainPatch.LayerType.CloudExtended; layerType = (byte)TerrainPatch.LayerType.CloudExtended;
// LayerDataPacket layerpack = TerrainCompressor.CreateLayerDataPacket(patches, (TerrainPatch.LayerType)layerType);
LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLayerDataPacket(patches, layerType, LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLayerDataPacket(patches, layerType,
(int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY); (int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY);
layerpack.Header.Zerocoded = true; layerpack.Header.Zerocoded = true;

View File

@ -81,7 +81,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
BuildQuantizeTable16(); BuildQuantizeTable16();
} }
// Unused: left for historical reference. // Used to send cloud and wind patches
public static LayerDataPacket CreateLayerDataPacket(TerrainPatch[] patches, byte type, int pRegionSizeX, public static LayerDataPacket CreateLayerDataPacket(TerrainPatch[] patches, byte type, int pRegionSizeX,
int pRegionSizeY) int pRegionSizeY)
{ {
@ -275,7 +275,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
header.DCOffset = zmin; header.DCOffset = zmin;
header.Range = (int)(zmax - zmin + 1.0f); header.Range = (int)((zmax - zmin) + 1.0f);
return header; return header;
} }
@ -491,7 +491,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
lineout[CopyMatrix16[uptr + column]] = (int)(total * QuantizeTable16[uptr + column]); lineout[CopyMatrix16[uptr + column]] = (int)(total * QuantizeTable16[uptr + column]);
} }
} }
*/
private static void DCTColumn16(float[] linein, int[] lineout, int 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]); lineout[CopyMatrix16[uptr + column]] = (int) (total*QuantizeTable16[uptr + column]);
} }
} }
*/
private static int DCTColumn16Wbits(float[] linein, int[] lineout, int column, int wbits, int maxwbits) private static int DCTColumn16Wbits(float[] linein, int[] lineout, int column, int wbits, int maxwbits)
{ {

View File

@ -553,7 +553,7 @@ public static class BSParam
new ParameterDefn<float>("TerrainContactProcessingThreshold", "Distance from terrain to stop processing collisions" , new ParameterDefn<float>("TerrainContactProcessingThreshold", "Distance from terrain to stop processing collisions" ,
0.0f ), 0.0f ),
new ParameterDefn<float>("TerrainCollisionMargin", "Margin where collision checking starts" , new ParameterDefn<float>("TerrainCollisionMargin", "Margin where collision checking starts" ,
0.08f ), 0.04f ),
new ParameterDefn<float>("AvatarFriction", "Factor to reduce movement against an avatar. Changed on avatar recreation.", new ParameterDefn<float>("AvatarFriction", "Factor to reduce movement against an avatar. Changed on avatar recreation.",
0.2f ), 0.2f ),