本文整理汇总了C#中System.Vector3.LSDistance方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.LSDistance方法的具体用法?C# Vector3.LSDistance怎么用?C# Vector3.LSDistance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Vector3
的用法示例。
在下文中一共展示了Vector3.LSDistance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: CountEnemiesInRangeDeley
private static int CountEnemiesInRangeDeley(Vector3 position, float range, float delay)
{
return Program.Enemies.Where(t => t.LSIsValidTarget()).Select(t => Prediction.GetPrediction(t, delay).CastPosition).Count(prepos => position.LSDistance(prepos) < range);
}
示例3: ClosestWall
public static Vector3 ClosestWall(Vector3 StartPos, Vector3 EndPos)
{
var distance = StartPos.LSDistance(EndPos);
for (int i = 1; i < 8; i++)
{
if (StartPos.LSExtend(EndPos, distance + 55 * i).LSIsWall())
{
return StartPos.LSExtend(EndPos, distance + 55 * i);
}
}
return EndPos;
}
示例4: CheckWalls
public static bool CheckWalls(Vector3 player, Vector3 enemy)
{
var distance = player.LSDistance(enemy);
for (var i = 1; i < 6; i++)
{
if (player.LSExtend(enemy, distance + 55*i).IsWall())
{
return true;
}
}
return false;
}
示例5: CheckWalls
public static bool CheckWalls(Vector3 from, Vector3 to)
{
var steps = 6f;
var stepLength = from.LSDistance(to)/steps;
for (var i = 1; i < steps + 1; i++)
{
if (from.Extend(to, stepLength*i).IsWall())
{
return true;
}
}
return false;
}
示例6: CastE
private void CastE(Vector3 target)
{
if (target.LSDistance(player.Position) > eRanges[E.Level - 1])
{
return;
}
if (E.IsCharging)
{
if (target.LSDistance(player.Position) < E.Range)
{
E.Cast(target, getCheckBoxItem(config, "packets"));
}
}
else if (target.LSDistance(player.Position) < eRanges[E.Level - 1])
{
E.SetCharged("ZacE", "ZacE", 295, eRanges[E.Level - 1], eChannelTimes[E.Level - 1]);
E.StartCharging(target);
}
}
示例7: IsTurretPosition
static bool IsTurretPosition(Vector3 pos)
{
float mindistance = 2000;
foreach (int NetID in AllEnemyTurret)
{
Obj_AI_Turret turret = ObjectManager.GetUnitByNetworkId<Obj_AI_Turret>((uint)NetID);
if (turret != null && !turret.IsDead && !TurretHasAggro[NetID])
{
float distance = pos.LSDistance(turret.Position);
if (mindistance >= distance)
{
mindistance = distance;
}
}
}
return mindistance <= 950;
}
示例8: Contains
public bool Contains(Vector3 position)
{
return position.LSDistance(From) <= player.BoundingRadius;
}
示例9: IsWallBetween
public static bool IsWallBetween(Vector3 start, Vector3 end, int step = 3)
{
if (start.IsValid() && end.IsValid() && step > 0)
{
var distance = start.LSDistance(end);
for (var i = 0; i < distance; i = i + step)
{
if (NavMesh.GetCollisionFlags(start.LSExtend(end, i)) == CollisionFlags.Wall)
{
return true;
}
}
}
return false;
}
示例10: Qhit
private bool Qhit(Vector3 target)
{
return Q.IsReady() && CombatHelper.IsFacing(player, target, 80) &&
target.LSDistance(player.Position) < Q.Range;
}
示例11: kill
private void kill(Positions positions, Vector3 pos)
{
if (R.IsReady() && pos.LSDistance(positions.Player.Position) < 1200 &&
ObjectManager.Get<AIHeroClient>()
.Count(o => o.IsAlly && o.LSDistance(pos) < config["Alliesrange"].Cast<Slider>().CurrentValue) <
1)
{
if (checkdmg(positions.Player, pos) && UltTime(pos) < positions.RecallData.GetRecallTime() &&
!isColliding(pos))
{
if (player.ChampionName == "Xerath")
{
xerathUlt(positions, pos);
}
R.Cast(pos);
if (player.ChampionName == "Draven" && config["CallBack"].Cast<CheckBox>().CurrentValue)
{
LeagueSharp.Common.Utility.DelayAction.Add((int) (UltTime(pos) - 300), () => R.Cast());
}
}
}
}
示例12: CheckQusage
private static bool CheckQusage(Vector3 pos, AIHeroClient target)
{
return pos.IsValid() && pos.LSDistance(player.Position) < Q.Range &&
(target.HasBuff("fiorapassivemanager") || target.HasBuff("fiorarmark")) && !pos.IsWall() &&
Qradius > pos.LSDistance(target.Position);
}
示例13: GetPolyFromVector
public static Geometry.Polygon GetPolyFromVector(Vector3 from, Vector3 to, float width)
{
var POS = to.Extend(from, from.LSDistance(to));
var direction = (POS - to.LSTo2D()).Normalized();
var pos1 = (to.LSTo2D() - direction.Perpendicular()*width/2f).To3D();
var pos2 =
(POS + (POS - to.LSTo2D()).Normalized() + direction.Perpendicular()*width/2f).To3D();
var pos3 = (to.LSTo2D() + direction.Perpendicular()*width/2f).To3D();
var pos4 =
(POS + (POS - to.LSTo2D()).Normalized() - direction.Perpendicular()*width/2f).To3D();
var poly = new Geometry.Polygon();
poly.Add(pos1);
poly.Add(pos3);
poly.Add(pos2);
poly.Add(pos4);
return poly;
}
示例14: AimQ
private static List<Vector3> AimQ(Vector3 finalPos)
{
var CircleLineSegmentN = 36;
var radius = 500;
var position = Player.Position;
var points = new List<Vector3>();
for (var i = 1; i <= CircleLineSegmentN; i++)
{
var angle = i*2*Math.PI/CircleLineSegmentN;
var point = new Vector3(position.X + radius*(float) Math.Cos(angle),
position.Y + radius*(float) Math.Sin(angle), position.Z);
if (point.LSDistance(Player.Position.LSExtend(finalPos, radius)) < 430)
{
points.Add(point);
//Utility.DrawCircle(point, 20, System.Drawing.Color.Aqua, 1, 1);
}
}
var point2 = points.OrderBy(x => x.LSDistance(finalPos));
points = point2.ToList();
points.RemoveAt(0);
points.RemoveAt(1);
return points;
}
示例15: 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;
}