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

Function bloom_draw_model

native/tvos/src/lib.rs:2068–2083  ·  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

2066
2067#[no_mangle]
2068pub extern "C" fn bloom_draw_model(handle: f64, x: f64, y: f64, z: f64, scale: f64, r: f64, g: f64, b: f64, a: f64) {
2069 let eng = engine();
2070 if let Some(model) = eng.models.get(handle) {
2071 let tint = [(r / 255.0) as f32, (g / 255.0) as f32, (b / 255.0) as f32, (a / 255.0) as f32];
2072 let position = [x as f32, y as f32, z as f32];
2073 let handle_bits = handle.to_bits();
2074 if eng.renderer.cache_model_if_static(handle_bits, &model.meshes) {
2075 eng.renderer.draw_model_cached(handle_bits, position, scale as f32, tint);
2076 } else {
2077 for mesh in &model.meshes {
2078 let tex_idx = mesh.texture_idx.unwrap_or(0);
2079 eng.renderer.draw_model_mesh_tinted(&mesh.vertices, &mesh.indices, position, scale as f32, tint, tex_idx);
2080 }
2081 }
2082 }
2083}
2084
2085#[no_mangle]
2086pub extern "C" fn bloom_draw_model_rotated(

Callers

nothing calls this directly

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