From ba966216254398700e613480ba0da8795a4c8d4e Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Wed, 13 Jun 2007 01:30:39 +0000 Subject: * Applying danx0r's ODE patch * ZOMG r1000! --- OpenSim/OpenSim.Physics/OdePlugin/OdePlugin.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim/OpenSim.Physics/OdePlugin/OdePlugin.cs') 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 { for (int i = 0; i < 65536; i++) { - this._heightmap[i] = (double)heightMap[i]; + // this._heightmap[i] = (double)heightMap[i]; + // dbm (danx0r) -- heightmap x,y must be swapped for Ode (should fix ODE, but for now...) + int x = i & 0xff; + int y = i >> 8; + this._heightmap[i] = (double)heightMap[x * 256 + y]; } IntPtr HeightmapData = d.GeomHeightfieldDataCreate(); d.GeomHeightfieldDataBuildDouble(HeightmapData, _heightmap, 0, 256, 256, 256, 256, 1.0f, 0.0f, 2.0f, 0); @@ -335,7 +339,7 @@ namespace OpenSim.Physics.OdePlugin d.Vector3 vec = d.BodyGetPosition(BoundingCapsule); this._position.X = vec.X; this._position.Y = vec.Y; - this._position.Z = vec.Z; + this._position.Z = vec.Z+1.0f; } } -- cgit v1.1