Only warn when vn with 3 coordinates
This commit is contained in:
parent
c9ad3b05a5
commit
258470f203
|
@ -75,11 +75,19 @@ impl ObjParser {
|
|||
/// ```
|
||||
pub fn parse_texture_coordinate(&self, line_number: usize, line: &str, path: &str) -> Result<Element, ParserError> {
|
||||
|
||||
let values = parse_values(line_number, line, path, 2)?;
|
||||
if let Ok(values) = parse_values(line_number,line, path, 2) {
|
||||
Ok(Element::TextureCoordinate(Vector2::<f64>::new(
|
||||
values[0],
|
||||
values[1],
|
||||
)))
|
||||
} else {
|
||||
let values = parse_values(line_number, line, path, 3)?;
|
||||
logln!("Warning: expected 2 coordinates, but received 3, ignoring the last one...");
|
||||
Ok(Element::TextureCoordinate(Vector2::<f64>::new(
|
||||
values[0],
|
||||
values[1],
|
||||
)))
|
||||
}
|
||||
}
|
||||
|
||||
/// Parses an obj normal line.
|
||||
|
|
Loading…
Reference in New Issue