for (std::vector::iterator gesture_it = gesture_events.begin(); gesture_it != gesture_events.end(); gesture_it++) { if (gesture_it->target == "logo1") { if (gesture_it->gesture_id == "n-drag") { float dx = gesture_it->values.at("drag_dx"); float dy = gesture_it->values.at("drag_dy"); if (!use_pixels) { dx = dx * screen_width; dy = dy * screen_height; } float new_x = logo1_dimensions.x + dx; float new_y = logo1_dimensions.y + dy; logo1_dimensions.x = new_x; logo1_dimensions.y = new_y; } else if (gesture_it->gesture_id == "n-rotate") { //Rotation is about a specific point, so we need to do a coordinate transform and adjust //not only the object's rotation, but it's x and y values as well float rotation_angle = degreesToRads(gesture_it->values.at("rotate_dtheta")); //If we have points down, move the box; if there are no points, this is from gesture inertia and there is no //center about which to rotate if (gesture_it->n != 0) { float temp_x = rotateAboutCenterX(logo1_dimensions.x, logo1_dimensions.y, gesture_it->x, gesture_it->y, rotation_angle); float temp_y = rotateAboutCenterY(logo1_dimensions.x, logo1_dimensions.y, gesture_it->x, gesture_it->y, rotation_angle); } logo1_dimensions.rotation = logo1_dimensions.rotation + rotation_angle; } else if (gesture_it->gesture_id == "n-scale") { float dsx = gesture_it->values.at("scale_dsx"); if (!use_pixels) { dsx = dsx * screen_width; } logo1_dimensions.scale = logo1_dimensions.scale + dsx; } }