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


C# Vector2.Perpendicular方法代码示例

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


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

示例1: Rectangle

 public Rectangle(Vector2 start, Vector2 end, float width)
 {
     RStart = start;
     REnd = end;
     Width = width;
     Direction = (end - start).Normalized();
     Perpendicular = Direction.Perpendicular();
 }
开发者ID:Xelamats,项目名称:PortAIO,代码行数:8,代码来源:Geometry.cs

示例2: OnSpellHitDetected

        public void OnSpellHitDetected(Vector2 direction, Obj_AI_Base target)
        {
            EvadeData edata;

            Vector2 evade_direction = direction.Perpendicular();
            Vector2 evade_pos = ObjectManager.Player.ServerPosition.To2D() + evade_direction * EvadeSpell.Range;

            bool position_needed = SpecialMethod.HasFlag(EvadeMethods.Dash) || SpecialMethod.HasFlag(EvadeMethods.Blink);

            if (position_needed)
            {
                switch (evade.Item("EVADEMETHOD").GetValue<StringList>().SelectedIndex)
                {
                    case 0: //near turret
                        CorrectNearTurret(ref evade_pos, evade_direction);
                        break;

                    case 1: //less enemies
                        CorrectLessEnemies(ref evade_pos, evade_direction);
                        break;

                    case 2: //both
                        if (!CorrectLessEnemies(ref evade_pos, evade_direction))
                            CorrectNearTurret(ref evade_pos, evade_direction);
                        break;
                }
            }

            edata = new EvadeData
                (evade_pos,
                ObjectManager.Player.CharData.BaseSkinName == "Morgana" || ObjectManager.Player.CharData.BaseSkinName == "Lissandra",
                ObjectManager.Player.CharData.BaseSkinName == "Sivir" || ObjectManager.Player.CharData.BaseSkinName == "Nocturne" || ObjectManager.Player.CharData.BaseSkinName == "Vladimir",
                target);

            m_evade_queue.Enqueue(edata);
        }
开发者ID:xQxCPMxQx,项目名称:Leaguesharp-7,代码行数:36,代码来源:Evader.cs

示例3: OnSpellHitDetected

        public void OnSpellHitDetected(Vector2 direction, Obj_AI_Base target)
        {
            EvadeData edata;

            Vector2 evade_direction = direction.Perpendicular();
            Vector2 evade_pos = ObjectManager.Player.ServerPosition.To2D() + direction.Perpendicular() * EvadeSpell.Range;

            bool position_needed = !(SpecialMethod.HasFlag(EvadeMethods.MorganaE) || SpecialMethod.HasFlag(EvadeMethods.LissandraR) || SpecialMethod.HasFlag(EvadeMethods.KayleR) || SpecialMethod.HasFlag(EvadeMethods.SivirE) || SpecialMethod.HasFlag(EvadeMethods.NocturneW) || SpecialMethod.HasFlag(EvadeMethods.VladimirW));

            if (position_needed)
            {
                switch (evade.Item("EVADEMETHOD").GetValue<StringList>().SelectedIndex)
                {
                    case 0: //near turret
                        CorrectNearTurret(ref evade_pos, evade_direction.Perpendicular());
                        break;

                    case 1: //less enemies
                        CorrectLessEnemies(ref evade_pos, evade_direction.Perpendicular());
                        break;

                    case 2: //both
                        if (!CorrectLessEnemies(ref evade_pos, evade_direction.Perpendicular()))
                            CorrectNearTurret(ref evade_pos, evade_direction.Perpendicular());
                        break;
                }
            }

            edata = new EvadeData
                (evade_pos,
                SpecialMethod.HasFlag(EvadeMethods.MorganaE) || SpecialMethod.HasFlag(EvadeMethods.LissandraR) || SpecialMethod.HasFlag(EvadeMethods.KayleR),
                SpecialMethod.HasFlag(EvadeMethods.SivirE) || SpecialMethod.HasFlag(EvadeMethods.NocturneW) || SpecialMethod.HasFlag(EvadeMethods.VladimirW),
                target);

            m_evade_queue.Enqueue(edata);
        }
开发者ID:47110572,项目名称:LeagueSharp,代码行数:36,代码来源:Evader.cs

示例4: Line

 public Line(Vector2 start, Vector2 direction)
 {
     Start = start;
     Normal = direction.Normal;
     _perpendicular = direction.Perpendicular();
 }
开发者ID:rho24,项目名称:Golf,代码行数:6,代码来源:LineBarrier.cs


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