comparison src/th06/anm0_vm.rs @ 661:598f3125cbac

Implement enough instructions to execute sub 0 from stage 1.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 10 Aug 2019 21:04:54 +0200
parents 3a9d82a02c88
children b6c351ca0a35
comparison
equal deleted inserted replaced
660:31fc0d881105 661:598f3125cbac
85 ..Default::default() 85 ..Default::default()
86 } 86 }
87 } 87 }
88 88
89 /// TODO 89 /// TODO
90 pub fn fill_vertices(&self, vertices: &mut [Vertex; 4]) { 90 pub fn fill_vertices(&self, vertices: &mut [Vertex; 4], x: f32, y: f32, z: f32) {
91 let mut mat = Mat4::new([[-0.5, 0.5, 0.5, -0.5], 91 let mut mat = Mat4::new([[-0.5, 0.5, 0.5, -0.5],
92 [-0.5, -0.5, 0.5, 0.5], 92 [-0.5, -0.5, 0.5, 0.5],
93 [0., 0., 0., 0.], 93 [0., 0., 0., 0.],
94 [1., 1., 1., 1.]]); 94 [1., 1., 1., 1.]]);
95 95
124 mat.translate(self.dest_offset); 124 mat.translate(self.dest_offset);
125 } 125 }
126 if self.corner_relative_placement { 126 if self.corner_relative_placement {
127 mat.translate_2d(width / 2., height / 2.); 127 mat.translate_2d(width / 2., height / 2.);
128 } 128 }
129
130 mat.translate([x, y, z]);
129 131
130 let mat = mat.borrow_inner(); 132 let mat = mat.borrow_inner();
131 vertices[0].pos[0] = mat[0][0] as i16; 133 vertices[0].pos[0] = mat[0][0] as i16;
132 vertices[0].pos[1] = mat[1][0] as i16; 134 vertices[0].pos[1] = mat[1][0] as i16;
133 vertices[0].pos[2] = mat[2][0] as i16; 135 vertices[0].pos[2] = mat[2][0] as i16;