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


C# Vector3.LSTo2D方法代码示例

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


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

示例1: bestVectorToAoeSpell

            public static Vector3 bestVectorToAoeSpell(IEnumerable<AIHeroClient> heroes,
                float spellrange,
                float spellwidth)
            {
                var bestPos = new Vector3();
                var hits = 0;
                foreach (var hero in heroes)
                {
                    if (countChampsAtrange(hero.Position, spellwidth) > hits)
                    {
                        bestPos = hero.Position;
                        hits = countChampsAtrange(hero.Position, spellwidth);
                    }
                    var newPos = new Vector3(hero.Position.X + 80, hero.Position.Y + 80, hero.Position.Z);
                    for (var i = 1; i < 4; i++)
                    {
                        var rotated = newPos.LSTo2D().RotateAroundPoint(newPos.LSTo2D(), 90*i).To3D();
                        if (countChampsAtrange(rotated, spellwidth) > hits && player.LSDistance(rotated) <= spellrange)
                        {
                            bestPos = newPos;
                            hits = countChampsAtrange(rotated, spellwidth);
                        }
                    }
                }

                return bestPos;
            }
开发者ID:CONANLXF,项目名称:AIO,代码行数:27,代码来源:Environment.cs

示例2: Jump

        public static void Jump(Vector3 pos, bool juke = false, bool castq = true)
        {
            if (Math.Abs(Program._e.Cooldown) < 0.00001)
            {
                var extended = ObjectManager.Player.ServerPosition.LSTo2D().LSExtend(pos.LSTo2D(), 800f);
                if (!JumpTo.IsValid())
                    JumpTo = pos.LSTo2D();

                if (Program._w.IsReady() && SoldierMgr.ActiveSoldiers.Count == 0)
                {
                    if (juke)
                    {
                        var outRadius = 250 / (float)Math.Cos(2 * Math.PI / 12);

                        for (var i = 1; i <= 12; i++)
                        {
                            var angle = i * 2 * Math.PI / 12;
                            var x = ObjectManager.Player.Position.X + outRadius * (float)Math.Cos(angle);
                            var y = ObjectManager.Player.Position.Y + outRadius * (float)Math.Sin(angle);
                            if (NavMesh.GetCollisionFlags(x, y).HasFlag(CollisionFlags.Wall) && !ObjectManager.Player.ServerPosition.LSTo2D().LSExtend(new Vector2(x, y), 500f).LSIsWall())
                            {
                                Program._w.Cast(ObjectManager.Player.ServerPosition.LSTo2D().LSExtend(new Vector2(x, y), 800f));
                                return;
                            }
                        }
                    }
                    Program._w.Cast(extended);
                }

                if (SoldierMgr.ActiveSoldiers.Count > 0 && Program._q.IsReady())
                {
                    var closestSoldier = SoldierMgr.ActiveSoldiers.MinOrDefault(s => s.Position.LSTo2D().LSDistance(extended, true));
                    CastELocation = closestSoldier.Position.LSTo2D();
                    CastQLocation = closestSoldier.Position.LSTo2D().LSExtend(JumpTo, 800f);

                    if (CastELocation.LSDistance(JumpTo) > ObjectManager.Player.ServerPosition.LSTo2D().LSDistance(JumpTo) && !juke && castq)
                    {
                        CastQLocation = extended;
                        CastET = Utils.TickCount + 250;
                        Program._q.Cast(CastQLocation);
                    }
                    else
                    {
                        Program._e.Cast(CastELocation, true);
                        if (ObjectManager.Player.ServerPosition.LSTo2D().LSDistance(CastELocation) < 700 && castq)
                            LeagueSharp.Common.Utility.DelayAction.Add(250, () => Program._q.Cast(CastQLocation, true));
                    }
                }
            }
            else
            {
                if (Program._q.IsReady() && CastELocation.LSDistance(ObjectManager.Player.ServerPosition) <= 200 && castq)
                    Program._q.Cast(CastQLocation, true);

                JumpTo = Vector2.Zero;
            }
        }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:57,代码来源:JumpToMouse.cs

示例3: GetCastMinionsPredictedPositions

        public static List<Vector2> GetCastMinionsPredictedPositions(List<Obj_AI_Base> minions,
            float delay,
            float width,
            float speed,
            Vector3 from,
            float range,
            bool collision,
            SkillshotType stype,
            Vector3 rangeCheckFrom = new Vector3())
        {
            var result = new List<Vector2>();
            from = from.LSTo2D().IsValid() ? from : ObjectManager.Player.ServerPosition;
            foreach (var minion in minions)
            {
                var pos = Prediction.GetPrediction(new PredictionInput
                {
                    Unit = minion,
                    Delay = delay,
                    Radius = width,
                    Speed = speed,
                    From = from,
                    Range = range,
                    Collision = collision,
                    Type = stype,
                    RangeCheckFrom = rangeCheckFrom
                });

                if (pos.Hitchance >= HitChance.High)
                {
                    result.Add(pos.CastPosition.LSTo2D());
                }
            }

            return result;
        }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:35,代码来源:YasMath.cs

