当前位置: 首页>>代码示例>>C#>>正文


C# SceneObjectPart.ScheduleUpdate方法代码示例

本文整理汇总了C#中OpenSim.Region.Framework.Scenes.SceneObjectPart.ScheduleUpdate方法的典型用法代码示例。如果您正苦于以下问题:C# SceneObjectPart.ScheduleUpdate方法的具体用法?C# SceneObjectPart.ScheduleUpdate怎么用?C# SceneObjectPart.ScheduleUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenSim.Region.Framework.Scenes.SceneObjectPart的用法示例。


在下文中一共展示了SceneObjectPart.ScheduleUpdate方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetRootPartOwner

        /// <summary>
        /// Set the owner of the root part.
        /// </summary>
        /// <param name="part"></param>
        /// <param name="cAgentID"></param>
        /// <param name="cGroupID"></param>
        public void SetRootPartOwner(SceneObjectPart part, UUID cAgentID, UUID cGroupID)
        {
            part.LastOwnerID = part.OwnerID;
            part.OwnerID = cAgentID;
            part.GroupID = cGroupID;

            if (part.OwnerID != cAgentID)
            {
                // Apply Next Owner Permissions if we're not bypassing permissions
                if (!m_scene.Permissions.BypassPermissions())
                    ApplyNextOwnerPermissions();
            }

            part.ScheduleUpdate(PrimUpdateFlags.FullUpdate);
        }
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:21,代码来源:SceneObjectGroup.cs

示例2: SetTextureAnim

        private void SetTextureAnim(SceneObjectPart part, int mode, int face, int sizex, int sizey, double start, double length, double rate)
        {

            Primitive.TextureAnimation pTexAnim = new Primitive.TextureAnimation();
            pTexAnim.Flags = (Primitive.TextureAnimMode)mode;

            //ALL_SIDES
            if (face == ScriptBaseClass.ALL_SIDES)
                face = 255;

            pTexAnim.Face = (uint)face;
            pTexAnim.Length = (float)length;
            pTexAnim.Rate = (float)rate;
            pTexAnim.SizeX = (uint)sizex;
            pTexAnim.SizeY = (uint)sizey;
            pTexAnim.Start = (float)start;

            part.AddTextureAnimation(pTexAnim);
            part.ScheduleUpdate(PrimUpdateFlags.FindBest);
            part.ParentGroup.HasGroupChanged = true;
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:21,代码来源:LSL_Api.cs

示例3: SetParticleSystem


//.........这里部分代码省略.........
                    // PSYS_SRC_OUTERANGLE and PSYS_SRC_ANGLE_END also use the same variable. The
                    // client tells the difference between the two by looking at the 0x02 bit in
                    // the PartFlags variable.
                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_INNERANGLE)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.InnerAngle = (float)tempf;
                        prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_OUTERANGLE)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.OuterAngle = (float)tempf;
                        prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_TEXTURE)
                    {
                        prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1));
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_RATE)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.BurstRate = (float)tempf;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_PART_COUNT)
                    {
                        prules.BurstPartCount = (byte)(int)rules.GetLSLIntegerItem(i + 1);
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_RADIUS)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.BurstRadius = (float)tempf;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_SPEED_MIN)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.BurstSpeedMin = (float)tempf;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_SPEED_MAX)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.BurstSpeedMax = (float)tempf;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_MAX_AGE)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.MaxAge = (float)tempf;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_TARGET_KEY)
                    {
                        UUID key = UUID.Zero;
                        if (UUID.TryParse(rules.Data[i + 1].ToString(), out key))
                        {
                            prules.Target = key;
                        }
                        else
                        {
                            prules.Target = part.UUID;
                        }
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_OMEGA)
                    {
                        // AL: This is an assumption, since it is the only thing that would match.
                        tempv = rules.GetVector3Item(i + 1);
                        prules.AngularVelocity.X = (float)tempv.x;
                        prules.AngularVelocity.Y = (float)tempv.y;
                        prules.AngularVelocity.Z = (float)tempv.z;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.InnerAngle = (float)tempf;
                        prules.PartFlags |= 0x02; // Set new angle format.
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_ANGLE_END)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.OuterAngle = (float)tempf;
                        prules.PartFlags |= 0x02; // Set new angle format.
                    }
                }
                prules.CRC = 1;

                part.AddNewParticleSystem(prules);
                part.ParentGroup.HasGroupChanged = true;
            }
            part.ScheduleUpdate(PrimUpdateFlags.Particles);
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:101,代码来源:LSL_Api.cs

