Exemplo n.º 1
0
        public void PlayfwdState(SceneObjectPart part)
        {
            part.Undoing = true;

            if (part.ParentID == 0)
            {
                if (Position != Vector3.Zero)
                {
                    part.ParentGroup.AbsolutePosition = Position;
                }

                if (Rotation != Quaternion.Identity)
                {
                    part.UpdateRotation(Rotation);
                }

                if (Scale != Vector3.Zero)
                {
                    if (ForGroup)
                    {
                        part.ParentGroup.GroupResize(Scale);
                    }
                    else
                    {
                        part.Resize(Scale);
                    }
                }

                part.ParentGroup.ScheduleGroupForTerseUpdate();
            }
            else
            {
                // Note: Updating these properties on sop automatically schedules an update if needed
                if (Position != Vector3.Zero)
                {
                    part.OffsetPosition = Position;
                }

                if (Rotation != Quaternion.Identity)
                {
                    part.UpdateRotation(Rotation);
                }

                if (Scale != Vector3.Zero)
                {
                    part.Resize(Scale);
                }
            }

            part.Undoing = false;
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
        public void PlayfwdState(SceneObjectPart part)
        {
            if (part != null)
            {
                bool ChangedScale = false;
                bool ChangedRot   = false;
                bool ChangedPos   = false;
                part.Undoing = true;

                if (part.UUID == part.ParentGroup.UUID)
                {
                    if (Position != Vector3.Zero)
                    {
                        ChangedPos = true;
                        part.ParentGroup.AbsolutePosition = Position;
                    }
                    if (Rotation != Quaternion.Identity)
                    {
                        ChangedRot = true;
                        part.UpdateRotation(Rotation);
                    }
                    if (Scale != Vector3.Zero)
                    {
                        ChangedScale = true;
                        part.Resize(Scale);
                    }

                    foreach (SceneObjectPart child in part.ParentGroup.ChildrenList)
                    {
                        if (child.UUID != part.UUID)
                        {
                            child.Redo(); //No updates here, child redo will do it on their own
                        }
                    }
                }
                else
                {
                    if (Position != Vector3.Zero)
                    {
                        ChangedPos = true;
                        part.FixOffsetPosition(Position, false);
                    }
                    if (Rotation != Quaternion.Identity)
                    {
                        ChangedRot = true;
                        part.ParentGroup.Rotation = (Rotation);
                    }
                    if (Scale != Vector3.Zero)
                    {
                        ChangedScale = true;
                        part.Resize(Scale);
                    }
                }

                part.ScheduleUpdate((ChangedScale ? PrimUpdateFlags.Shape : PrimUpdateFlags.None) |
                                    (ChangedPos ? PrimUpdateFlags.Position : PrimUpdateFlags.None) |
                                    (ChangedRot ? PrimUpdateFlags.Rotation : PrimUpdateFlags.None));
                part.Undoing = false;
            }
        }
Exemplo n.º 4
0
        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.Scale = Scale;
                    }

                    lock (part.ParentGroup.Children)
                    {
                        foreach (SceneObjectPart child in
                                 part.ParentGroup.Children.Values.Where(child => child.UUID != part.UUID))
                        {
                            child.Undo(); //No updates here, child undo will do it on their own
                        }
                    }
                }
                else
                {
                    if (Position != Vector3.Zero)
                    {
                        part.OffsetPosition = Position;
                    }

                    part.UpdateRotation(Rotation);
                    if (Scale != Vector3.Zero)
                    {
                        part.Resize(Scale);
                    }
                }
                part.Undoing = false;
                part.ScheduleFullUpdate();
            }
        }
Exemplo n.º 5
0
        public void PlayfwdState(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.Scale = Scale;
                    }

                    foreach (SceneObjectPart child in
                             part.ParentGroup.GetParts().Where(child => child.UUID != part.UUID))
                    {
                        child.Redo(); //No updates here, child redo will do it on their own
                    }
                }
                else
                {
                    if (Position != Vector3.Zero)
                    {
                        part.OffsetPosition = Position;
                    }

                    part.UpdateRotation(Rotation);
                    if (Scale != Vector3.Zero)
                    {
                        part.Resize(Scale);
                    }
                }
                part.Undoing = false;
                part.ScheduleFullUpdate(PrimUpdateFlags.FindBest);
            }
        }
