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

Method draw_grid

native/shared/src/renderer/mod.rs:12681–12691  ·  view source on GitHub ↗
(&mut self, slices: i32, spacing: f64)

Source from the content-addressed store, hash-verified

12679 }
12680
12681 pub fn draw_grid(&mut self, slices: i32, spacing: f64) {
12682 let color = [0.5f32, 0.5, 0.5, 1.0];
12683 let spacing = spacing as f32;
12684 let half = slices as f32 * spacing / 2.0;
12685
12686 for i in 0..=slices {
12687 let pos = -half + i as f32 * spacing;
12688 self.add_line_3d([-half, 0.0, pos], [half, 0.0, pos], color, 0.01);
12689 self.add_line_3d([pos, 0.0, -half], [pos, 0.0, half], color, 0.01);
12690 }
12691 }
12692
12693 pub fn draw_ray(&mut self, origin_x: f64, origin_y: f64, origin_z: f64, dir_x: f64, dir_y: f64, dir_z: f64, r: f64, g: f64, b: f64, a: f64) {
12694 let color = Self::color_to_f32(r, g, b, a);

Callers 7

bloom_draw_gridFunction · 0.80
bloom_draw_gridFunction · 0.80
bloom_draw_gridFunction · 0.80
bloom_draw_gridFunction · 0.80
bloom_draw_gridFunction · 0.80
bloom_draw_gridFunction · 0.80
bloom_draw_gridFunction · 0.80

Calls 1

add_line_3dMethod · 0.80

Tested by

no test coverage detected