(&mut self, cx: f64, cy: f64, cz: f64, w: f64, d: f64, r: f64, g: f64, b: f64, a: f64)
| 12664 | } |
| 12665 | |
| 12666 | pub fn draw_plane(&mut self, cx: f64, cy: f64, cz: f64, w: f64, d: f64, r: f64, g: f64, b: f64, a: f64) { |
| 12667 | self.ensure_draw_state_3d(self.current_texture_3d); |
| 12668 | let color = Self::color_to_f32(r, g, b, a); |
| 12669 | let (cx, cy, cz) = (cx as f32, cy as f32, cz as f32); |
| 12670 | let (hw, hd) = (w as f32 * 0.5, d as f32 * 0.5); |
| 12671 | let normal = [0.0f32, 1.0, 0.0]; |
| 12672 | |
| 12673 | let base = self.vertices_3d.len() as u32; |
| 12674 | self.vertices_3d.push(Vertex3D { position: [cx-hw, cy, cz-hd], normal, color, uv: [0.0, 0.0], joints: [0.0; 4], weights: [0.0; 4], tangent: [0.0; 4] }); |
| 12675 | self.vertices_3d.push(Vertex3D { position: [cx+hw, cy, cz-hd], normal, color, uv: [1.0, 0.0], joints: [0.0; 4], weights: [0.0; 4], tangent: [0.0; 4] }); |
| 12676 | self.vertices_3d.push(Vertex3D { position: [cx+hw, cy, cz+hd], normal, color, uv: [1.0, 1.0], joints: [0.0; 4], weights: [0.0; 4], tangent: [0.0; 4] }); |
| 12677 | self.vertices_3d.push(Vertex3D { position: [cx-hw, cy, cz+hd], normal, color, uv: [0.0, 1.0], joints: [0.0; 4], weights: [0.0; 4], tangent: [0.0; 4] }); |
| 12678 | self.indices_3d.extend_from_slice(&[base, base+1, base+2, base, base+2, base+3]); |
| 12679 | } |
| 12680 | |
| 12681 | pub fn draw_grid(&mut self, slices: i32, spacing: f64) { |
| 12682 | let color = [0.5f32, 0.5, 0.5, 1.0]; |
no test coverage detected