(&mut self, x: f64, y: f64, z: f64, w: f64, h: f64, d: f64, r: f64, g: f64, b: f64, a: f64)
| 12542 | } |
| 12543 | |
| 12544 | pub fn draw_cube_wires(&mut self, x: f64, y: f64, z: f64, w: f64, h: f64, d: f64, r: f64, g: f64, b: f64, a: f64) { |
| 12545 | let color = Self::color_to_f32(r, g, b, a); |
| 12546 | let (x, y, z) = (x as f32, y as f32, z as f32); |
| 12547 | let (hw, hh, hd) = (w as f32 * 0.5, h as f32 * 0.5, d as f32 * 0.5); |
| 12548 | let t = 0.02f32; |
| 12549 | |
| 12550 | let corners = [ |
| 12551 | [x-hw,y-hh,z-hd],[x+hw,y-hh,z-hd],[x+hw,y+hh,z-hd],[x-hw,y+hh,z-hd], |
| 12552 | [x-hw,y-hh,z+hd],[x+hw,y-hh,z+hd],[x+hw,y+hh,z+hd],[x-hw,y+hh,z+hd], |
| 12553 | ]; |
| 12554 | let edges = [ |
| 12555 | (0,1),(1,2),(2,3),(3,0), // front |
| 12556 | (4,5),(5,6),(6,7),(7,4), // back |
| 12557 | (0,4),(1,5),(2,6),(3,7), // connecting |
| 12558 | ]; |
| 12559 | for (a_idx, b_idx) in &edges { |
| 12560 | self.add_line_3d(corners[*a_idx], corners[*b_idx], color, t); |
| 12561 | } |
| 12562 | } |
| 12563 | |
| 12564 | pub fn draw_sphere(&mut self, cx: f64, cy: f64, cz: f64, radius: f64, r: f64, g: f64, b: f64, a: f64) { |
| 12565 | self.ensure_draw_state_3d(self.current_texture_3d); |
no test coverage detected