OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
/// <summary>
/// Change prim in response to a shape taint.
/// </summary>
Change prim in response to a shape taint.
Change prim in response to a shape taint .
private void changeshape()
        {
            m_taintshape = false;
            if (IsPhysical && Body != IntPtr.Zero)
            {
                if (childPrim)
                {
                    if (_parent != null)
                    {
                        OdePrim parent = (OdePrim)_parent;
                        parent.ChildDelink(this);
                    }
                }
                else
                {
                    disableBody();
                }
            }
            RemoveGeom();
            if (_size.X <= 0) _size.X = 0.01f;
            if (_size.Y <= 0) _size.Y = 0.01f;
            if (_size.Z <= 0) _size.Z = 0.01f;
            IMesh mesh = null;
            if (_parent_scene.needsMeshing(_pbs))
            {
                float meshlod = _parent_scene.meshSculptLOD;
                if (IsPhysical)
                    meshlod = _parent_scene.MeshSculptphysicalLOD;
                mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical);
                if (mesh == null)
                    CheckMeshAsset();
                else
                    m_assetFailed = false;
            }
            CreateGeom(m_targetSpace, mesh);
            d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
            d.Quaternion myrot = new d.Quaternion();
            myrot.W = _orientation.W;
            myrot.X = _orientation.X;
            myrot.Y = _orientation.Y;
            myrot.Z = _orientation.Z;
            d.GeomSetQuaternion(prim_geom, ref myrot);
            if (IsPhysical && Body == IntPtr.Zero)
            {
                enableBody();
                if (Body != IntPtr.Zero)
                {
                    d.BodyEnable(Body);
                }
            }
            changeSelectedStatus();
            if (childPrim)
            {
                if (_parent is OdePrim)
                {
                    OdePrim parent = (OdePrim)_parent;
                    parent.ChildSetGeom(this);
                }
            }
            resetCollisionAccounting();
        }
private void changeshape ( ) { m_taintshape = false ; if ( IsPhysical && Body != IntPtr . Zero ) { if ( childPrim ) { if ( _parent != null ) { OdePrim parent = ( OdePrim ) _parent ; parent . ChildDelink ( this ) ; } } else { disableBody ( ) ; } } RemoveGeom ( ) ; if ( _size . X <= 0 ) _size . X = 0.01f ; if ( _size . Y <= 0 ) _size . Y = 0.01f ; if ( _size . Z <= 0 ) _size . Z = 0.01f ; IMesh mesh = null ; if ( _parent_scene . needsMeshing ( _pbs ) ) { float meshlod = _parent_scene . meshSculptLOD ; if ( IsPhysical ) meshlod = _parent_scene . MeshSculptphysicalLOD ; mesh = _parent_scene . mesher . CreateMesh ( Name , _pbs , _size , meshlod , IsPhysical ) ; if ( mesh == null ) CheckMeshAsset ( ) ; else m_assetFailed = false ; } CreateGeom ( m_targetSpace , mesh ) ; d . GeomSetPosition ( prim_geom , _position . X , _position . Y , _position . Z ) ; d . Quaternion myrot = new d . Quaternion ( ) ; myrot . W = _orientation . W ; myrot . X = _orientation . X ; myrot . Y = _orientation . Y ; myrot . Z = _orientation . Z ; d . GeomSetQuaternion ( prim_geom , ref myrot ) ; if ( IsPhysical && Body == IntPtr . Zero ) { enableBody ( ) ; if ( Body != IntPtr . Zero ) { d . BodyEnable ( Body ) ; } } changeSelectedStatus ( ) ; if ( childPrim ) { if ( _parent is OdePrim ) { OdePrim parent = ( OdePrim ) _parent ; parent . ChildSetGeom ( this ) ; } } resetCollisionAccounting ( ) ; }
Change prim in response to a shape taint.
Change prim in response to a shape taint .
// Cleanup of old prim geometry and Bodies // we don't need to do space calculation because the client sends a position update also. // Construction of new prim // Don't need to re-enable body..   it's done in CreateMesh // createmesh returns null when it doesn't mesh. //myrot.W = _orientation.w; //d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z); // Re creates body on size. // EnableBody also does setMass() //            m_taintshape = false;