本文整理汇总了C#中System.Vector3.To2D2方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.To2D2方法的具体用法?C# Vector3.To2D2怎么用?C# Vector3.To2D2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Vector3
的用法示例。
在下文中一共展示了Vector3.To2D2方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Line
public Line(Vector3 start, Vector3 end, float length = -1)
: this(start.To2D2(), end.To2D2(), length)
{
}
示例2: Rectangle
public Rectangle(Vector3 start, Vector3 end, float width)
: this(start.To2D2(), end.To2D2(), width)
{
}
示例3: Arc
public Arc(Vector3 start, Vector3 direction, float angle, float radius, int quality = 20)
: this(start.To2D2(), direction.To2D2(), angle, radius, quality)
{
}
示例4: Circle
public Circle(Vector3 center, float radius, int quality = 20)
: this(center.To2D2(), radius, quality)
{
}
示例5: Add
public void Add(Vector3 point)
{
Points.Add(point.To2D2());
}
示例6: IsInside
public bool IsInside(Vector3 point)
{
return !IsOutside(point.To2D2());
}
示例7: Distance4
/// <summary>
/// Calculates the 2D distance to the point.
/// </summary>
public static float Distance4(this Obj_AI_Base unit, Vector3 point, bool squared = false)
{
return unit.ServerPosition.To2D2().Distance7(point.To2D2(), squared);
}
示例8: Distance8
/// <summary>
/// Calculates the distance to the Vector3.
/// </summary>
public static float Distance8(this Vector2 v, Vector3 to, bool squared = false)
{
return v.Distance7(to.To2D2(), squared);
}
示例9: Sector
public Sector(Vector3 center, Vector3 direction, float angle, float radius, int quality = 20)
: this(center.To2D2(), direction.To2D2(), angle, radius, quality)
{
}
示例10: Ring
public Ring(Vector3 center, float innerRadius, float outerRadius, int quality = 20)
: this(center.To2D2(), innerRadius, outerRadius, quality)
{
}
示例11: IsInRange
/// <summary>
/// Returns if the Vector3 is in range of the spell.
/// </summary>
public bool IsInRange(Vector3 point, float range = -1)
{
return IsInRange(point.To2D2(), range);
}
示例12: WillHit
/// <summary>
/// Returns if the spell will hit the point when casted on castPosition.
/// </summary>
public bool WillHit(Vector3 point, Vector3 castPosition, int extraWidth = 0)
{
switch (Type)
{
case SkillshotType.SkillshotCircle:
if (point.To2D2().Distance8(castPosition, true) < WidthSqr)
{
return true;
}
break;
case SkillshotType.SkillshotLine:
if (point.To2D2().Distance(castPosition.To2D2(), From.To2D2(), true, true) <
Math.Pow(Width + extraWidth, 2))
{
return true;
}
break;
case SkillshotType.SkillshotCone:
var edge1 = (castPosition.To2D2() - From.To2D2()).Rotated2(-Width / 2);
var edge2 = edge1.Rotated2(Width);
var v = point.To2D2() - From.To2D2();
if (point.To2D2().Distance8(From, true) < RangeSqr && edge1.CrossProduct2(v) > 0 &&
v.CrossProduct2(edge2) > 0)
{
return true;
}
break;
}
return false;
}
示例13: 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.To2D2().IsValid() ? from : ObjectManager.Player.ServerPosition;
return (from minion in minions
select
Prediction2.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.To2D2()).ToList();
}