示例4: CollidesWithWall

        /// <summary>
        ///     Collideses the with wall.
        /// </summary>
        /// <param name="start">The start.</param>
        /// <param name="end">The end.</param>
        /// <returns></returns>
        internal static bool CollidesWithWall(Vector3 start, Vector3 end)
        {
            if (Environment.TickCount - _wallCastT > 4000)
            {
                return false;
            }

            GameObject wall = null;
            foreach (var gameObject in
                ObjectManager.Get<GameObject>()
                    .Where(
                        gameObject =>
                            gameObject.IsValid &&
                            Regex.IsMatch(
                                gameObject.Name, "_w_windwall_enemy_0.\\.troy", RegexOptions.IgnoreCase))
                )
            {
                wall = gameObject;
            }
            if (wall == null)
            {
                return false;
            }
            var level = wall.Name.Substring(wall.Name.Length - 6, 1);
            var wallWidth = 300 + 50*Convert.ToInt32(level);

            var wallDirection =
                (wall.Position.LSTo2D() - _yasuoWallCastedPos).Normalized().Perpendicular();
            var wallStart = wall.Position.LSTo2D() + wallWidth/2f*wallDirection;
            var wallEnd = wallStart - wallWidth*wallDirection;

            for (var i = 0; i < start.LSDistance(end); i += 30)
            {
                var currentPosition = start.LSExtend(end, i);
                if (wallStart.Intersection(wallEnd, currentPosition.LSTo2D(), start.LSTo2D()).Intersects)
                {
                    return true;
                }
            }

            return false;
        }
开发者ID:yMeliodasNTD,项目名称:PortAIO,代码行数:48,代码来源:YasuoWall.cs

