OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
/// <summary>
/// Move prim in response to a move taint.
/// </summary>
Move prim in response to a move taint.
Move prim in response to a move taint .
private void changemove()
        {
            if (IsPhysical)
            {
                if (!m_disabled && !m_taintremove && !childPrim)
                {
                    if (Body == IntPtr.Zero)
                        enableBody();
                    if (_parent != null)
                    {
                        if (m_linkJoint != IntPtr.Zero)
                        {
                            d.JointDestroy(m_linkJoint);
                            m_linkJoint = IntPtr.Zero;
                        }
                    }
                    if (Body != IntPtr.Zero)
                    {
                        d.BodySetPosition(Body, _position.X, _position.Y, _position.Z);
                        if (_parent != null)
                        {
                            OdePrim odParent = (OdePrim)_parent;
                            if (Body != (IntPtr)0 && odParent.Body != (IntPtr)0 && Body != odParent.Body)
                            {
Console.WriteLine(" JointCreateFixed");
                                m_linkJoint = d.JointCreateFixed(_parent_scene.world, _linkJointGroup);
                                d.JointAttach(m_linkJoint, Body, odParent.Body);
                                d.JointSetFixed(m_linkJoint);
                            }
                        }
                        d.BodyEnable(Body);
                        if (m_vehicle.Type != Vehicle.TYPE_NONE)
                        {
                            m_vehicle.Enable(Body, _parent_scene);
                        }
                    }
                    else
                    {
                        m_log.WarnFormat("[PHYSICS]: Body for {0} still null after enableBody().  This is a crash scenario.", Name);
                    }
                }
            }
            IntPtr tempspace = _parent_scene.recalculateSpaceForGeom(prim_geom, _position, m_targetSpace);
            m_targetSpace = tempspace;
            d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
            d.SpaceAdd(m_targetSpace, prim_geom);
            changeSelectedStatus();
            resetCollisionAccounting();
            m_taintposition = _position;
        }
private void changemove ( ) { if ( IsPhysical ) { if ( ! m_disabled && ! m_taintremove && ! childPrim ) { if ( Body == IntPtr . Zero ) enableBody ( ) ; if ( _parent != null ) { if ( m_linkJoint != IntPtr . Zero ) { d . JointDestroy ( m_linkJoint ) ; m_linkJoint = IntPtr . Zero ; } } if ( Body != IntPtr . Zero ) { d . BodySetPosition ( Body , _position . X , _position . Y , _position . Z ) ; if ( _parent != null ) { OdePrim odParent = ( OdePrim ) _parent ; if ( Body != ( IntPtr ) 0 && odParent . Body != ( IntPtr ) 0 && Body != odParent . Body ) { Console . WriteLine ( " " ) ; m_linkJoint = d . JointCreateFixed ( _parent_scene . world , _linkJointGroup ) ; d . JointAttach ( m_linkJoint , Body , odParent . Body ) ; d . JointSetFixed ( m_linkJoint ) ; } } d . BodyEnable ( Body ) ; if ( m_vehicle . Type != Vehicle . TYPE_NONE ) { m_vehicle . Enable ( Body , _parent_scene ) ; } } else { m_log . WarnFormat ( " " , Name ) ; } } } IntPtr tempspace = _parent_scene . recalculateSpaceForGeom ( prim_geom , _position , m_targetSpace ) ; m_targetSpace = tempspace ; d . GeomSetPosition ( prim_geom , _position . X , _position . Y , _position . Z ) ; d . SpaceAdd ( m_targetSpace , prim_geom ) ; changeSelectedStatus ( ) ; resetCollisionAccounting ( ) ; m_taintposition = _position ; }
Move prim in response to a move taint.
Move prim in response to a move taint .
//Prim auto disable after 20 frames, //if you move it, re-enable the prim manually. // KF: Fixed Joints were removed? Anyway - this Console.WriteLine does not show up, so routine is not used?? //else // { //m_log.Debug("[BUG]: race!"); //} // string primScenAvatarIn = _parent_scene.whichspaceamIin(_position); // int[] arrayitem = _parent_scene.calculateSpaceArrayItemFromPos(_position); //          _parent_scene.waitForSpaceUnlock(m_targetSpace); //                _parent_scene.waitForSpaceUnlock(m_targetSpace); //                    _parent_scene.waitForSpaceUnlock(m_targetSpace);