OpenSim.Region.Framework.Scenes.Scene.CrossPrimGroupIntoNewRegion C# (CSharp) Method

CrossPrimGroupIntoNewRegion() public method

Move the given scene object into a new region depending on which region its absolute position has moved into.
public CrossPrimGroupIntoNewRegion ( Vector3 attemptedPosition, SceneObjectGroup grp, bool silent ) : void
attemptedPosition Vector3 the attempted out of region position of the scene object
grp SceneObjectGroup the scene object that we're crossing
silent bool
return void
        public void CrossPrimGroupIntoNewRegion(Vector3 attemptedPosition, SceneObjectGroup grp, bool silent)
        {
            if (grp == null)
                return;
            if (grp.IsDeleted)
                return;

            if (grp.RootPart.DIE_AT_EDGE)
            {
                // We remove the object here
                try
                {
                    DeleteSceneObject(grp, false);
                }
                catch (Exception)
                {
                    m_log.Warn("[SCENE]: exception when trying to remove the prim that crossed the border.");
                }
                return;
            }

            if (grp.RootPart.RETURN_AT_EDGE)
            {
                // We remove the object here
                try
                {
                    List<SceneObjectGroup> objects = new List<SceneObjectGroup>();
                    objects.Add(grp);
                    SceneObjectGroup[] objectsArray = objects.ToArray();
                    returnObjects(objectsArray, UUID.Zero);
                }
                catch (Exception)
                {
                    m_log.Warn("[SCENE]: exception when trying to return the prim that crossed the border.");
                }
                return;
            }

            if (m_teleportModule != null)
                m_teleportModule.Cross(grp, attemptedPosition, silent);
        }
Scene