/// <summary> /// Handle the deselection of a prim from the client. /// </summary> /// <param name="primLocalID"></param> /// <param name="remoteClient"></param> public void DeselectPrim(uint primLocalID, IClientAPI remoteClient) { SceneObjectPart part = GetSceneObjectPart(primLocalID); if (part == null) { return; } bool oldgprSelect = part.ParentGroup.IsSelected; part.IsSelected = false; if (oldgprSelect != part.ParentGroup.IsSelected) { if (!part.ParentGroup.IsAttachment) { EventManager.TriggerParcelPrimCountTainted(); } } // restore targetOmega if (part.AngularVelocity != Vector3.Zero) { part.ScheduleTerseUpdate(); } }
/// <summary> /// Handle the deselection of a prim from the client. /// </summary> /// <param name="primLocalID"></param> /// <param name="remoteClient"></param> public void DeselectPrim(uint primLocalID, IClientAPI remoteClient) { SceneObjectPart part = GetSceneObjectPart(primLocalID); if (part == null) { return; } bool oldgprSelect = part.ParentGroup.IsSelected; // This is wrong, wrong, wrong. Selection should not be // handled by group, but by prim. Legacy cruft. // TODO: Make selection flagging per prim! // if (Permissions.CanChangeSelectedState(part, (ScenePresence)remoteClient.SceneAgent)) { part.IsSelected = false; if (!part.ParentGroup.IsAttachment && oldgprSelect != part.ParentGroup.IsSelected) { EventManager.TriggerParcelPrimCountTainted(); } // restore targetOmega if (part.AngularVelocity != Vector3.Zero) { part.ScheduleTerseUpdate(); } } }
public void PlaybackState(SceneObjectPart part) { if (part != null) { part.Undoing = true; if (part.ParentID == 0) { if (Position != Vector3.Zero) { part.ParentGroup.AbsolutePosition = Position; } part.RotationOffset = Rotation; if (Scale != Vector3.Zero) { part.Resize(Scale); } part.ParentGroup.ScheduleGroupForTerseUpdate(); } else { if (Position != Vector3.Zero) { part.OffsetPosition = Position; } part.UpdateRotation(Rotation); if (Scale != Vector3.Zero) { part.Resize(Scale); } part.ScheduleTerseUpdate(); } part.Undoing = false; } }
/// <summary> /// Handle the deselection of a prim from the client. /// </summary> /// <param name="primLocalID"></param> /// <param name="remoteClient"></param> public void DeselectPrim(uint primLocalID, IClientAPI remoteClient) { SceneObjectPart part = GetSceneObjectPart(primLocalID); if (part == null) { return; } /* * // A deselect packet contains all the local prims being deselected. However, since selection is still * // group based we only want the root prim to trigger a full update - otherwise on objects with many prims * // we end up sending many duplicate ObjectUpdates * if (part.ParentGroup.RootPart.LocalId != part.LocalId) * return; * * // This is wrong, wrong, wrong. Selection should not be * // handled by group, but by prim. Legacy cruft. * // TODO: Make selection flagging per prim! * // * if (Permissions.CanEditObject(part.ParentGroup.UUID, remoteClient.AgentId) || Permissions.CanMoveObject(part.ParentGroup.UUID, remoteClient.AgentId)) || part.ParentGroup.IsSelected = false; || || part.ParentGroup.ScheduleGroupForFullUpdate(); || || // If it's not an attachment, and we are allowed to move it, || // then we might have done so. If we moved across a parcel || // boundary, we will need to recount prims on the parcels. || // For attachments, that makes no sense. || // || if (!part.ParentGroup.IsAttachment) || { || if (Permissions.CanEditObject( || part.UUID, remoteClient.AgentId) || Permissions.CanMoveObject( || part.UUID, remoteClient.AgentId)) || EventManager.TriggerParcelPrimCountTainted(); || } */ bool oldgprSelect = part.ParentGroup.IsSelected; // This is wrong, wrong, wrong. Selection should not be // handled by group, but by prim. Legacy cruft. // TODO: Make selection flagging per prim! // if (Permissions.CanEditObject(part.ParentGroup.UUID, remoteClient.AgentId) || Permissions.CanMoveObject(part.ParentGroup.UUID, remoteClient.AgentId)) { part.IsSelected = false; if (!part.ParentGroup.IsAttachment && oldgprSelect != part.ParentGroup.IsSelected) { EventManager.TriggerParcelPrimCountTainted(); } // restore targetOmega if (part.AngularVelocity != Vector3.Zero) { part.ScheduleTerseUpdate(); } } }