|
CeresEngine 0.2.0
A game development framework
|
Clips two-dimensional triangles against a set of provided planes. More...
#include <CeresEngine/Mesh/TriangleClipper.hpp>
Public Member Functions | |
| void | clip (UInt8 *vertices, UInt8 *uvs, UInt32 numTris, UInt32 vertexStride, const Vector< TPlane< T > > &clipPlanes, const std::function< void(TVector2< T > *, TVector2< T > *, UInt32)> &writeCallback) |
Private Member Functions | |
| void | convertToMesh (const std::function< void(TVector2< T > *, TVector2< T > *, UInt32)> &writeCallback) |
| Converts clipped vertices back into triangles and outputs them via the provided callback. | |
Private Attributes | |
| TVector2< T > | vertexBuffer [BUFFER_SIZE] |
| TVector2< T > | uvBuffer [BUFFER_SIZE] |
Static Private Attributes | |
| static const int | BUFFER_SIZE = 64 * 3 |
Additional Inherited Members | |
Protected Member Functions inherited from CeresEngine::TriangleClipper< T > | |
| void | addEdgesAndFaces () |
| Register all edges and faces, using the mesh vertices as a basis. | |
| Int32 | clipByPlane (const TPlane< T > &plane) |
| Clips the current mesh with the provided plane. | |
| Int32 | processVertices (const TPlane< T > &plane) |
| Clips vertices of the current mesh by the provided plane. | |
| void | processEdges () |
| Clips edges of the current mesh. | |
| void | processFaces () |
| Clips the faces (polygons) of the current mesh. | |
| void | getOrderedFaces (Vector< Vector< UInt32 > > &sortedFaces) |
| Returns a set of non-culled vertex indices for every visible face in the mesh. | |
| void | getOrderedVertices (const ClipFace &face, Vector< UInt32 > &vertices) |
| Returns a set of ordered and non-culled vertices for the provided face of the mesh. | |
| TVector3< T > | getNormal (Vector< UInt32 > &sortedVertices, UInt32 numVertices) |
| Calculates the normal for vertices related to the provided vertex indices. | |
| bool | getOpenPolyline (ClipFace &face, UInt32 &start, UInt32 &end) |
| Checks is the polygon shape of the provided face open or closed. | |
Protected Attributes inherited from CeresEngine::TriangleClipper< T > | |
| ClipMesh | mesh |
Clips two-dimensional triangles against a set of provided planes.
| void CeresEngine::TriangleClipper2D< T >::clip | ( | UInt8 * | vertices, |
| UInt8 * | uvs, | ||
| UInt32 | numTris, | ||
| UInt32 | vertexStride, | ||
| const Vector< TPlane< T > > & | clipPlanes, | ||
| const std::function< void(TVector2< T > *, TVector2< T > *, UInt32)> & | writeCallback | ||
| ) |
|
private |
Converts clipped vertices back into triangles and outputs them via the provided callback.
|
staticprivate |
|
private |
|
private |