* Fixed a few things and enabling Physical Prim border crossings again.

* Everyone try to push a physical prim across a region border now.
0.6.0-stable
Teravus Ovares 2008-03-09 20:29:59 +00:00
parent f89e7107bb
commit 8bba8e232c
2 changed files with 75 additions and 66 deletions

View File

@ -1721,16 +1721,20 @@ namespace OpenSim.Region.Physics.OdePlugin
if (l_position.X > 255.95f || l_position.X < 0f || l_position.Y > 255.95f || l_position.Y < 0f)
{
base.RaiseOutOfBounds(_position);
//base.RaiseOutOfBounds(l_position);
//if (m_crossingfailures < 5)
//{
//base.RequestPhysicsterseUpdate();
//}
//else
//{
//base.RaiseOutOfBounds(_position);
//}
if (m_crossingfailures < 5)
{
_position = l_position;
//_parent_scene.remActivePrim(this);
base.RequestPhysicsterseUpdate();
return;
}
else
{
base.RaiseOutOfBounds(l_position);
return;
}
}
if (l_position.Z < 0)

View File

@ -694,8 +694,8 @@ namespace OpenSim.Region.Physics.OdePlugin
// If the sim is running slow this frame,
// don't process collision for prim!
if (timeStep < (m_SkipFramesAtms/3))
{
//if (timeStep < (m_SkipFramesAtms/3))
//{
lock (_activeprims)
{
@ -708,7 +708,7 @@ namespace OpenSim.Region.Physics.OdePlugin
{
lock (chr)
{
if (space != (IntPtr)0 && chr.prim_geom != (IntPtr)0)
if (space != (IntPtr)0 && chr.prim_geom != (IntPtr)0 && chr.m_taintremove == false)
d.SpaceCollide2(space, chr.prim_geom, IntPtr.Zero, nearCallback);
}
@ -733,39 +733,41 @@ namespace OpenSim.Region.Physics.OdePlugin
//}
//}
}
try
{
lock (chr)
{
if (LandGeom != (IntPtr)0 && chr.prim_geom != (IntPtr)0)
d.SpaceCollide2(LandGeom, chr.prim_geom, IntPtr.Zero, nearCallback);
//try
//{
//lock (chr)
//{
//if (LandGeom != (IntPtr)0 && chr.prim_geom != (IntPtr)0)
//d.SpaceCollide2(LandGeom, chr.prim_geom, IntPtr.Zero, nearCallback);
//}
//}
//catch (AccessViolationException)
// {
//m_log.Warn("[PHYSICS]: Unable to space collide");
//}
}
}
catch (AccessViolationException)
{
m_log.Warn("[PHYSICS]: Unable to space collide");
}
}
}
}
else
{
#region disabled code
//}
//else
//{
// Everything is going slow, so we're skipping object to object collisions
// At least collide test against the ground.
foreach (OdePrim chr in _activeprims)
{
//foreach (OdePrim chr in _activeprims)
//{
// This if may not need to be there.. it might be skipped anyway.
if (d.BodyIsEnabled(chr.Body))
{
//if (d.BodyIsEnabled(chr.Body))
//{
// Collide test the prims with the terrain.. since if you don't do this,
// next frame, all of the physical prim in the scene will awaken and explode upwards
tmpSpace = calculateSpaceForGeom(chr.Position);
if (tmpSpace != (IntPtr) 0 && d.GeomIsSpace(tmpSpace))
d.SpaceCollide2(calculateSpaceForGeom(chr.Position), chr.prim_geom, IntPtr.Zero, nearCallback);
d.SpaceCollide2(LandGeom, chr.prim_geom, IntPtr.Zero, nearCallback);
}
}
}
//tmpSpace = calculateSpaceForGeom(chr.Position);
//if (tmpSpace != (IntPtr) 0 && d.GeomIsSpace(tmpSpace))
//d.SpaceCollide2(calculateSpaceForGeom(chr.Position), chr.prim_geom, IntPtr.Zero, nearCallback);
//d.SpaceCollide2(LandGeom, chr.prim_geom, IntPtr.Zero, nearCallback);
//}
//}
//}
#endregion
}
#endregion
@ -869,9 +871,12 @@ namespace OpenSim.Region.Physics.OdePlugin
public void remActivePrim(OdePrim deactivatePrim)
{
lock (_activeprims)
{
_activeprims.Remove(deactivatePrim);
}
}
public override void RemovePrim(PhysicsActor prim)
{