本文整理汇总了C#中Vector3.To2D方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.To2D方法的具体用法?C# Vector3.To2D怎么用?C# Vector3.To2D使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3
的用法示例。
在下文中一共展示了Vector3.To2D方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExtendVector3
//Copied from Fluxy's YasouBuddy - He is a god and so is his yasou addon.
public static Vector3 ExtendVector3(this Vector3 vector, Vector3 direction, float distance)
{
if (vector.To2D().Distance(direction.To2D()) == 0)
{
return vector;
}
var edge = direction.To2D() - vector.To2D();
edge.Normalize();
var v = vector.To2D() + edge * distance;
return new Vector3(v.X, v.Y, vector.Z);
}
示例2: IsSafe
public static bool IsSafe(Vector3 Position)
{
if((Position.UnderTurret(true) && !ObjectManager.Player.UnderTurret(true)) || (PositioningVariables.EnemiesClose.Count() > 1 && iSRGeometry.GetEnemyPoints().Contains(Position.To2D())))
{
return false;
}
return true;
}
示例3: GetMinionsPredictedPositions
public static List<Vector2> GetMinionsPredictedPositions(List<Obj_AI_Base> minions,
float delay,
float width,
float speed,
Vector3 from,
float range,
bool collision,
SkillshotType stype,
Vector3 rangeCheckFrom = new Vector3())
{
from = from.To2D().IsValid() ? from : ObjectManager.Player.ServerPosition;
return (from minion in minions
select
Prediction.GetPrediction(
new PredictionInput
{
Unit = minion,
Delay = delay,
Radius = width,
Speed = speed,
From = @from,
Range = range,
Collision = collision,
Type = stype,
RangeCheckFrom = rangeCheckFrom
})
into pos
where pos.Hitchance >= HitChance.High
select pos.UnitPosition.To2D()).ToList();
}
示例4: Distance
internal static float Distance(this Obj_AI_Base unit, Vector3 point, bool squared = false)
{
return unit.ServerPosition.To2D().Distance(point.To2D(), squared);
}
示例5: CheckQCollision
private static bool CheckQCollision(Obj_AI_Base target, Vector3 targetPosition, Vector3 castPosition)
{
var direction = (castPosition.To2D() - ObjectManager.Player.ServerPosition.To2D()).Normalized();
var firstBouncePosition = castPosition.To2D();
var secondBouncePosition = firstBouncePosition +
direction * 0.4f *
ObjectManager.Player.ServerPosition.To2D().Distance(firstBouncePosition);
var thirdBouncePosition = secondBouncePosition +
direction * 0.6f * firstBouncePosition.Distance(secondBouncePosition);
//TODO: WALL COLL
if (thirdBouncePosition.Distance(targetPosition.To2D()) < SpellManager.Q1.Width + target.BoundingRadius)
{
var minion = EntityManager.MinionsAndMonsters.EnemyMinions.FirstOrDefault(m => m.IsValidTarget(2000));
if (minion != null)
{
var predictedPos = SpellManager.Q2.GetPrediction(minion);
if (predictedPos.UnitPosition.To2D().Distance(secondBouncePosition) <
SpellManager.Q2.Width + minion.BoundingRadius)
{
return true;
}
}
}
if (!(secondBouncePosition.Distance(targetPosition.To2D()) < SpellManager.Q1.Width + target.BoundingRadius) &&
!(thirdBouncePosition.Distance(targetPosition.To2D()) < SpellManager.Q1.Width + target.BoundingRadius)) return true;
{
//Check the first one
var minion = EntityManager.MinionsAndMonsters.EnemyMinions.FirstOrDefault(m => m.IsValidTarget(2000));
if (minion == null) return false;
var predictedPos = SpellManager.Q1.GetPrediction(minion);
if (predictedPos.UnitPosition.To2D().Distance(firstBouncePosition) <
SpellManager.Q1.Width + minion.BoundingRadius)
{
return true;
}
}
return false;
}
示例6: GetMinionsPredictedPositions
public static List<Vector2> GetMinionsPredictedPositions(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.To2D().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.UnitPosition.To2D());
}
}
return result;
}
示例7: WallQpos
public static Vector3 WallQpos(AIHeroClient target)
{
if (target == null)
{
return new Vector3();
}
for (var i = 100; i < 900; i += 100)
{
var qPos = new Vector3(
Prediction.Position.PredictUnitPosition(target, 250).To3D().X + i,
Prediction.Position.PredictUnitPosition(target, 250).To3D().Y + i,
Prediction.Position.PredictUnitPosition(target, 250).To3D().Z);
if (
NavMesh.GetCollisionFlags(qPos.To2D()
.RotateAroundPoint((Vector2) qPos, 20)).HasFlag(CollisionFlags.Building) ||
NavMesh.GetCollisionFlags(qPos.To2D()
.RotateAroundPoint((Vector2) qPos, 20)).HasFlag(CollisionFlags.Wall))
return qPos;
}
return new Vector3();
}
示例8: MoveTo
static void MoveTo(Vector3 position)
{
var pointToMoveTo = Player.ServerPosition + 250 * (position.To2D() - Player.ServerPosition.To2D()).Normalized().To3D();
Player.IssueOrder(GameObjectOrder.MoveTo, pointToMoveTo);
}
示例9: Cast_Inverted_E
private void Cast_Inverted_E(Vector3 position)
{
if (!E.IsReady())
return;
var pos = ObjectManager.Player.ServerPosition.To2D().Extend(position.To2D(), -300).To3D();
E.Cast(pos, UsePackets());
}
示例10: GetFirstWallPoint
public static Vector2? GetFirstWallPoint(Vector3 from, Vector3 to, float step = 25)
{
return GetFirstWallPoint(from.To2D(), to.To2D(), step);
}