(&mut self, handle: f64, matrix: [[f32; 4]; 4])
| 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) { |
no test coverage detected