TriggerObjectDeGrab() публичный Метод

public TriggerObjectDeGrab ( uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs ) : void
localID uint
originalID uint
remoteClient IClientAPI
surfaceArgs SurfaceTouchEventArgs
Результат void
Пример #1
0
        public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List <SurfaceTouchEventArgs> surfaceArgs)
        {
            SceneObjectPart part = GetSceneObjectPart(localID);

            if (part == null)
            {
                return;
            }

            SceneObjectGroup grp = part.ParentGroup;

            SurfaceTouchEventArgs surfaceArg = null;

            if (surfaceArgs != null && surfaceArgs.Count > 0)
            {
                surfaceArg = surfaceArgs[0];
            }

            // If the touched prim handles touches, deliver it
            if ((part.ScriptEvents & scriptEvents.touch_end) != 0)
            {
                EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg);
            }
            // if not or PassTouchs, send it also to root.
            if (((part.ScriptEvents & scriptEvents.touch_end) == 0) ||
                (part.PassTouches && (part.LocalId != grp.RootPart.LocalId)))
            {
                EventManager.TriggerObjectDeGrab(grp.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg);
            }
        }
Пример #2
0
        public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List <SurfaceTouchEventArgs> surfaceArgs)
        {
            SceneObjectPart part = GetSceneObjectPart(localID);

            if (part == null)
            {
                return;
            }

            SceneObjectGroup obj = part.ParentGroup;

            SurfaceTouchEventArgs surfaceArg = null;

            if (surfaceArgs != null && surfaceArgs.Count > 0)
            {
                surfaceArg = surfaceArgs[0];
            }

            // If the touched prim handles touches, deliver it
            // If not, deliver to root prim
            if ((part.ScriptEvents & scriptEvents.touch_end) != 0)
            {
                EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg);
            }
            else
            {
                EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg);
            }
        }
Пример #3
0
        public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient)
        {
            List <EntityBase> EntityList = GetEntities();

            foreach (EntityBase ent in EntityList)
            {
                if (ent is SceneObjectGroup)
                {
                    SceneObjectGroup obj = ent as SceneObjectGroup;

                    // Is this prim part of the group
                    if (obj.HasChildPrim(localID))
                    {
                        SceneObjectPart part = obj.GetChildPart(localID);
                        if (part != null)
                        {
                            // If the touched prim handles touches, deliver it
                            // If not, deliver to root prim
                            if ((part.ScriptEvents & scriptEvents.touch_end) != 0)
                            {
                                EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient);
                            }
                            else
                            {
                                EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient);
                            }

                            return;
                        }
                        return;
                    }
                }
            }
        }
Пример #4
0
        public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List <SurfaceTouchEventArgs> surfaceArgs)
        {
            SurfaceTouchEventArgs surfaceArg = null;

            if (surfaceArgs != null && surfaceArgs.Count > 0)
            {
                surfaceArg = surfaceArgs[0];
            }

            SceneObjectGroup obj = this.GetGroupByPrim(localID);

            // Is this prim part of the group
            if (obj != null && obj.HasChildPrim(localID))
            {
                SceneObjectPart  part  = obj.GetChildPart(localID);
                SceneObjectGroup group = part.ParentGroup;
                if (part != null)
                {
                    // If the touched prim handles touches, deliver it
                    // If not, deliver to root prim
                    ScriptEvents eventsThatNeedDegrab = (ScriptEvents.touch_end | ScriptEvents.touch);

                    if ((part.ScriptEvents & eventsThatNeedDegrab) != 0)
                    {
                        EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg);
                    }
                    else if ((group.RootPart.ScriptEvents & eventsThatNeedDegrab) != 0)
                    {
                        EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg);
                    }

                    // Always send an object degrab.
                    m_sceneGraph.DegrabObject(localID, remoteClient, surfaceArgs);

                    return;
                }
                return;
            }
        }