// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Boundary
{
///
/// The Edge structure defines the points of a line segment that are used to
/// construct a polygonal boundary.
///
public struct Edge
{
///
/// The first point of the edge line segment.
///
public readonly Vector2 PointA;
///
/// The second point of the edge line segment.
///
public readonly Vector2 PointB;
///
/// Initializes the Edge structure.
///
/// The first point of the line segment.
/// The second point of the line segment.
public Edge(Vector2 pointA, Vector2 pointB)
{
PointA = pointA;
PointB = pointB;
}
///
/// Initializes the Edge structure.
///
/// The first point of the line segment.
/// The second point of the line segment.
public Edge(Vector3 pointA, Vector3 pointB) :
// Use the X and Z parameters as our edges are height agnostic.
this(new Vector2(pointA.x, pointA.z), new Vector2(pointB.x, pointB.z))
{ }
}
}