danx0r (first checkin!) fixes OdePlugin.cs RemovePrim() lock bug
parent
bad1df704a
commit
e158a45b09
|
@ -143,11 +143,14 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
public override void RemovePrim(PhysicsActor prim)
|
public override void RemovePrim(PhysicsActor prim)
|
||||||
{
|
{
|
||||||
if (prim is OdePrim)
|
if (prim is OdePrim)
|
||||||
|
{
|
||||||
|
lock (OdeLock)
|
||||||
{
|
{
|
||||||
d.GeomDestroy(((OdePrim)prim).prim_geom);
|
d.GeomDestroy(((OdePrim)prim).prim_geom);
|
||||||
this._prims.Remove((OdePrim)prim);
|
this._prims.Remove((OdePrim)prim);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, Quaternion rotation)
|
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, Quaternion rotation)
|
||||||
{
|
{
|
||||||
|
@ -221,10 +224,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
int y = i >> 8;
|
int y = i >> 8;
|
||||||
this._heightmap[i] = (double)heightMap[x * 256 + y];
|
this._heightmap[i] = (double)heightMap[x * 256 + y];
|
||||||
}
|
}
|
||||||
IntPtr HeightmapData = d.GeomHeightfieldDataCreate();
|
|
||||||
|
|
||||||
lock (OdeLock)
|
lock (OdeLock)
|
||||||
{
|
{
|
||||||
|
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);
|
||||||
d.GeomHeightfieldDataSetBounds(HeightmapData, 256, 256);
|
d.GeomHeightfieldDataSetBounds(HeightmapData, 256, 256);
|
||||||
LandGeom = d.CreateHeightfield(space, HeightmapData, 1);
|
LandGeom = d.CreateHeightfield(space, HeightmapData, 1);
|
||||||
|
@ -427,9 +430,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
_size = size;
|
_size = size;
|
||||||
_acceleration = new PhysicsVector();
|
_acceleration = new PhysicsVector();
|
||||||
_orientation = rotation;
|
_orientation = rotation;
|
||||||
prim_geom = d.CreateBox(OdeScene.space, _size.X, _size.Y, _size.Z);
|
|
||||||
lock (OdeScene.OdeLock)
|
lock (OdeScene.OdeLock)
|
||||||
{
|
{
|
||||||
|
prim_geom = d.CreateBox(OdeScene.space, _size.X, _size.Y, _size.Z);
|
||||||
d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
||||||
d.Quaternion myrot = new d.Quaternion();
|
d.Quaternion myrot = new d.Quaternion();
|
||||||
myrot.W = rotation.w;
|
myrot.W = rotation.w;
|
||||||
|
|
Loading…
Reference in New Issue