示例4: SetFlexi

        /// <summary>
        /// Set flexi parameters of a part.
        ///
        /// FIXME: Much of this code should probably be within the part itself.
        /// </summary>
        /// <param name="part"></param>
        /// <param name="flexi"></param>
        /// <param name="softness"></param>
        /// <param name="gravity"></param>
        /// <param name="friction"></param>
        /// <param name="wind"></param>
        /// <param name="tension"></param>
        /// <param name="Force"></param>
        protected void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction,
            float wind, float tension, LSL_Vector Force)
        {
            if (part == null)
                return;

            if (flexi)
            {
                part.Shape.PathCurve |= (byte)Extrusion.Flexible;
                part.Shape.FlexiEntry = true;   // this setting flexi true isn't working, but the below parameters do
                // work once the prim is already flexi
                part.Shape.FlexiSoftness = softness;
                part.Shape.FlexiGravity = gravity;
                part.Shape.FlexiDrag = friction;
                part.Shape.FlexiWind = wind;
                part.Shape.FlexiTension = tension;
                part.Shape.FlexiForceX = (float)Force.x;
                part.Shape.FlexiForceY = (float)Force.y;
                part.Shape.FlexiForceZ = (float)Force.z;
                part.Shape.PathCurve = 0x80;
            }
            else
            {
                int curve = part.Shape.PathCurve;
                curve &= (int)(~(Extrusion.Flexible));
                part.Shape.PathCurve = (byte)curve;
                part.Shape.FlexiEntry = false;
            }


            part.ParentGroup.HasGroupChanged = true;
            part.ScheduleUpdate(PrimUpdateFlags.FullUpdate);
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:46,代码来源:LSL_Api.cs

示例5: SetPointLight

        /// <summary>
        /// Set a light point on a part
        /// </summary>
        /// FIXME: Much of this code should probably be in SceneObjectGroup
        ///
        /// <param name="part"></param>
        /// <param name="light"></param>
        /// <param name="color"></param>
        /// <param name="intensity"></param>
        /// <param name="radius"></param>
        /// <param name="falloff"></param>
        protected void SetPointLight(SceneObjectPart part, bool light, LSL_Vector color, float intensity, float radius, float falloff)
        {
            if (part == null)
                return;

            if (light)
            {
                part.Shape.LightEntry = true;
                part.Shape.LightColorR = Util.Clip((float)color.x, 0.0f, 1.0f);
                part.Shape.LightColorG = Util.Clip((float)color.y, 0.0f, 1.0f);
                part.Shape.LightColorB = Util.Clip((float)color.z, 0.0f, 1.0f);
                part.Shape.LightIntensity = intensity;
                part.Shape.LightRadius = radius;
                part.Shape.LightFalloff = falloff;
            }
            else
            {
                part.Shape.LightEntry = false;
            }

            part.ParentGroup.HasGroupChanged = true;
            part.ScheduleUpdate(PrimUpdateFlags.FindBest);
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:34,代码来源:LSL_Api.cs

示例6: SetAlpha

 protected void SetAlpha(SceneObjectPart part, double alpha, int face)
 {
     Primitive.TextureEntry tex = part.Shape.Textures;
     Color4 texcolor;
     if (face >= 0 && face < GetNumberOfSides(part))
     {
         texcolor = tex.CreateFace((uint)face).RGBA;
         texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
         tex.FaceTextures[face].RGBA = texcolor;
         part.UpdateTexture(tex);
     }
     else if (face == ScriptBaseClass.ALL_SIDES)
     {
         for (int i = 0; i < GetNumberOfSides(part); i++)
         {
             if (tex.FaceTextures[i] != null)
             {
                 texcolor = tex.FaceTextures[i].RGBA;
                 texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
                 tex.FaceTextures[i].RGBA = texcolor;
             }
         }
         texcolor = tex.DefaultTexture.RGBA;
         texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
         tex.DefaultTexture.RGBA = texcolor;
         part.UpdateTexture(tex);
     }
     part.ScheduleUpdate(PrimUpdateFlags.FullUpdate);
 }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:29,代码来源:LSL_Api.cs

示例7: SetScale

        protected void SetScale(SceneObjectPart part, LSL_Vector scale)
        {
            if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
                return;

            IOpenRegionSettingsModule WSModule = m_host.ParentGroup.Scene.RequestModuleInterface<IOpenRegionSettingsModule>();
            if (WSModule != null)
            {
                if (WSModule.MinimumPrimScale != -1)
                {
                    if (scale.x < WSModule.MinimumPrimScale)
                        scale.x = WSModule.MinimumPrimScale;
                    if (scale.y < WSModule.MinimumPrimScale)
                        scale.y = WSModule.MinimumPrimScale;
                    if (scale.z < WSModule.MinimumPrimScale)
                        scale.z = WSModule.MinimumPrimScale;
                }

                if (part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical &&
                    WSModule.MaximumPhysPrimScale != -1)
                {
                    if (scale.x > WSModule.MaximumPhysPrimScale)
                        scale.x = WSModule.MaximumPhysPrimScale;
                    if (scale.y > WSModule.MaximumPhysPrimScale)
                        scale.y = WSModule.MaximumPhysPrimScale;
                    if (scale.z > WSModule.MaximumPhysPrimScale)
                        scale.z = WSModule.MaximumPhysPrimScale;
                }

                if (WSModule.MaximumPrimScale != -1)
                {
                    if (scale.x > WSModule.MaximumPrimScale)
                        scale.x = WSModule.MaximumPrimScale;
                    if (scale.y > WSModule.MaximumPrimScale)
                        scale.y = WSModule.MaximumPrimScale;
                    if (scale.z > WSModule.MaximumPrimScale)
                        scale.z = WSModule.MaximumPrimScale;
                }
            }

            Vector3 tmp = part.Scale;
            tmp.X = (float)scale.x;
            tmp.Y = (float)scale.y;
            tmp.Z = (float)scale.z;
            part.Scale = tmp;
            part.ScheduleUpdate(PrimUpdateFlags.FindBest);
            part.ParentGroup.HasGroupChanged = true;
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:48,代码来源:LSL_Api.cs

示例8: PlaybackState

        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));
            }
        }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:61,代码来源:UndoState.cs

示例9: SetMediaEntry

 public void SetMediaEntry(SceneObjectPart part, int face, MediaEntry me)
 {
     CheckFaceParam(part, face);
     
     if (null == part.Shape.Media)
         part.Shape.Media = new PrimitiveBaseShape.MediaList(new MediaEntry[part.GetNumberOfSides()]);
         
     lock (part.Shape.Media)
         part.Shape.Media[face] = me;
     
     UpdateMediaUrl(part, UUID.Zero);
     part.ScheduleUpdate(PrimUpdateFlags.FullUpdate);
     part.TriggerScriptChangedEvent(Changed.MEDIA);
 }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:14,代码来源:MoapModule.cs

示例10: PlayfwdState

        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;
            }
        }
开发者ID:RevolutionSmythe,项目名称:Aurora-Sim,代码行数:58,代码来源:UndoState.cs


注:本文中的OpenSim.Region.Framework.Scenes.SceneObjectPart.ScheduleUpdate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。