OpenSim.Region.Framework.Scenes.SceneObjectPart.ScheduleTerseUpdate C# (CSharp) Method

ScheduleTerseUpdate() public method

Schedule a terse update for this prim. Terse updates only send position, rotation, velocity, rotational velocity and shape information.
public ScheduleTerseUpdate ( ) : void
return void
        public void ScheduleTerseUpdate()
        {
            if (m_updateFlag < 1)
            {
                if (m_parentGroup != null)
                {
                    m_parentGroup.HasGroupChanged = true;
                    m_parentGroup.QueueForUpdateCheck();
                }
                TimeStampTerse = (uint) Util.UnixTimeSinceEpoch();
                m_updateFlag = 1;

            //                m_log.DebugFormat(
            //                    "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}",
            //                    UUID, Name, TimeStampTerse);
            }
        }

Usage Example

コード例 #1
0
        public void doChangeObject(SceneObjectPart part, ObjectChangeData data)
        {
            // TODO  this still as excessive *.Schedule*Update()s

            if (part != null && part.ParentGroup != null)
            {
                ObjectChangeType change = data.change;
                bool togroup = ((change & ObjectChangeType.Group) != 0);
                //                bool uniform = ((what & ObjectChangeType.UniformScale) != 0);  not in use

                SceneObjectGroup group = part.ParentGroup;
                PhysicsActor pha = group.RootPart.PhysActor;

                updatetype updateType = updatetype.none;

                if (togroup)
                {
                    // related to group
                    if ((change & (ObjectChangeType.Rotation | ObjectChangeType.Position)) != 0)
                    {
                        if ((change & ObjectChangeType.Rotation) != 0)
                        {
                            group.RootPart.UpdateRotation(data.rotation);
                            updateType = updatetype.none;
                        }
                        if ((change & ObjectChangeType.Position) != 0)
                        {
                            if (IsAttachment || m_scene.Permissions.CanObjectEntry(group.UUID, false, data.position))
                                UpdateGroupPosition(data.position);
                            updateType = updatetype.groupterse;
                        }
                        else
                        // ugly rotation update of all parts
                        {
                            group.ResetChildPrimPhysicsPositions();
                        }

                    }
                    if ((change & ObjectChangeType.Scale) != 0)
                    {
                        if (pha != null)
                            pha.Building = true;

                        group.GroupResize(data.scale);
                        updateType = updatetype.none;

                        if (pha != null)
                            pha.Building = false;
                    }
                }
                else
                {
                    // related to single prim in a link-set ( ie group)
                    if (pha != null)
                        pha.Building = true;

                    // root part is special
                    // parts offset positions or rotations need to change also

                    if (part == group.RootPart)
                    {
                        if ((change & ObjectChangeType.Rotation) != 0)
                            group.UpdateRootRotation(data.rotation);
                        if ((change & ObjectChangeType.Position) != 0)
                            group.UpdateRootPosition(data.position);
                        if ((change & ObjectChangeType.Scale) != 0)
                            part.Resize(data.scale);
                    }
                    else
                    {
                        if ((change & ObjectChangeType.Position) != 0)
                        {
                            part.OffsetPosition = data.position;
                            updateType = updatetype.partterse;
                        }
                        if ((change & ObjectChangeType.Rotation) != 0)
                        {
                            part.UpdateRotation(data.rotation);
                            updateType = updatetype.none;
                        }
                        if ((change & ObjectChangeType.Scale) != 0)
                        {
                            part.Resize(data.scale);
                            updateType = updatetype.none;
                        }
                    }

                    if (pha != null)
                        pha.Building = false;
                }

                if (updateType != updatetype.none)
                {
                    group.HasGroupChanged = true;

                    switch (updateType)
                    {
                        case updatetype.partterse:
                            part.ScheduleTerseUpdate();
                            break;
                        case updatetype.partfull:
                            part.ScheduleFullUpdate();
                            break;
                        case updatetype.groupterse:
                            group.ScheduleGroupForTerseUpdate();
                            break;
                        case updatetype.groupfull:
                            group.ScheduleGroupForFullUpdate();
                            break;
                        default:
                            break;
                    }
                }
            }
        }
All Usage Examples Of OpenSim.Region.Framework.Scenes.SceneObjectPart::ScheduleTerseUpdate
SceneObjectPart