engine/gamesys/src/gamesys/scripts/script_spine_model.cpp
/*# reset the IK constraint target position to default of a spinemodel
     *
     * Resets any previously set IK target of a spine model, the position will be reset
     * to the original position from the spine scene.
     *
     * @name spine.reset_ik_target
     * @param url [type:string|hash|url] the spine model containing the object
     * @param ik_constraint_id [type:string|hash] id of the corresponding IK constraint object
     * @examples
     *
     * The following example assumes that the spine model has id "spinemodel".
     *
     * A player no longer has an item in hand, that previously was controlled through IK,
     * let's reset the IK of the right hand.
     *
     * ```lua
     * function player_lost_item(self)
     *   spine.reset_ik_target("player#spinemodel", "right_hand_constraint")
     * end
     * ```
     */
reset the IK constraint target position to default of a spinemodel
Resets any previously set IK target of a spine model, the position will be reset
to the original position from the spine scene.

@name spine.reset_ik_target
@param url [type:string|hash|url] the spine model containing the object
@param ik_constraint_id [type:string|hash] id of the corresponding IK constraint object
@examples

The following example assumes that the spine model has id "spinemodel".

A player no longer has an item in hand, that previously was controlled through IK,
let's reset the IK of the right hand.


reset the IK constraint target position to default of a spinemodel Resets any previously set IK target of a spine model the position will be reset to the original position from the spine scene . @name spine . reset_ik_target @param url [ type : string|hash|url ] the spine model containing the object @param ik_constraint_id [ type : string|hash ] id of the corresponding IK constraint object @examples The following example assumes that the spine model has id " spinemodel " . A player no longer has an item in hand that previously was controlled through IK let ' s reset the IK of the right hand .
int SpineComp_ResetIK(lua_State* L)
    {
        DM_LUA_STACK_CHECK(L, 0);
        dmGameObject::HInstance sender_instance = CheckGoInstance(L);
        dmGameObject::HCollection collection = dmGameObject::GetCollection(sender_instance);
        uintptr_t user_data;
        dmMessage::URL receiver;
        SpineModelWorld* world = 0;
        dmGameObject::GetComponentUserDataFromLua(L, 1, collection, SPINE_MODEL_EXT, &user_data, &receiver, (void**) &world);
        SpineModelComponent* component = world->m_Components.Get(user_data);
        dmhash_t ik_constraint_id = dmScript::CheckHashOrString(L, 2);
        if (!CompSpineModelResetIKTarget(component, ik_constraint_id))
        {
            char str[128];
            return luaL_error(L, "the IK constraint target '%s' could not be found", dmScript::GetStringFromHashOrString(L, 2, str, sizeof(str)));
        }
        return 0;
    }
int SpineComp_ResetIK ( lua_State * L ) { DM_LUA_STACK_CHECK ( L , 0 ) ; dmGameObject :: HInstance sender_instance = CheckGoInstance ( L ) ; dmGameObject :: HCollection collection = dmGameObject :: GetCollection ( sender_instance ) ; uintptr_t user_data ; dmMessage :: URL receiver ; SpineModelWorld * world = 0 ; dmGameObject :: GetComponentUserDataFromLua ( L , 1 , collection , SPINE_MODEL_EXT , & user_data , & receiver , ( void * * ) & world ) ; SpineModelComponent * component = world -> m_Components . Get ( user_data ) ; dmhash_t ik_constraint_id = dmScript :: CheckHashOrString ( L , 2 ) ; if ( ! CompSpineModelResetIKTarget ( component , ik_constraint_id ) ) { char str [ 128 ] ; return luaL_error ( L , " " , dmScript :: GetStringFromHashOrString ( L , 2 , str , sizeof ( str ) ) ) ; } return 0 ; }
reset the IK constraint target position to default of a spinemodel
 Resets any previously set IK target of a spine model, the position will be reset
 to the original position from the spine scene.
reset the IK constraint target position to default of a spinemodel Resets any previously set IK target of a spine model the position will be reset to the original position from the spine scene .