示例5: Arc

 /// <summary>
 ///     Initializes a new instance of the <see cref="Polygon.Arc" /> class.
 /// </summary>
 /// <param name="start">The start.</param>
 /// <param name="direction">The direction.</param>
 /// <param name="angle">The angle.</param>
 /// <param name="radius">The radius.</param>
 /// <param name="quality">The quality.</param>
 public Arc(Vector3 start, Vector3 direction, float angle, float radius, int quality = 20)
     : this(start.LSTo2D(), direction.LSTo2D(), angle, radius, quality)
 {
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:12,代码来源:Geometry.cs

示例6: IsInside

 /// <summary>
 ///     Determines whether the specified point is inside.
 /// </summary>
 /// <param name="point">The point.</param>
 /// <returns></returns>
 public bool IsInside(Vector3 point)
 {
     return !IsOutside(point.LSTo2D());
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:9,代码来源:Geometry.cs

示例7: DrawLineRectangle

        public static void DrawLineRectangle(Vector3 start2, Vector3 end2, int radius, float width, Color color)
        {
            var start = start2.LSTo2D();
            var end = end2.LSTo2D();
            var dir = (end - start).Normalized();
            var pDir = dir.Perpendicular();

            var rightStartPos = start + pDir*radius;
            var leftStartPos = start - pDir*radius;
            var rightEndPos = end + pDir*radius;
            var leftEndPos = end - pDir*radius;

            var rStartPos =
                Drawing.WorldToScreen(new Vector3(rightStartPos.X, rightStartPos.Y, ObjectManager.Player.Position.Z));
            var lStartPos =
                Drawing.WorldToScreen(new Vector3(leftStartPos.X, leftStartPos.Y, ObjectManager.Player.Position.Z));
            var rEndPos =
                Drawing.WorldToScreen(new Vector3(rightEndPos.X, rightEndPos.Y, ObjectManager.Player.Position.Z));
            var lEndPos = Drawing.WorldToScreen(new Vector3(leftEndPos.X, leftEndPos.Y, ObjectManager.Player.Position.Z));

            Drawing.DrawLine(rStartPos, rEndPos, width, color);
            Drawing.DrawLine(lStartPos, lEndPos, width, color);
            Drawing.DrawLine(rStartPos, lStartPos, width, color);
            Drawing.DrawLine(lEndPos, rEndPos, width, color);
        }
开发者ID:CONANLXF,项目名称:AIO,代码行数:25,代码来源:OktwCommon.cs

示例8: ELDistance

 /// <summary>
 ///     Calculates the distance to the Vector3.
 /// </summary>
 /// <param name="v">The v.</param>
 /// <param name="to">To.</param>
 /// <param name="squared">if set to <c>true</c> gets the distance squared.</param>
 /// <returns></returns>
 public static float ELDistance(this Vector2 v, Vector3 to, bool squared = false)
 {
     return v.LSDistance(to.LSTo2D(), squared);
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:11,代码来源:Geometry.cs

示例9: Sector

 /// <summary>
 ///     Initializes a new instance of the <see cref="Polygon.Sector" /> class.
 /// </summary>
 /// <param name="center">The center.</param>
 /// <param name="direction">The direction.</param>
 /// <param name="angle">The angle.</param>
 /// <param name="radius">The radius.</param>
 /// <param name="quality">The quality.</param>
 public Sector(Vector3 center, Vector3 direction, float angle, float radius, int quality = 20)
     : this(center.LSTo2D(), direction.LSTo2D(), angle, radius, quality)
 {
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:12,代码来源:Geometry.cs

示例10: Rectangle

 /// <summary>
 ///     Initializes a new instance of the <see cref="Rectangle" /> class.
 /// </summary>
 /// <param name="start">The start.</param>
 /// <param name="end">The end.</param>
 /// <param name="width">The width.</param>
 public Rectangle(Vector3 start, Vector3 end, float width)
     : this(start.LSTo2D(), end.LSTo2D(), width)
 {
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:10,代码来源:Geometry.cs

示例11: GetAngle

        internal static double GetAngle(Vector3 from, Obj_AI_Base target)
        {
            var C = target.ServerPosition.LSTo2D();
            var A = target.GetWaypoints().Last();

            if (C == A)
                return 60;

            var B = from.LSTo2D();

            var AB = Math.Pow((double)A.X - (double)B.X, 2) + Math.Pow((double)A.Y - (double)B.Y, 2);
            var BC = Math.Pow((double)B.X - (double)C.X, 2) + Math.Pow((double)B.Y - (double)C.Y, 2);
            var AC = Math.Pow((double)A.X - (double)C.X, 2) + Math.Pow((double)A.Y - (double)C.Y, 2);

            return Math.Cos((AB + BC - AC) / (2 * Math.Sqrt(AB) * Math.Sqrt(BC))) * 180 / Math.PI;
        }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:16,代码来源:PredictionOktw.cs

示例12: goesThroughWall

        public static bool goesThroughWall(Vector3 vec1, Vector3 vec2)
        {
            if (wall.endtime < Game.Time || wall.pointL == null || wall.pointL == null)
                return false;
            Vector2 inter = YasMath.LineIntersectionPoint(vec1.LSTo2D(), vec2.LSTo2D(), wall.pointL.Position.LSTo2D(), wall.pointR.Position.LSTo2D());
            float wallW = (300 + 50 * W.Level);
            if (wall.pointL.Position.LSTo2D().LSDistance(inter) > wallW ||
                wall.pointR.Position.LSTo2D().LSDistance(inter) > wallW)
                return false;
            var dist = vec1.LSDistance(vec2);
            if (vec1.LSTo2D().LSDistance(inter) + vec2.LSTo2D().LSDistance(inter) - 30 > dist)
                return false;

            return true;
        }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:15,代码来源:Yasuo.cs

示例13: IsPassWall

        /// <summary>
        ///     TODO The is pass wall.
        /// </summary>
        /// <param name="start">
        ///     TODO The start.
        /// </param>
        /// <param name="end">
        ///     TODO The end.
        /// </param>
        /// <returns>
        /// </returns>
        private static bool IsPassWall(Vector3 start, Vector3 end)
        {
            double count = Vector3.Distance(start, end);
            for (uint i = 0; i <= count; i += 25)
            {
                var pos = start.LSTo2D().LSExtend(Player.ServerPosition.LSTo2D(), -i);
                if (pos.IsWall())
                {
                    return true;
                }
            }

            return false;
        }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:25,代码来源:Zed.cs

示例14: MoveTo

        private static void MoveTo(Vector3 position)
        {
            var delay = getSliderItem(menuMisc, "orb_Misc_Humanizer");
            if (Environment.TickCount - _lastMovement < delay)
                return;
            _lastMovement = Environment.TickCount;

            var holdAreaRadius = getSliderItem(menuMisc, "orb_Misc_Holdzone");
            if (MyHero.ServerPosition.LSDistance(position) < holdAreaRadius)
            {
                if (MyHero.Path.Count() > 1)
                    Player.IssueOrder(GameObjectOrder.Stop, MyHero.Position);
                return;
            }
            var point = MyHero.ServerPosition +
            300 * (position.LSTo2D() - MyHero.ServerPosition.LSTo2D()).LSNormalized().To3D();
            Player.IssueOrder(GameObjectOrder.MoveTo, point);
        }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:18,代码来源:Orbwalker.cs

示例15: InCone

        private static bool InCone(Vector3 Position)
        {
            var range = R.Range;
            var angle = 70f * (float)Math.PI / 180;
            var end2 = rPosCast.LSTo2D() - Player.Position.LSTo2D();
            var edge1 = end2.LSRotated(-angle / 2);
            var edge2 = edge1.LSRotated(angle);

            var point = Position.LSTo2D() - Player.Position.LSTo2D();
            if (point.LSDistance(new Vector2(), true) < range * range && edge1.LSCrossProduct(point) > 0 && point.LSCrossProduct(edge2) > 0)
                return true;

            return false;
        }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:14,代码来源:Jhin.cs


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