diff options
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs | 24 | ||||
-rwxr-xr-x | bin/lib32/BulletSim.dll | bin | 1338880 -> 1483776 bytes | |||
-rwxr-xr-x | bin/lib32/libBulletSim.so | bin | 2312132 -> 2368603 bytes | |||
-rwxr-xr-x | bin/lib64/BulletSim.dll | bin | 1547264 -> 1651712 bytes | |||
-rwxr-xr-x | bin/lib64/libBulletSim.so | bin | 2475617 -> 2536668 bytes |
5 files changed, 20 insertions, 4 deletions
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs index 42fc11b..f72ad28 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs | |||
@@ -141,14 +141,30 @@ public sealed class BSTerrainHeightmap : BSTerrainPhys | |||
141 | } | 141 | } |
142 | 142 | ||
143 | // The passed position is relative to the base of the region. | 143 | // The passed position is relative to the base of the region. |
144 | // There are many assumptions herein that the heightmap increment is 1. | ||
144 | public override float GetTerrainHeightAtXYZ(Vector3 pos) | 145 | public override float GetTerrainHeightAtXYZ(Vector3 pos) |
145 | { | 146 | { |
146 | float ret = BSTerrainManager.HEIGHT_GETHEIGHT_RET; | 147 | float ret = BSTerrainManager.HEIGHT_GETHEIGHT_RET; |
147 | 148 | ||
148 | int mapIndex = (int)pos.Y * (int)m_mapInfo.sizeY + (int)pos.X; | 149 | try { |
149 | try | 150 | int baseX = (int)pos.X; |
150 | { | 151 | int baseY = (int)pos.Y; |
151 | ret = m_mapInfo.heightMap[mapIndex]; | 152 | int maxX = (int)m_mapInfo.sizeX; |
153 | int maxY = (int)m_mapInfo.sizeY; | ||
154 | float diffX = pos.X - (float)baseX; | ||
155 | float diffY = pos.Y - (float)baseY; | ||
156 | |||
157 | float mapHeight1 = m_mapInfo.heightMap[baseY * maxY + baseX]; | ||
158 | float mapHeight2 = m_mapInfo.heightMap[Math.Min(baseY + 1, maxY - 1) * maxY + baseX]; | ||
159 | float mapHeight3 = m_mapInfo.heightMap[baseY * maxY + Math.Min(baseX + 1, maxX - 1)]; | ||
160 | float mapHeight4 = m_mapInfo.heightMap[Math.Min(baseY + 1, maxY - 1) * maxY + Math.Min(baseX + 1, maxX - 1)]; | ||
161 | |||
162 | float Xrise = (mapHeight4 - mapHeight3) * diffX; | ||
163 | float Yrise = (mapHeight2 - mapHeight1) * diffY; | ||
164 | |||
165 | ret = mapHeight1 + ((Xrise + Yrise) / 2f); | ||
166 | // m_physicsScene.DetailLog("{0},BSTerrainHeightMap,GetTerrainHeightAtXYZ,pos={1},{2}/{3}/{4}/{5},ret={6}", | ||
167 | // BSScene.DetailLogZero, pos, mapHeight1, mapHeight2, mapHeight3, mapHeight4, ret); | ||
152 | } | 168 | } |
153 | catch | 169 | catch |
154 | { | 170 | { |
diff --git a/bin/lib32/BulletSim.dll b/bin/lib32/BulletSim.dll index 6d006bf..5c3ccd0 100755 --- a/bin/lib32/BulletSim.dll +++ b/bin/lib32/BulletSim.dll | |||
Binary files differ | |||
diff --git a/bin/lib32/libBulletSim.so b/bin/lib32/libBulletSim.so index ec29f58..97dd73c 100755 --- a/bin/lib32/libBulletSim.so +++ b/bin/lib32/libBulletSim.so | |||
Binary files differ | |||
diff --git a/bin/lib64/BulletSim.dll b/bin/lib64/BulletSim.dll index 82774a2..eea1020 100755 --- a/bin/lib64/BulletSim.dll +++ b/bin/lib64/BulletSim.dll | |||
Binary files differ | |||
diff --git a/bin/lib64/libBulletSim.so b/bin/lib64/libBulletSim.so index 8b09275..3987835 100755 --- a/bin/lib64/libBulletSim.so +++ b/bin/lib64/libBulletSim.so | |||
Binary files differ | |||