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

Function compute_joint_transforms

native/shared/src/models.rs:709–726  ·  view source on GitHub ↗
(
    skeleton: &SkeletonData,
    joint_idx: usize,
    parent_transform: &[[f32; 4]; 4],
    translations: &[[f32; 3]],
    rotations: &[[f32; 4]],
    scales: &[[f32; 3]],
    world_transforms: &mu

Source from the content-addressed store, hash-verified

707}
708
709fn compute_joint_transforms(
710 skeleton: &SkeletonData,
711 joint_idx: usize,
712 parent_transform: &[[f32; 4]; 4],
713 translations: &[[f32; 3]],
714 rotations: &[[f32; 4]],
715 scales: &[[f32; 3]],
716 world_transforms: &mut [[[f32; 4]; 4]],
717) {
718 if joint_idx >= skeleton.joints.len() { return; }
719 let local = mat4_from_trs(&translations[joint_idx], &rotations[joint_idx], &scales[joint_idx]);
720 let world = mat4_mul(parent_transform, &local);
721 world_transforms[joint_idx] = world;
722 let children = skeleton.joints[joint_idx].children.clone();
723 for &child in &children {
724 compute_joint_transforms(skeleton, child, &world, translations, rotations, scales, world_transforms);
725 }
726}
727
728// ============================================================
729// glTF animation loader

Callers 1

Calls 3

mat4_from_trsFunction · 0.85
cloneMethod · 0.80
mat4_mulFunction · 0.70

Tested by

no test coverage detected