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


C# ISceneChildEntity.UpdateRotation方法代码示例

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


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

示例1: SetRot

        protected void SetRot(ISceneChildEntity part, Quaternion rot)
        {
            part.UpdateRotation(rot);
            // Update rotation does not move the object in the physics scene if it's a linkset.

            //KF:  Do NOT use this next line if using ODE physics engine.
            //   This need a switch based on .ini Phys Engine type
            //part.ParentGroup.ResetChildPrimPhysicsPositions()
            
            // So, after thinking about this for a bit, the issue with the part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition line
            // is it isn't compatible with vehicles because it causes the vehicle body to have to be broken down and rebuilt
            // It's perfectly okay when the object is not an active physical body though.
            // So, part.ParentGroup.ResetChildPrimPhysicsPositions(); does the thing that Kitto is warning against
            // but only if the object is not physial and active.   This is important for rotating doors.
            // without the absoluteposition = absoluteposition happening, the doors do not move in the physics
            // scene
            if (part.PhysActor != null && !part.PhysActor.IsPhysical)
            {
                part.ParentEntity.ResetChildPrimPhysicsPositions ();
            }
        }
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:21,代码来源:LSL_Api.cs

示例2: PlayfwdState

        public void PlayfwdState(ISceneChildEntity part)
        {
            if (part != null)
            {
                bool ChangedScale = false;
                bool ChangedRot = false;
                bool ChangedPos = false;
                part.Undoing = true;

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

                    foreach (
                        ISceneChildEntity child in
                            part.ParentEntity.ChildrenEntities().Where(child => 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.ParentEntity.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:QueenStarfinder,项目名称:WhiteCore-Dev,代码行数:59,代码来源:UndoState.cs

示例3: PlaybackState

        public void PlaybackState (ISceneChildEntity part)
        {
            if (part != null) {
                part.Undoing = true;

                bool ChangedScale = false;
                bool ChangedPos = false;

                if (part.UUID == part.ParentEntity.UUID) {
                    if (Position != Vector3.Zero) {
                        ChangedPos = true;
                        part.ParentEntity.AbsolutePosition = Position;
                    }
                    part.SetRotationOffset (true, Rotation, true);
                    if (Scale != Vector3.Zero) {
                        ChangedScale = true;
                        part.Scale = Scale;
                    }

                    foreach (
                        ISceneChildEntity child in
                            part.ParentEntity.ChildrenEntities ().Where (child => child.UUID != part.UUID)) {
                        child.Undo (); //No updates here, child undo will do it on their own
                    }
                } else {
                    if (Position != Vector3.Zero) {
                        ChangedPos = true;
                        part.FixOffsetPosition (Position, false);
                    }
                    part.UpdateRotation (Rotation);
                    if (Scale != Vector3.Zero) {
                        ChangedScale = true;
                        part.Resize (Scale);
                    }
                }
                part.Undoing = false;
                var updateFlags =
                    (ChangedScale ? PrimUpdateFlags.Shape : PrimUpdateFlags.None) |
                    (ChangedPos ? PrimUpdateFlags.Position : PrimUpdateFlags.None) |
                    PrimUpdateFlags.Rotation;

                part.ScheduleUpdate (updateFlags);
            }
        }
开发者ID:EnricoNirvana,项目名称:WhiteCore-Dev,代码行数:44,代码来源:UndoState.cs


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