public void UpdateAttachmentPosition(IClientAPI client, SceneObjectGroup sog, Vector3 pos) { // If this is an attachment, then we need to save the modified // object back into the avatar's inventory. First we save the // attachment point information, then we update the relative // positioning (which caused this method to get driven in the // first place. Then we have to mark the object as NOT an // attachment. This is necessary in order to correctly save // and retrieve GroupPosition information for the attachment. // Then we save the asset back into the appropriate inventory // entry. Finally, we restore the object's attachment status. byte attachmentPoint = (byte)sog.RootPart.AttachmentPoint; sog.UpdateGroupPosition(pos, true); sog.RootPart.IsAttachment = false; sog.AbsolutePosition = sog.RootPart.AttachedPos; UpdateKnownItem(client, sog, sog.GetFromItemID(), sog.OwnerID); sog.SetAttachmentPoint(attachmentPoint); }
public void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos) { if (!Enabled) return; sog.UpdateGroupPosition(pos); sog.HasGroupChanged = true; }
public void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos) { if (!Enabled) return; // First we save the // attachment point information, then we update the relative // positioning. Then we have to mark the object as NOT an // attachment. This is necessary in order to correctly save // and retrieve GroupPosition information for the attachment. // Finally, we restore the object's attachment status. uint attachmentPoint = sog.AttachmentPoint; sog.UpdateGroupPosition(pos); sog.IsAttachment = false; sog.AbsolutePosition = sog.RootPart.AttachedPos; sog.AttachmentPoint = attachmentPoint; sog.HasGroupChanged = true; }