Added the Gradle build system and added a new native loader
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
package itdelatrisu.opsu.objects.curves;
|
||||
|
||||
import itdelatrisu.opsu.ErrorHandler;
|
||||
import itdelatrisu.opsu.Utils;
|
||||
import itdelatrisu.opsu.beatmap.HitObject;
|
||||
|
||||
import org.newdawn.slick.Color;
|
||||
@@ -161,7 +162,7 @@ public class CircumscribedCircle extends Curve {
|
||||
|
||||
@Override
|
||||
public float[] pointAt(float t) {
|
||||
float ang = lerp(startAng, endAng, t);
|
||||
float ang = Utils.lerp(startAng, endAng, t);
|
||||
return new float[] {
|
||||
(float) (Math.cos(ang) * radius + circleCenter.x),
|
||||
(float) (Math.sin(ang) * radius + circleCenter.y)
|
||||
|
||||
@@ -150,14 +150,6 @@ public abstract class Curve {
|
||||
* @param i the control point index
|
||||
*/
|
||||
public float getY(int i) { return (i == 0) ? y : sliderY[i - 1]; }
|
||||
|
||||
/**
|
||||
* Linear interpolation of a and b at t.
|
||||
*/
|
||||
protected float lerp(float a, float b, float t) {
|
||||
return a * (1 - t) + b * t;
|
||||
}
|
||||
|
||||
/**
|
||||
* Discards the slider cache (only used for mmsliders).
|
||||
*/
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package itdelatrisu.opsu.objects.curves;
|
||||
|
||||
import itdelatrisu.opsu.Utils;
|
||||
import itdelatrisu.opsu.beatmap.HitObject;
|
||||
|
||||
import java.util.Iterator;
|
||||
@@ -94,7 +95,7 @@ public abstract class EqualDistanceMultiCurve extends Curve {
|
||||
// interpolate the point between the two closest distances
|
||||
if (distanceAt - lastDistanceAt > 1) {
|
||||
float t = (prefDistance - lastDistanceAt) / (distanceAt - lastDistanceAt);
|
||||
curve[i] = new Vec2f(lerp(lastCurve.x, thisCurve.x, t), lerp(lastCurve.y, thisCurve.y, t));
|
||||
curve[i] = new Vec2f(Utils.lerp(lastCurve.x, thisCurve.x, t), Utils.lerp(lastCurve.y, thisCurve.y, t));
|
||||
} else
|
||||
curve[i] = thisCurve;
|
||||
}
|
||||
@@ -128,8 +129,8 @@ public abstract class EqualDistanceMultiCurve extends Curve {
|
||||
Vec2f poi2 = curve[index + 1];
|
||||
float t2 = indexF - index;
|
||||
return new float[] {
|
||||
lerp(poi.x, poi2.x, t2),
|
||||
lerp(poi.y, poi2.y, t2)
|
||||
Utils.lerp(poi.x, poi2.x, t2),
|
||||
Utils.lerp(poi.y, poi2.y, t2)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user