本文整理汇总了C#中Loon.Core.Geom.Vector2f.Y方法的典型用法代码示例。如果您正苦于以下问题:C# Vector2f.Y方法的具体用法?C# Vector2f.Y怎么用?C# Vector2f.Y使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Loon.Core.Geom.Vector2f
的用法示例。
在下文中一共展示了Vector2f.Y方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Find
public static List<Vector2f> Find(AStarFindHeuristic heuristic,
Field2D maps, Vector2f start, Vector2f goal, bool flag)
{
return Find(heuristic, maps.GetMap(), maps.GetLimit(), start.X(),
start.Y(), goal.X(), goal.Y(), flag);
}
示例2: Angle
public int Angle(Vector2f v) {
int dx = v.X() - X();
int dy = v.Y() - Y();
int adx = MathUtils.Abs(dx);
int ady = MathUtils.Abs(dy);
if ((dy == 0) && (dx == 0)) {
return 0;
}
if ((dy == 0) && (dx > 0)) {
return 0;
}
if ((dy == 0) && (dx < 0)) {
return 180;
}
if ((dy > 0) && (dx == 0)) {
return 90;
}
if ((dy < 0) && (dx == 0)) {
return 270;
}
float rwinkel = MathUtils.Atan(ady / adx);
float dwinkel = 0.0f;
if ((dx > 0) && (dy > 0)) {
dwinkel = MathUtils.ToDegrees(rwinkel);
} else if ((dx < 0) && (dy > 0)) {
dwinkel = (180.0f - MathUtils.ToDegrees(rwinkel));
} else if ((dx > 0) && (dy < 0)) {
dwinkel = (360.0f - MathUtils.ToDegrees(rwinkel));
} else if ((dx < 0) && (dy < 0)) {
dwinkel = (180.0f + MathUtils.ToDegrees(rwinkel));
}
int iwinkel = (int) dwinkel;
if (iwinkel == 360) {
iwinkel = 0;
}
return iwinkel;
}
示例3: NearlyCompare
public bool NearlyCompare(Vector2f v, int range) {
int dX = MathUtils.Abs(X() - v.X());
int dY = MathUtils.Abs(Y() - v.Y());
return (dX <= range) && (dY <= range);
}
示例4: Get
private int Get(int[][] data, Vector2f point)
{
try
{
if (point.X() >= 0 && point.X() < width && point.Y() >= 0
&& point.Y() < height)
{
return data[point.Y()][point.X()];
}
else
{
return -1;
}
}
catch (Exception)
{
return -1;
}
}
示例5: Neighbors
public List<Vector2f> Neighbors(Vector2f pos, bool flag)
{
if (result == null)
{
result = new List<Vector2f>(8);
}
else
{
CollectionUtils.Clear(result);
}
int x = pos.X();
int y = pos.Y();
CollectionUtils.Add(result, new Vector2f(x, y - 1));
CollectionUtils.Add(result, new Vector2f(x + 1, y));
CollectionUtils.Add(result, new Vector2f(x, y + 1));
CollectionUtils.Add(result, new Vector2f(x - 1, y));
if (flag)
{
CollectionUtils.Add(result, new Vector2f(x - 1, y - 1));
CollectionUtils.Add(result, new Vector2f(x + 1, y - 1));
CollectionUtils.Add(result, new Vector2f(x + 1, y + 1));
CollectionUtils.Add(result, new Vector2f(x - 1, y + 1));
}
return result;
}
示例6: MoveTo
public MoveTo(Field2D map, Vector2f pos, bool flag_0)
: this(map, pos.X(), pos.Y(), flag_0)
{
}