public int physGetLinksetType(UUID hostID, UUID scriptID)
        {
            int ret = -1;

            if (!Enabled)
            {
                return(ret);
            }

            // The part that is requesting the change.
            SceneObjectPart requestingPart = BaseScene.GetSceneObjectPart(hostID);

            if (requestingPart != null)
            {
                // The type is is always on the root of a linkset.
                SceneObjectGroup containingGroup = requestingPart.ParentGroup;
                SceneObjectPart  rootPart        = containingGroup.RootPart;

                if (rootPart != null)
                {
                    Physics.Manager.PhysicsActor rootPhysActor = rootPart.PhysActor;
                    if (rootPhysActor != null)
                    {
                        ret = (int)rootPhysActor.Extension(PhysFunctGetLinksetType);
                    }
                    else
                    {
                        m_log.WarnFormat("{0} physGetLinksetType: root part does not have a physics actor. rootName={1}, hostID={2}",
                                         LogHeader, rootPart.Name, hostID);
                    }
                }
                else
                {
                    m_log.WarnFormat("{0} physGetLinksetType: root part does not exist. RequestingPartName={1}, hostID={2}",
                                     LogHeader, requestingPart.Name, hostID);
                }
            }
            else
            {
                m_log.WarnFormat("{0} physGetLinsetType: cannot find script object in scene. hostID={1}", LogHeader, hostID);
            }
            return(ret);
        }
예제 #2
0
        /// <summary>
        /// Called by the transit manager when this avatar has entered a new transit stage
        /// </summary>
        /// <param name="stage"></param>
        public async Task TransitStateChange(AvatarTransit.TransitStage stage, IEnumerable <uint> rideOnPrimIds)
        {
            if (stage == AvatarTransit.TransitStage.SendBegin)
            {
                Physics.Manager.PhysicsActor pa = ScenePresence.PhysicsActor;

                if (pa != null)
                {
                    ScenePresence.PhysicsActor.Suspend();
                }

                if (_capsControl != null)
                {
                    _capsControl.PauseTraffic();
                }
                await _udpCircuit.PauseUpdatesAndFlush();
            }
            else if (stage == AvatarTransit.TransitStage.SendCompletedSuccess || stage == AvatarTransit.TransitStage.SendError)
            {
                if (_capsControl != null)
                {
                    _capsControl.ResumeTraffic();
                }
                if (stage == AvatarTransit.TransitStage.SendCompletedSuccess)
                {
                    _udpCircuit.ResumeUpdates(rideOnPrimIds);
                }
                else
                {
                    _udpCircuit.ResumeUpdates(null);    // don't kill object update if not leaving region
                }
                if (stage == AvatarTransit.TransitStage.SendError)
                {
                    Physics.Manager.PhysicsActor pa = ScenePresence.PhysicsActor;

                    if (pa != null)
                    {
                        pa.Resume(false, null);
                    }
                }
            }
        }