Merge pull request #383 from ousttrue/fix_bvh_loader

Bvhのfloat.parseのロケール問題を修正
This commit is contained in:
hiroj
2020-03-10 13:32:24 +09:00
committed by GitHub

View File

@@ -114,7 +114,7 @@ namespace UniHumanoid
throw new BvhException("OFFSET is not found");
}
var offset = split.Skip(1).Where(x => !string.IsNullOrEmpty(x)).Select(x => float.Parse(x)).ToArray();
var offset = split.Skip(1).Where(x => !string.IsNullOrEmpty(x)).Select(x => float.Parse(x, System.Globalization.CultureInfo.InvariantCulture)).ToArray();
return new Single3(offset[0], offset[1], offset[2]);
}
@@ -320,7 +320,7 @@ namespace UniHumanoid
}
for(int i=0; i<Channels.Length; ++i)
{
Channels[i].SetKey(frame, float.Parse(split[i]));
Channels[i].SetKey(frame, float.Parse(split[i], System.Globalization.CultureInfo.InvariantCulture));
}
}
@@ -355,7 +355,7 @@ namespace UniHumanoid
{
throw new BvhException("Frame Time is not found");
}
frameTime = float.Parse(frameTimeSplit[1]);
frameTime = float.Parse(frameTimeSplit[1], System.Globalization.CultureInfo.InvariantCulture);
}
var bvh = new Bvh(root, frames, frameTime);