(handle: f64, x: f64, y: f64, z: f64, scale: f64, r: f64, g: f64, b: f64, a: f64)
| 755 | |
| 756 | #[wasm_bindgen] |
| 757 | pub fn bloom_draw_model(handle: f64, x: f64, y: f64, z: f64, scale: f64, r: f64, g: f64, b: f64, a: f64) { |
| 758 | let eng = engine(); |
| 759 | if let Some(model) = eng.models.get(handle) { |
| 760 | let position = [x as f32, y as f32, z as f32]; |
| 761 | let scale = scale as f32; |
| 762 | let tint = [(r / 255.0) as f32, (g / 255.0) as f32, (b / 255.0) as f32, (a / 255.0) as f32]; |
| 763 | let handle_bits = handle.to_bits(); |
| 764 | if eng.renderer.cache_model_if_static(handle_bits, &model.meshes) { |
| 765 | eng.renderer.draw_model_cached(handle_bits, position, scale, tint); |
| 766 | } else { |
| 767 | for mesh in &model.meshes { |
| 768 | let tex_idx = mesh.texture_idx.unwrap_or(0); |
| 769 | eng.renderer.draw_model_mesh_tinted(&mesh.vertices, &mesh.indices, position, scale, tint, tex_idx); |
| 770 | } |
| 771 | } |
| 772 | } |
| 773 | } |
| 774 | |
| 775 | #[wasm_bindgen] |
| 776 | pub fn bloom_draw_model_rotated( |
nothing calls this directly
no test coverage detected