OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
/// <summary>
/// Stop a prim from being subject to physics.
/// </summary>
Stop a prim from being subject to physics.
Stop a prim from being subject to physics .
internal void disableBody()
        {
            lock (this)
            {
                if (!childPrim)
                {
                    if (Body != IntPtr.Zero)
                    {
                        _parent_scene.DeactivatePrim(this);
                        m_collisionCategories &= ~CollisionCategories.Body;
                        m_collisionFlags &= ~(CollisionCategories.Wind | CollisionCategories.Land);
                        if (m_assetFailed)
                        {
                            d.GeomSetCategoryBits(prim_geom, 0);
                            d.GeomSetCollideBits(prim_geom, 0);
                        }
                        else
                        {
                            d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
                            d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
                        }
                        d.BodyDestroy(Body);
                        lock (childrenPrim)
                        {
                            if (childrenPrim.Count > 0)
                            {
                                foreach (OdePrim prm in childrenPrim)
                                {
                                    _parent_scene.DeactivatePrim(prm);
                                    prm.Body = IntPtr.Zero;
                                }
                            }
                        }
                        Body = IntPtr.Zero;
                    }
                }
                else
                {
                    _parent_scene.DeactivatePrim(this);
                    m_collisionCategories &= ~CollisionCategories.Body;
                    m_collisionFlags &= ~(CollisionCategories.Wind | CollisionCategories.Land);
                    if (m_assetFailed)
                    {
                        d.GeomSetCategoryBits(prim_geom, 0);
                        d.GeomSetCollideBits(prim_geom, 0);
                    }
                    else
                    {
                        d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
                        d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
                    }
                    Body = IntPtr.Zero;
                }
            }
            m_disabled = true;
            m_collisionscore = 0;
        }
internal void disableBody ( ) { lock ( this ) { if ( ! childPrim ) { if ( Body != IntPtr . Zero ) { _parent_scene . DeactivatePrim ( this ) ; m_collisionCategories &= ~ CollisionCategories . Body ; m_collisionFlags &= ~ ( CollisionCategories . Wind | CollisionCategories . Land ) ; if ( m_assetFailed ) { d . GeomSetCategoryBits ( prim_geom , 0 ) ; d . GeomSetCollideBits ( prim_geom , 0 ) ; } else { d . GeomSetCategoryBits ( prim_geom , ( int ) m_collisionCategories ) ; d . GeomSetCollideBits ( prim_geom , ( int ) m_collisionFlags ) ; } d . BodyDestroy ( Body ) ; lock ( childrenPrim ) { if ( childrenPrim . Count > 0 ) { foreach ( OdePrim prm in childrenPrim ) { _parent_scene . DeactivatePrim ( prm ) ; prm . Body = IntPtr . Zero ; } } } Body = IntPtr . Zero ; } } else { _parent_scene . DeactivatePrim ( this ) ; m_collisionCategories &= ~ CollisionCategories . Body ; m_collisionFlags &= ~ ( CollisionCategories . Wind | CollisionCategories . Land ) ; if ( m_assetFailed ) { d . GeomSetCategoryBits ( prim_geom , 0 ) ; d . GeomSetCollideBits ( prim_geom , 0 ) ; } else { d . GeomSetCategoryBits ( prim_geom , ( int ) m_collisionCategories ) ; d . GeomSetCollideBits ( prim_geom , ( int ) m_collisionFlags ) ; } Body = IntPtr . Zero ; } } m_disabled = true ; m_collisionscore = 0 ; }
Stop a prim from being subject to physics.
Stop a prim from being subject to physics .
//this kills the body so things like 'mesh' can re-create it.