Esempio n. 1
0
/**
 * Moves selected bones.
 * \param d distance to move by
 * \return number of bones moved
 **/
int Skeleton::moveSelectedBones(const Vector2D& d)
{
    int movedBones = 0;

    /* timeStamp to prevent joints moved twice if they belong to
     * multiple bones */
    static int timeStamp = 0;

    for (unsigned i = 0; i < bones->size(); i++) {
        Bone *b = (*bones)[i];
        if (b->selected) {
            b->drag(d, timeStamp);
            movedBones++;
        }
    }

    timeStamp++;
    /* return the number of bones moved */
    return movedBones;
}