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

Method update_geometry

native/shared/src/scene.rs:417–444  ·  view source on GitHub ↗
(&mut self, handle: f64, vertices: Vec<Vertex3D>, indices: Vec<u32>)

Source from the content-addressed store, hash-verified

415 }
416
417 pub fn update_geometry(&mut self, handle: f64, vertices: Vec<Vertex3D>, indices: Vec<u32>) {
418 if let Some(node) = self.nodes.get_mut(handle) {
419 // Recompute bounds from vertex positions (Q5).
420 let mut bmin = [f32::MAX; 3];
421 let mut bmax = [f32::MIN; 3];
422 for v in &vertices {
423 for k in 0..3 {
424 if v.position[k] < bmin[k] { bmin[k] = v.position[k]; }
425 if v.position[k] > bmax[k] { bmax[k] = v.position[k]; }
426 }
427 }
428 if vertices.is_empty() {
429 bmin = [0.0; 3];
430 bmax = [0.0; 3];
431 }
432 node.bounds_min = bmin;
433 node.bounds_max = bmax;
434 node.vertices = vertices;
435 node.indices = indices;
436 node.geo_dirty = true;
437 if node.cast_shadow && node.visible {
438 self.shadow_version = self.shadow_version.wrapping_add(1);
439 }
440 if node.visible {
441 self.tlas_version = self.tlas_version.wrapping_add(1);
442 }
443 }
444 }
445
446 // ---- Q4: transform read-back -------------------------------------------
447

Calls 1

get_mutMethod · 0.80

Tested by

no test coverage detected