aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/OpenSim.Physics/OdePlugin/OdePlugin.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/OpenSim/OpenSim.Physics/OdePlugin/OdePlugin.cs b/OpenSim/OpenSim.Physics/OdePlugin/OdePlugin.cs
index 7debdaa..5233042 100644
--- a/OpenSim/OpenSim.Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/OpenSim.Physics/OdePlugin/OdePlugin.cs
@@ -182,7 +182,11 @@ namespace OpenSim.Physics.OdePlugin
182 { 182 {
183 for (int i = 0; i < 65536; i++) 183 for (int i = 0; i < 65536; i++)
184 { 184 {
185 this._heightmap[i] = (double)heightMap[i]; 185 // this._heightmap[i] = (double)heightMap[i];
186 // dbm (danx0r) -- heightmap x,y must be swapped for Ode (should fix ODE, but for now...)
187 int x = i & 0xff;
188 int y = i >> 8;
189 this._heightmap[i] = (double)heightMap[x * 256 + y];
186 } 190 }
187 IntPtr HeightmapData = d.GeomHeightfieldDataCreate(); 191 IntPtr HeightmapData = d.GeomHeightfieldDataCreate();
188 d.GeomHeightfieldDataBuildDouble(HeightmapData, _heightmap, 0, 256, 256, 256, 256, 1.0f, 0.0f, 2.0f, 0); 192 d.GeomHeightfieldDataBuildDouble(HeightmapData, _heightmap, 0, 256, 256, 256, 256, 1.0f, 0.0f, 2.0f, 0);
@@ -335,7 +339,7 @@ namespace OpenSim.Physics.OdePlugin
335 d.Vector3 vec = d.BodyGetPosition(BoundingCapsule); 339 d.Vector3 vec = d.BodyGetPosition(BoundingCapsule);
336 this._position.X = vec.X; 340 this._position.X = vec.X;
337 this._position.Y = vec.Y; 341 this._position.Y = vec.Y;
338 this._position.Z = vec.Z; 342 this._position.Z = vec.Z+1.0f;
339 } 343 }
340 } 344 }
341 345