I'm writing a MTL file loader for my game engine. I am using a Scanner attached to a FileInputStream to read from the file. When trying to read the line
Ks 0.500000 0.500000 0.500000
A InputMismatchException is thrown (by Scanner), the stacktrace leading to my code:
protected ColorRGBA readColor() {
ColorRGBA color = new ColorRGBA();
color.set(scanner.nextFloat(), scanner.nextFloat(), scanner.nextFloat(), scanner.nextFloat());
return color;
}
It works on the previous statements using the same method. I'm not sure why the exception is being thrown by this line, but not the others, all in the same format (but different commands and numbers, obviously). Why is this exception being thrown?