public TriggerObjectGrabbing ( uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs ) : void | ||
localID | uint | |
originalID | uint | |
offsetPos | Vector3 | |
remoteClient | IClientAPI | |
surfaceArgs | SurfaceTouchEventArgs | |
return | void |
public virtual void ProcessObjectGrabUpdate( UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List <SurfaceTouchEventArgs> surfaceArgs) { SceneObjectPart part = GetSceneObjectPart(objectID); 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) != 0) { EventManager.TriggerObjectGrabbing(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); } // Deliver to the root prim if the touched prim doesn't handle touches // or if we're meant to pass on touches anyway. Don't send to root prim // if prim touched is the root prim as we just did it if (((part.ScriptEvents & scriptEvents.touch) == 0) || (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) { EventManager.TriggerObjectGrabbing(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); } }
public virtual void ProcessObjectGrabUpdate( UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List <SurfaceTouchEventArgs> surfaceArgs) { SceneObjectPart part = GetSceneObjectPart(objectID); if (part == null) { return; } SceneObjectGroup group = part.ParentGroup; if (group == null || group.IsDeleted) { return; } if (Permissions.CanMoveObject(group, remoteClient)) { group.GrabMovement(objectID, offset, pos, remoteClient); } // This is outside the above permissions condition // so that if the object is locked the client moving the object // get's it's position on the simulator even if it was the same as before // This keeps the moving user's client in sync with the rest of the world. group.SendGroupTerseUpdate(); SurfaceTouchEventArgs surfaceArg = null; if (surfaceArgs != null && surfaceArgs.Count > 0) { surfaceArg = surfaceArgs[0]; } Vector3 grabOffset = pos - part.AbsolutePosition; // If the touched prim handles touches, deliver it uint partLocalId = part.LocalId; if ((part.ScriptEvents & scriptEvents.touch) != 0) { EventManager.TriggerObjectGrabbing(partLocalId, 0, grabOffset, remoteClient, surfaceArg); if (!part.PassTouches) { return; } } uint rootLocalId = group.RootPart.LocalId; // Deliver to the root prim if the touched prim doesn't handle touches // or if we're meant to pass on touches anyway. if (partLocalId != rootLocalId && (group.RootPart.ScriptEvents & scriptEvents.touch) != 0) { EventManager.TriggerObjectGrabbing(rootLocalId, partLocalId, grabOffset, remoteClient, surfaceArg); } }
public virtual void ProcessObjectGrabUpdate(UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List <SurfaceTouchEventArgs> surfaceArgs) { List <EntityBase> EntityList = GetEntities(); SurfaceTouchEventArgs surfaceArg = null; if (surfaceArgs != null && surfaceArgs.Count > 0) { surfaceArg = surfaceArgs[0]; } foreach (EntityBase ent in EntityList) { if (ent is SceneObjectGroup) { SceneObjectGroup obj = ent as SceneObjectGroup; if (obj != null) { // Is this prim part of the group if (obj.HasChildPrim(objectID)) { SceneObjectPart part = obj.GetChildPart(objectID); // If the touched prim handles touches, deliver it // If not, deliver to root prim if ((part.ScriptEvents & scriptEvents.touch) != 0) { EventManager.TriggerObjectGrabbing(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); } // Deliver to the root prim if the touched prim doesn't handle touches // or if we're meant to pass on touches anyway. Don't send to root prim // if prim touched is the root prim as we just did it if (((part.ScriptEvents & scriptEvents.touch) == 0) || (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) { EventManager.TriggerObjectGrabbing(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); } return; } } } } }