Make translation elliptical, rather than linear

pull/50/head
James Ball 2022-02-27 10:46:31 +00:00
rodzic 47615b62f4
commit c9e8d09172
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -19,7 +19,8 @@ public class TranslateEffect extends PhaseEffect {
@Override
public Vector2 apply(int count, Vector2 vector) {
if (speed != 0 && !translation.equals(new Vector2())) {
return vector.translate(translation.scale(Math.sin(nextTheta())));
double theta = nextTheta();
return vector.translate(translation.scale(new Vector2(Math.sin(theta), Math.cos(theta))));
}
return vector;