Skip to content

Commit

Permalink
case insensitive, handle other types
Browse files Browse the repository at this point in the history
  • Loading branch information
chapulina committed Jul 18, 2018
1 parent fbed4f3 commit 25eda5c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions examples/view_sdf_from_file.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,19 +163,23 @@ <h4>Model files</h4>
const fileContent = result[1];

// Keep the last occurence of .sdf file, ignore all others
if (fileName.endsWith('.sdf'))
if (fileName.toLowerCase().endsWith('.sdf'))
{
sdfFile = fileContent;
}
else if (fileName.endsWith('.dae') || fileName.endsWith('.obj'))
else if (fileName.toLowerCase().endsWith('.dae') ||
fileName.toLowerCase().endsWith('.obj') ||
fileName.toLowerCase().endsWith('.stl'))
{
sdfparser.meshes[fileName] = fileContent;
}
else if (fileName.endsWith('.mtl'))
else if (fileName.toLowerCase().endsWith('.mtl'))
{
sdfparser.mtls[fileName] = fileContent;
}
else if (fileName.endsWith('.png'))
else if (fileName.toLowerCase().endsWith('.png') ||
fileName.toLowerCase().endsWith('.jpg') ||
fileName.toLowerCase().endsWith('.jpeg'))
{
THREE.Cache.add(fileName, fileContent);
}
Expand Down

0 comments on commit 25eda5c

Please sign in to comment.