feat(puppet): add bone_world_scale public API

Returns cascaded world.scl_x and scl_y for a bone. Used by puppet-test
Group 8 scale-cascade assertions; future: vagrant-skeleton or other
modules can query world-scale for compositing/effects.
This commit is contained in:
Axel Meyer
2026-05-18 18:25:47 +02:00
parent dbfd65fa2a
commit 7b6d3b3b70

View File

@@ -468,6 +468,22 @@ function M.bone_world_transform(handle, bone_id)
return ws.x, ws.y, ws.rot return ws.x, ws.y, ws.rot
end end
-- ====================================================================
-- World-scale query (public API; reads from cached bone_state.world).
-- Returns scl_x, scl_y of the bone's cached world-state.
-- ====================================================================
function M.bone_world_scale(handle, bone_id)
local p = all_puppets[handle]
if p == nil then
error("puppet.bone_world_scale: handle " .. tostring(handle) .. " not spawned")
end
local ws = p.bone_state[bone_id] and p.bone_state[bone_id].world
if ws == nil then
error("puppet.bone_world_scale: bone '" .. tostring(bone_id) .. "' has no cached world-state")
end
return ws.scl_x, ws.scl_y
end
-- ==================================================================== -- ====================================================================
-- Test-only: direct bone-angle write bypassing track-conflict guard. -- Test-only: direct bone-angle write bypassing track-conflict guard.
-- Stored in test_overrides and applied during update after rest-reset -- Stored in test_overrides and applied during update after rest-reset