Indexify.h 729 B

123456789101112131415161718
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #pragma once
  4. #include <Jolt/Geometry/Triangle.h>
  5. #include <Jolt/Geometry/IndexedTriangle.h>
  6. JPH_NAMESPACE_BEGIN
  7. /// Take a list of triangles and get the unique set of vertices and use them to create indexed triangles.
  8. /// Vertices that are less than inVertexWeldDistance apart will be combined to a single vertex.
  9. void Indexify(const TriangleList &inTriangles, VertexList &outVertices, IndexedTriangleList &outTriangles, float inVertexWeldDistance = 1.0e-4f);
  10. /// Take a list of indexed triangles and unpack them
  11. void Deindexify(const VertexList &inVertices, const IndexedTriangleList &inTriangles, TriangleList &outTriangles);
  12. JPH_NAMESPACE_END