Merged the new ODE stuff

zircon^2
gareth 2007-05-21 19:05:09 +00:00
parent fe46b045f7
commit b253f3db48
1 changed files with 456 additions and 452 deletions

View File

@ -182,7 +182,11 @@ namespace OpenSim.Physics.OdePlugin
{ {
for (int i = 0; i < 65536; i++) 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(); IntPtr HeightmapData = d.GeomHeightfieldDataCreate();
d.GeomHeightfieldDataBuildDouble(HeightmapData, _heightmap, 0, 256, 256, 256, 256, 1.0f, 0.0f, 2.0f, 0); 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); d.Vector3 vec = d.BodyGetPosition(BoundingCapsule);
this._position.X = vec.X; this._position.X = vec.X;
this._position.Y = vec.Y; this._position.Y = vec.Y;
this._position.Z = vec.Z; this._position.Z = vec.Z+1.0f;
} }
} }