OpenSim/Region/PhysicsModules/Ode/OdeScene.cs
/// <summary>
/// This is called from within simulate but outside the locked portion
/// We need to do our own locking here
/// (Note: As of 20110801 this no longer appears to be true - this is being called within lock (odeLock) in
/// Simulate() -- justincc).
///
/// Essentially, we need to remove the prim from our space segment, whatever segment it's in.
///
/// If there are no more prim in the segment, we need to empty (spacedestroy)the segment and reclaim memory
/// that the space was using.
/// </summary>
/// <param name="prim"></param>
This is called from within simulate but outside the locked portion
We need to do our own locking here
(Note: As of 20110801 this no longer appears to be true - this is being called within lock (odeLock) in
Simulate() -- justincc).

Essentially, we need to remove the prim from our space segment, whatever segment it's in.

If there are no more prim in the segment, we need to empty (spacedestroy)the segment and reclaim memory
that the space was using.
This is called from within simulate but outside the locked portion We need to do our own locking here ( Note : As of 20110801 this no longer appears to be true - this is being called within lock ( odeLock ) in Simulate () -- justincc ) . Essentially we need to remove the prim from our space segment whatever segment it ' s in . If there are no more prim in the segment we need to empty ( spacedestroy ) the segment and reclaim memory that the space was using .
internal void RemovePrimThreadLocked(OdePrim prim)
        {
            lock (prim)
            {
                RemoveCollisionEventReporting(prim);
                if (prim.prim_geom != IntPtr.Zero)
                {
                    prim.ResetTaints();
                    if (prim.IsPhysical)
                    {
                        prim.disableBody();
                        if (prim.childPrim)
                        {
                            prim.childPrim = false;
                            prim.Body = IntPtr.Zero;
                            prim.m_disabled = true;
                            prim.IsPhysical = false;
                        }
                    }
                    prim.m_targetSpace = IntPtr.Zero;
                    if (!prim.RemoveGeom())
                        m_log.Warn("[ODE SCENE]: Unable to remove prim from physics scene");
                    lock (_prims)
                        _prims.Remove(prim);
                    if (SupportsNINJAJoints)
                        RemoveAllJointsConnectedToActorThreadLocked(prim);
                }
            }
        }
internal void RemovePrimThreadLocked ( OdePrim prim ) { lock ( prim ) { RemoveCollisionEventReporting ( prim ) ; if ( prim . prim_geom != IntPtr . Zero ) { prim . ResetTaints ( ) ; if ( prim . IsPhysical ) { prim . disableBody ( ) ; if ( prim . childPrim ) { prim . childPrim = false ; prim . Body = IntPtr . Zero ; prim . m_disabled = true ; prim . IsPhysical = false ; } } prim . m_targetSpace = IntPtr . Zero ; if ( ! prim . RemoveGeom ( ) ) m_log . Warn ( " " ) ; lock ( _prims ) _prims . Remove ( prim ) ; if ( SupportsNINJAJoints ) RemoveAllJointsConnectedToActorThreadLocked ( prim ) ; } } }
This is called from within simulate but outside the locked portion
We need to do our own locking here
(Note: As of 20110801 this no longer appears to be true - this is being called within lock (odeLock) in
Simulate() -- justincc).
This is called from within simulate but outside the locked portion We need to do our own locking here ( Note : As of 20110801 this no longer appears to be true - this is being called within lock ( odeLock ) in Simulate () -- justincc ) .
//            m_log.DebugFormat("[ODE SCENE]: Removing physical prim {0} {1}", prim.Name, prim.LocalID);
prim
OdePrim
None