Indexify.h 815 B

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