本文整理汇总了C#中System.Vector2.Min方法的典型用法代码示例。如果您正苦于以下问题:C# Vector2.Min方法的具体用法?C# Vector2.Min怎么用?C# Vector2.Min使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Vector2
的用法示例。
在下文中一共展示了Vector2.Min方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PointSet
public PointSet(ICollection<Vector2> vertices)
{
points = new List<Vector2>(vertices);
min = max = points[0];
for (int i = 1; i < points.Count; i++)
{
min.Min(points[i]);
max.Max(points[i]);
}
}
示例2: Prepare
//Calculate bounds, and reset indices
internal void Prepare()
{
Vector2 left, right;
_boxMin = new Vector2(0);
_boxMax = new Vector2(0);
foreach (CollisionPlane plane in _planes)
{
//Normalize plane direction
//Get bounds
left = plane.PointLeft;
right = plane.PointRight;
_boxMin.Min(left);
_boxMin.Min(right);
_boxMax.Max(left);
_boxMax.Max(right);
//Reset encode indices
plane._encodeIndex = -1;
if (plane._linkLeft != null)
plane._linkLeft._encodeIndex = -1;
if (plane._linkRight != null)
plane._linkRight._encodeIndex = -1;
}
}
示例3: SafeBounds
/// <summary>
/// Create a Bounds2 that goes through 2 points, the min and max are recalculated.
/// </summary>
/// <param name="min">First point.</param>
/// <param name="max">Second point.</param>
public static Bounds2 SafeBounds( Vector2 min, Vector2 max )
{
return new Bounds2( min.Min( max ), min.Max( max ) );
}