// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
#include "Engine/Core/Math/AABB.h"
namespace CSG
{
enum PolygonSplitResult
{
///
/// Polygon is completely inside half-space defined by plane
///
CompletelyInside,
///
/// Polygon is completely outside half-space defined by plane
///
CompletelyOutside,
///
/// Polygon has been split into two parts by plane
///
Split,
///
/// Polygon is aligned with cutting plane and the polygons' normal points in the same direction
///
PlaneAligned,
///
/// Polygon is aligned with cutting plane and the polygons' normal points in the opposite direction
///
PlaneOppositeAligned
};
///
/// Polygon structure
///
struct Polygon
{
int32 FirstEdgeIndex;
int32 SurfaceIndex;
bool Visible;
bool Inverted;
AABB Bounds;
Polygon()
{
// TODO: remove this constructor to boost performance??
FirstEdgeIndex = INVALID_INDEX;
SurfaceIndex = INVALID_INDEX;
Inverted = false;
Visible = false;
Bounds = AABB();
}
};
};