public void UpdateGroupPosition(Vector3 pos, bool SaveUpdate)
{
if (SaveUpdate)
{
foreach (SceneObjectPart part in ChildrenList)
{
part.StoreUndoState();
}
}
if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
{
if (IsAttachment)
{
m_rootPart.AttachedPos = pos;
}
if (RootPart.GetStatusSandbox())
{
if (Util.GetDistanceTo(RootPart.StatusSandboxPos, pos) > 10)
{
ScriptSetPhysicsStatus(false);
pos = AbsolutePosition;
IChatModule chatModule = Scene.RequestModuleInterface<IChatModule>();
if (chatModule != null)
chatModule.SimChat("Hit Sandbox Limit", ChatTypeEnum.DebugChannel, 0x7FFFFFFF,
RootPart.AbsolutePosition, Name, UUID, false, Scene);
}
}
AbsolutePosition = pos;
HasGroupChanged = true;
}
//we need to do a terse update even if the move wasn't allowed
// so that the position is reset in the client (the object snaps back)
ScheduleGroupTerseUpdate();
if (SitTargetAvatar.Count != 0)
{
foreach (UUID clientID in SitTargetAvatar)
{
//Send full updates to the avatar as well so that they move as well
IScenePresence SP;
if (m_scene.TryGetScenePresence(clientID, out SP))
{
SP.ParentPosition = AbsolutePosition;
SP.SendTerseUpdateToAllClients();
}
}
}
}