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

Method set_joint_matrices_scaled

native/shared/src/renderer/mod.rs:12201–12228  ·  view source on GitHub ↗
(&mut self, matrices: &[[[f32; 4]; 4]], scale: f32, position: [f32; 3], rot_sin: f32, rot_cos: f32)

Source from the content-addressed store, hash-verified

12199 }
12200
12201 pub fn set_joint_matrices_scaled(&mut self, matrices: &[[[f32; 4]; 4]], scale: f32, position: [f32; 3], rot_sin: f32, rot_cos: f32) {
12202 let cos_r = rot_cos;
12203 let sin_r = rot_sin;
12204 let mut scaled = Vec::with_capacity(matrices.len());
12205 for m in matrices {
12206 let mut sm = *m;
12207 // Scale
12208 for col in 0..4 {
12209 sm[col][0] *= scale;
12210 sm[col][1] *= scale;
12211 sm[col][2] *= scale;
12212 }
12213 // Rotate around Y axis
12214 for col in 0..4 {
12215 let x = sm[col][0];
12216 let z = sm[col][2];
12217 sm[col][0] = cos_r * x + sin_r * z;
12218 sm[col][2] = -sin_r * x + cos_r * z;
12219 }
12220 // Translate
12221 sm[3][0] += position[0];
12222 sm[3][1] += position[1];
12223 sm[3][2] += position[2];
12224 scaled.push(sm);
12225 }
12226
12227 self.pending_skin_groups.push(scaled);
12228 }
12229
12230 /// Ensure persistent 3D buffers are large enough. Grows with doubling strategy.
12231 fn ensure_buffer_capacity_3d(&mut self, vb_bytes: usize, ib_bytes: usize) {

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected