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

Function bloom_draw_model

native/ios/src/lib.rs:1160–1175  ·  view source on GitHub ↗
(handle: f64, x: f64, y: f64, z: f64, scale: f64, r: f64, g: f64, b: f64, a: f64)

Source from the content-addressed store, hash-verified

1158
1159#[no_mangle]
1160pub extern "C" fn bloom_draw_model(handle: f64, x: f64, y: f64, z: f64, scale: f64, r: f64, g: f64, b: f64, a: f64) {
1161 let eng = engine();
1162 if let Some(model) = eng.models.get(handle) {
1163 let tint = [(r / 255.0) as f32, (g / 255.0) as f32, (b / 255.0) as f32, (a / 255.0) as f32];
1164 let position = [x as f32, y as f32, z as f32];
1165 let handle_bits = handle.to_bits();
1166 if eng.renderer.cache_model_if_static(handle_bits, &model.meshes) {
1167 eng.renderer.draw_model_cached(handle_bits, position, scale as f32, tint);
1168 } else {
1169 for mesh in &model.meshes {
1170 let tex_idx = mesh.texture_idx.unwrap_or(0);
1171 eng.renderer.draw_model_mesh_tinted(&mesh.vertices, &mesh.indices, position, scale as f32, tint, tex_idx);
1172 }
1173 }
1174 }
1175}
1176
1177#[no_mangle]
1178pub extern "C" fn bloom_draw_model_rotated(

Callers 1

drawModelFunction · 0.50

Calls 5

cache_model_if_staticMethod · 0.80
draw_model_cachedMethod · 0.80
engineFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected