Skip to main content

ss_player_part_transform_by_index

Function ss_player_part_transform_by_index 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn ss_player_part_transform_by_index( handle: *mut SsPlayer, part: u32, out: *mut f32, ) -> i32
Expand description

Write the part’s current-frame transform into out as the 2D affine [m00, m01, m10, m11, tx, ty], in animation-local (Y-down) space with neither ss_player_set_transform nor the scene’s projection applied. A point maps as x' = m00*x + m01*y + tx, y' = m10*x + m11*y + ty.

Returns SS_OK, or SS_ERROR_INVALID_ARGUMENT when the handle or out is null, no animation is set up, or part is out of range — out is untouched in that case.

Call it after ss_scene_update: it describes the frame that produced. The matrix exists for every part whether or not it is hidden, so a hidden part still reports where it would have been.

§Safety

handle must be a live handle or null; out must point at 6 writable floats.