Skip to content

Commit

Permalink
need to perform string parsing and formatting without depending on no…
Browse files Browse the repository at this point in the history
…tation. (#7)

- #7
- thank you @BasicCPPDev
  • Loading branch information
ikpil committed Aug 13, 2023
1 parent 83752e0 commit bd16322
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/DotRecast.Recast/ObjImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using DotRecast.Recast.Geom;

Expand Down Expand Up @@ -85,7 +86,13 @@ private static float[] ReadVector3f(string line)
throw new Exception("Invalid vector, expected 3 coordinates, found " + (v.Length - 1));
}

return new float[] { float.Parse(v[1]), float.Parse(v[2]), float.Parse(v[3]) };
// fix - https://github.com/ikpil/DotRecast/issues/7
return new float[]
{
float.Parse(v[1], CultureInfo.InvariantCulture),
float.Parse(v[2], CultureInfo.InvariantCulture),
float.Parse(v[3], CultureInfo.InvariantCulture)
};
}

private static void ReadFace(string line, ObjImporterContext context)
Expand Down

0 comments on commit bd16322

Please sign in to comment.