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:
16
init.lua
16
init.lua
@@ -468,6 +468,22 @@ function M.bone_world_transform(handle, bone_id)
|
||||
return ws.x, ws.y, ws.rot
|
||||
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.
|
||||
-- Stored in test_overrides and applied during update after rest-reset
|
||||
|
||||
Reference in New Issue
Block a user