MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / draw_cube_wires

Method draw_cube_wires

native/shared/src/renderer/mod.rs:12544–12562  ·  view source on GitHub ↗
(&mut self, x: f64, y: f64, z: f64, w: f64, h: f64, d: f64, r: f64, g: f64, b: f64, a: f64)

Source from the content-addressed store, hash-verified

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);

Callers 7

bloom_draw_cube_wiresFunction · 0.80
bloom_draw_cube_wiresFunction · 0.80
bloom_draw_cube_wiresFunction · 0.80
bloom_draw_cube_wiresFunction · 0.80
bloom_draw_cube_wiresFunction · 0.80
bloom_draw_cube_wiresFunction · 0.80
bloom_draw_cube_wiresFunction · 0.80

Calls 1

add_line_3dMethod · 0.80

Tested by

no test coverage detected