Dragon tree prototype (WIP)

This commit is contained in:
paulevsGitch 2020-11-01 00:49:29 +03:00
parent 30f7f53c7f
commit 3691e4b67e
21 changed files with 324 additions and 15 deletions

View file

@ -197,4 +197,15 @@ public class SplineHelper {
}
return true;
}
public static Vector3f getPos(List<Vector3f> spline, float index) {
int i = (int) index;
float delta = index - i;
Vector3f p1 = spline.get(i);
Vector3f p2 = spline.get(i + 1);
float x = MathHelper.lerp(delta, p1.getX(), p2.getX());
float y = MathHelper.lerp(delta, p1.getY(), p2.getY());
float z = MathHelper.lerp(delta, p1.getZ(), p2.getZ());
return new Vector3f(x, y, z);
}
}