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

Function spawn_node_subtree

native/watchos/src/lib.rs:964–985  ·  view source on GitHub ↗
(
    model: &models::Model, node_idx: usize, parent: u32,
    gltf_to_bloom: &mut std::collections::HashMap<usize, u32>,
    skinned_nodes: &mut Vec<(u32, usize)>,
)

Source from the content-addressed store, hash-verified

962}
963
964fn spawn_node_subtree(
965 model: &models::Model, node_idx: usize, parent: u32,
966 gltf_to_bloom: &mut std::collections::HashMap<usize, u32>,
967 skinned_nodes: &mut Vec<(u32, usize)>,
968) {
969 let Some(gltf_node) = model.nodes.get(node_idx) else { return; };
970 let bloom_node = scene::create();
971 gltf_to_bloom.insert(node_idx, bloom_node);
972 scene::set_parent(bloom_node, parent);
973 scene::set_transform(bloom_node, gltf_node.local_transform());
974 if let Some(mi) = gltf_node.mesh {
975 if let Some(mesh) = model.meshes.get(mi) {
976 attach_mesh(bloom_node, mesh);
977 if gltf_node.skin.is_some() {
978 skinned_nodes.push((bloom_node, node_idx));
979 }
980 }
981 }
982 for &child_idx in &gltf_node.children {
983 spawn_node_subtree(model, child_idx, bloom_node, gltf_to_bloom, skinned_nodes);
984 }
985}
986
987fn apply_primitive(handle: u32, prim: &models::Primitive) {
988 scene::set_geometry(handle,

Callers 1

bloom_scene_attach_modelFunction · 0.85

Calls 7

createFunction · 0.85
set_parentFunction · 0.85
set_transformFunction · 0.85
attach_meshFunction · 0.85
local_transformMethod · 0.80
getMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected