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

Function bloom_update_model_animation

native/linux/src/lib.rs:1554–1571  ·  view source on GitHub ↗
(handle: f64, anim_index: f64, time: f64, scale: f64, px: f64, py: f64, pz: f64, rot_y: f64)

Source from the content-addressed store, hash-verified

1552
1553#[no_mangle]
1554pub extern "C" fn bloom_update_model_animation(handle: f64, anim_index: f64, time: f64, scale: f64, px: f64, py: f64, pz: f64, rot_y: f64) {
1555 // Take a single Y-axis angle (radians) instead of sin/cos, so the
1556 // engine reconstructs both with full precision + correct signs.
1557 // Older callers that passed (rot_sin, rot_cos) hit a Perry-ARM64
1558 // 9th-arg garbling bug AND a sqrt(1-sin²) workaround that lost
1559 // the sign of cos — model rotation was correct only on half the
1560 // circle. 8-arg signature dodges both issues. Matches macOS.
1561 let rot_y_f = rot_y as f32;
1562 let rot_sin = rot_y_f.sin();
1563 let rot_cos = rot_y_f.cos();
1564 let eng = engine();
1565 eng.models.update_model_animation(handle, anim_index as usize, time as f32);
1566 if let Some(anim) = eng.models.get_animation(handle) {
1567 if !anim.joint_matrices.is_empty() {
1568 eng.renderer.set_joint_matrices_scaled(&anim.joint_matrices, scale as f32, [px as f32, py as f32, pz as f32], rot_sin, rot_cos);
1569 }
1570 }
1571}
1572
1573// --- Music FFI ---
1574

Callers

nothing calls this directly

Calls 4

get_animationMethod · 0.80
engineFunction · 0.70

Tested by

no test coverage detected