Skip to content

Commit

Permalink
AssimpUtils: pass better hints to Assimp
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jan 27, 2024
1 parent 449126c commit 7463b01
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,13 @@ public static void extractTriangles(String resourceName, int flags,
Collection<Vertex> addVertices) {
ByteBuffer pLoadedBytes = Utils.loadResourceAsBytes(resourceName);

CharSequence hints = null;
CharSequence hints;
int dotIndex = resourceName.lastIndexOf(".");
if (dotIndex == -1) {
hints = null;
} else {
hints = resourceName.substring(dotIndex + 1);
}
AIScene aiScene
= Assimp.aiImportFileFromMemory(pLoadedBytes, flags, hints);
if (aiScene == null || aiScene.mRootNode() == null) {
Expand Down

0 comments on commit 7463b01

Please sign in to comment.