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

Method set_transform

native/shared/src/scene.rs:319–334  ·  view source on GitHub ↗
(&mut self, handle: f64, matrix: [[f32; 4]; 4])

Source from the content-addressed store, hash-verified

317 }
318
319 pub fn set_transform(&mut self, handle: f64, matrix: [[f32; 4]; 4]) {
320 if let Some(node) = self.nodes.get_mut(handle) {
321 // Only dirty shadows when the transform actually changed on
322 // a shadow-casting node. Skeletal animation leaves the node
323 // transform untouched (joints drive the mesh), so static
324 // scenes with animated characters still cache well.
325 let changed = node.transform != matrix;
326 if changed && node.cast_shadow && node.visible {
327 self.shadow_version = self.shadow_version.wrapping_add(1);
328 }
329 if changed && node.visible {
330 self.tlas_version = self.tlas_version.wrapping_add(1);
331 }
332 node.transform = matrix;
333 }
334 }
335
336 pub fn set_visible(&mut self, handle: f64, visible: bool) {
337 if let Some(node) = self.nodes.get_mut(handle) {

Callers 5

Calls 1

get_mutMethod · 0.80

Tested by

no test coverage detected