Exemplo n.º 6
0
        public void PlaybackState(SceneObjectPart part)
        {
            if (part != null)
            {
                part.Undoing = true;

                bool ChangedScale = false;
                bool ChangedRot   = false;
                bool ChangedPos   = false;

                if (part.UUID == part.ParentGroup.UUID)
                {
                    if (Position != Vector3.Zero)
                    {
                        ChangedPos = true;
                        part.ParentGroup.AbsolutePosition = Position;
                    }
                    ChangedRot          = true;
                    part.RotationOffset = Rotation;
                    if (Scale != Vector3.Zero)
                    {
                        ChangedScale = true;
                        part.Scale   = Scale;
                    }

#if (!ISWIN)
                    foreach (SceneObjectPart child in part.ParentGroup.ChildrenList)
                    {
                        if (child.UUID != part.UUID)
                        {
                            child.Undo(); //No updates here, child undo will do it on their own
                        }
                    }
#else
                    foreach (SceneObjectPart child in part.ParentGroup.ChildrenList.Where(child => child.UUID != part.UUID))
                    {
                        child.Undo(); //No updates here, child undo will do it on their own
                    }
#endif
                }
                else
                {
                    if (Position != Vector3.Zero)
                    {
                        ChangedPos = true;
                        part.FixOffsetPosition(Position, false);
                    }
                    ChangedRot = true;
                    part.UpdateRotation(Rotation);
                    if (Scale != Vector3.Zero)
                    {
                        ChangedScale = true;
                        part.Resize(Scale);
                    }
                }
                part.Undoing = false;
                part.ScheduleUpdate((ChangedScale ? PrimUpdateFlags.Shape : PrimUpdateFlags.None) |
                                    (ChangedPos ? PrimUpdateFlags.Position : PrimUpdateFlags.None) |
                                    (ChangedRot ? PrimUpdateFlags.Rotation : PrimUpdateFlags.None));
            }
        }
Exemplo n.º 7
0
        public void PlaybackState(SceneObjectPart part)
        {
            part.Undoing = true;

            if (part.ParentID == 0)
            {
//                    m_log.DebugFormat(
//                        "[UNDO STATE]: Undoing position to {0} for root part {1} {2}",
//                        Position, part.Name, part.LocalId);

                if (Position != Vector3.Zero)
                {
                    if (ForGroup)
                    {
                        part.ParentGroup.AbsolutePosition = Position;
                    }
                    else
                    {
                        part.ParentGroup.UpdateRootPosition(Position);
                    }
                }

//                    m_log.DebugFormat(
//                        "[UNDO STATE]: Undoing rotation {0} to {1} for root part {2} {3}",
//                        part.RotationOffset, Rotation, part.Name, part.LocalId);

                if (ForGroup)
                {
                    part.UpdateRotation(Rotation);
                }
                else
                {
                    part.ParentGroup.UpdateRootRotation(Rotation);
                }

                if (Scale != Vector3.Zero)
                {
//                        m_log.DebugFormat(
//                            "[UNDO STATE]: Undoing scale {0} to {1} for root part {2} {3}",
//                            part.Shape.Scale, Scale, part.Name, part.LocalId);

                    if (ForGroup)
                    {
                        part.ParentGroup.GroupResize(Scale);
                    }
                    else
                    {
                        part.Resize(Scale);
                    }
                }

                part.ParentGroup.ScheduleGroupForTerseUpdate();
            }
            else
            {
                // Note: Updating these properties on sop automatically schedules an update if needed
                if (Position != Vector3.Zero)
                {
//                        m_log.DebugFormat(
//                            "[UNDO STATE]: Undoing position {0} to {1} for child part {2} {3}",
//                            part.OffsetPosition, Position, part.Name, part.LocalId);

                    part.OffsetPosition = Position;
                }

//                    m_log.DebugFormat(
//                        "[UNDO STATE]: Undoing rotation {0} to {1} for child part {2} {3}",
//                        part.RotationOffset, Rotation, part.Name, part.LocalId);

                part.UpdateRotation(Rotation);

                if (Scale != Vector3.Zero)
                {
//                        m_log.DebugFormat(
//                            "[UNDO STATE]: Undoing scale {0} to {1} for child part {2} {3}",
//                            part.Shape.Scale, Scale, part.Name, part.LocalId);

                    part.Resize(Scale);
                }
            }

            part.Undoing = false;
        }