Remade item and tile basic system.

Still not funcitonal but the shape is final. Sort of.
This commit is contained in:
Ondřej Hruška
2014-04-19 18:32:14 +02:00
parent ccbc95c74a
commit 65ad97994b
176 changed files with 1561 additions and 1616 deletions
+2 -2
View File
@@ -49,7 +49,6 @@ public class Calc {
return Math.abs(a * x + b * y + c) / Math.sqrt(a * a + b * b);
}
private static class Angles {
public static double delta(double alpha, double beta, double a360)
@@ -384,7 +383,8 @@ public class Calc {
}
private static Random rand = new Random();
public static double sphereSurface(double radius)
{
return 4D * Math.PI * square(radius);
+4 -2
View File
@@ -72,7 +72,8 @@ public abstract class Easing {
/**
* @param in Easing to reverse
*/
public Reverse(Easing in) {
public Reverse(Easing in)
{
this.ea = in;
}
@@ -101,7 +102,8 @@ public abstract class Easing {
* @param in initial EasingFunction
* @param out terminal EasingFunction
*/
public Composite(Easing in, Easing out) {
public Composite(Easing in, Easing out)
{
this.in = in;
this.out = out;
}
+4 -2
View File
@@ -26,7 +26,8 @@ public class Polar {
* @param angle angle in RAD
* @param distance distance from origin
*/
public Polar(double angle, double distance) {
public Polar(double angle, double distance)
{
this(angle, false, distance);
}
@@ -38,7 +39,8 @@ public class Polar {
* @param deg angle is in DEG
* @param distance radius
*/
public Polar(double angle, boolean deg, double distance) {
public Polar(double angle, boolean deg, double distance)
{
this.radius = distance;
this.angle = deg ? Math.toRadians(angle) : angle;
}
+6 -4
View File
@@ -25,7 +25,8 @@ public class Range {
/**
* Implicit range constructor 0-1
*/
public Range() {
public Range()
{
}
@@ -35,7 +36,8 @@ public class Range {
* @param min min number
* @param max max number
*/
public Range(double min, double max) {
public Range(double min, double max)
{
this.min = min;
this.max = max;
norm();
@@ -47,7 +49,8 @@ public class Range {
*
* @param minmax min = max number
*/
public Range(double minmax) {
public Range(double minmax)
{
this.min = minmax;
this.max = minmax;
}
@@ -178,5 +181,4 @@ public class Range {
this.max = max;
norm();
}
}
+2 -2
View File
@@ -137,13 +137,13 @@ public abstract class Color {
protected static final double clamp(Num n)
{
return Calc.clampd(n.value(), 0, 1);
return Calc.clamp(n.value(), 0, 1);
}
protected static final double clamp(double n)
{
return Calc.clampd(n, 0, 1);
return Calc.clamp(n, 0, 1);
}
@@ -10,7 +10,8 @@ public class ColorAlphaAdjuster extends Color {
private final Num alphaAdjust;
public ColorAlphaAdjuster(Color source, Num alphaMul) {
public ColorAlphaAdjuster(Color source, Num alphaMul)
{
this.source = source;
this.alphaAdjust = alphaMul;
}
+2 -1
View File
@@ -12,7 +12,8 @@ public class ColorHsb extends Color {
private final Num a;
public ColorHsb(Num h, Num s, Num b, Num a) {
public ColorHsb(Num h, Num s, Num b, Num a)
{
this.h = h;
this.s = s;
this.b = b;
+2 -1
View File
@@ -12,7 +12,8 @@ public class ColorRgb extends Color {
private final Num a;
public ColorRgb(Num r, Num g, Num b, Num a) {
public ColorRgb(Num r, Num g, Num b, Num a)
{
this.r = r;
this.g = g;
this.b = b;
+4 -2
View File
@@ -27,7 +27,8 @@ public class NoiseGen {
* @param middle middle bound ("surface")
* @param high high bound ("hill")
*/
public NoiseGen(double density, double low, double middle, double high) {
public NoiseGen(double density, double low, double middle, double high)
{
this(density, low, middle, high, Double.doubleToLongBits(Math.random()));
}
@@ -41,7 +42,8 @@ public class NoiseGen {
* @param high high bound ("hill")
* @param seed random seed to use
*/
public NoiseGen(double density, double low, double middle, double high, long seed) {
public NoiseGen(double density, double low, double middle, double high, long seed)
{
if (low > middle || middle > high) throw new IllegalArgumentException("Invalid value range.");
this.density = density;
@@ -60,7 +60,8 @@ public class PerlinNoiseGenerator {
/**
* Create a new noise creator with the default seed value
*/
public PerlinNoiseGenerator() {
public PerlinNoiseGenerator()
{
this(DEFAULT_SEED);
}
@@ -70,7 +71,8 @@ public class PerlinNoiseGenerator {
*
* @param seed The seed value to use
*/
public PerlinNoiseGenerator(long seed) {
public PerlinNoiseGenerator(long seed)
{
p_imp = new int[DEFAULT_SAMPLE_SIZE << 1];
int i, j, k;