Exemple #1
0
void templateAppToucheMoved(float x, float y, unsigned int tap_count)
{
    if (y > ((screen_size * 0.5f) - (screen_size * 0.05f)) &&
        y < ((screen_size * 0.5f) + (screen_size * 0.05f))) {

        move_delta->z =
        view_delta->x =
        view_delta->y = 0.0f;

        move_location->x = x;
        move_location->y = y;

        view_location->x = x;
        view_location->y = y;
    } else if (y < (screen_size * 0.5f)) {
        vec3 touche(x, y, 0.0f);

        move_delta = move_location - touche;

        move_delta.safeNormalize();

        move_delta->z = CLAMP((move_location-touche).length() / 128.0f,
                              0.0f,
                              1.0f);
    } else {
        view_delta->x = view_delta->x * 0.75f + (x - view_location->x) * 0.25f;
        view_delta->y = view_delta->y * 0.75f + (y - view_location->y) * 0.25f;

        view_location->x = x;
        view_location->y = y;
    }
}
int main(int argc, char *argv[]) {
	CompressTouche touche(argv[0]);
	return touche.run(argc, argv);
}