Fix example not compiling

This commit is contained in:
Layl 2019-05-12 22:10:47 +02:00
parent f3f2c68ad1
commit cec2d7ca9f

View File

@ -1,4 +1,4 @@
use nalgebra::{Point2, Point3, Vector3, Vector4}; use nalgebra::{Point2, Point3, Vector3};
pub type Face = [u32; 3]; pub type Face = [u32; 3];
@ -28,19 +28,19 @@ impl mikktspace::Geometry for Mesh {
3 3
} }
fn position(&self, face: usize, vert: usize) -> Point3<f32> { fn position(&self, face: usize, vert: usize) -> [f32; 3] {
vertex(self, face, vert).position vertex(self, face, vert).position.coords.into()
} }
fn normal(&self, face: usize, vert: usize) -> Vector3<f32> { fn normal(&self, face: usize, vert: usize) -> [f32; 3] {
vertex(self, face, vert).normal vertex(self, face, vert).normal.into()
} }
fn tex_coord(&self, face: usize, vert: usize) -> Point2<f32> { fn tex_coord(&self, face: usize, vert: usize) -> [f32; 2] {
vertex(self, face, vert).tex_coord vertex(self, face, vert).tex_coord.coords.into()
} }
fn set_tangent_encoded(&mut self, tangent: Vector4<f32>, face: usize, vert: usize) { fn set_tangent_encoded(&mut self, tangent: [f32; 4], face: usize, vert: usize) {
println!( println!(
"{face}-{vert}: v: {v:?}, vn: {vn:?}, vt: {vt:?}, vx: {vx:?}", "{face}-{vert}: v: {v:?}, vn: {vn:?}, vt: {vt:?}, vx: {vx:?}",
face = face, face = face,
@ -48,7 +48,7 @@ impl mikktspace::Geometry for Mesh {
v = vertex(self, face, vert).position.coords.data, v = vertex(self, face, vert).position.coords.data,
vn = vertex(self, face, vert).normal.data, vn = vertex(self, face, vert).normal.data,
vt = vertex(self, face, vert).tex_coord.coords.data, vt = vertex(self, face, vert).tex_coord.coords.data,
vx = tangent.data, vx = tangent,
); );
} }
} }