need to perform string parsing and formatting without depending on notation. (#7)

- https://github.com/ikpil/DotRecast/issues/7
- thank you @BasicCPPDev
This commit is contained in:
ikpil 2023-08-13 14:59:01 +09:00
parent 83752e03a1
commit bd16322ec2
1 changed files with 8 additions and 1 deletions

View File

@ -18,6 +18,7 @@ freely, subject to the following restrictions:
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.IO; using System.IO;
using DotRecast.Recast.Geom; using DotRecast.Recast.Geom;
@ -85,7 +86,13 @@ namespace DotRecast.Recast
throw new Exception("Invalid vector, expected 3 coordinates, found " + (v.Length - 1)); 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) private static void ReadFace(string line, ObjImporterContext context)