Skip to content

Commit

Permalink
Added a constructor and bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeddic committed Feb 28, 2024
1 parent f60beff commit 0942550
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {


group = 'com.epagagames'
version = '1.1.0'
version = '1.1.1'

ext {
jmonkeyengine_version = '3.3.2-stable'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ public ColorRGBA getValueColor(float time, float particleRandom, ColorRGBA store
case GRADIENT: gradient.getValueColor(time, output); break;
case RANDOM_BETWEEN_GRADIENTS:
gradient.getValueColor(time, output);
gradientTwo.getValueColor(time, store);
output.interpolateLocal(store, particleRandom);
gradientTwo.getValueColor(time, temp);
output.interpolateLocal(temp, particleRandom);
break;
case RANDOM_BETWEEN_COLORS:
output.r = FastMath.interpolateLinear(FastMath.nextRandomFloat(), color.r, colorTwo.r);
output.g = FastMath.interpolateLinear(FastMath.nextRandomFloat(), color.g, colorTwo.g);
output.b = FastMath.interpolateLinear(FastMath.nextRandomFloat(), color.b, colorTwo.b);
output.a = FastMath.interpolateLinear(FastMath.nextRandomFloat(), color.a, colorTwo.a);
output.r = FastMath.interpolateLinear(particleRandom, color.r, colorTwo.r);
output.g = FastMath.interpolateLinear(particleRandom, color.g, colorTwo.g);
output.b = FastMath.interpolateLinear(particleRandom, color.b, colorTwo.b);
output.a = FastMath.interpolateLinear(particleRandom, color.a, colorTwo.a);
break;
default: break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public Gradient() {

}

public Gradient(ColorRGBA color) {
points.add(new GradPoint(color, 0.0f));
}

public Gradient addGradPoint(ColorRGBA color, float x) {
points.add(new GradPoint(color, x));
sort();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ public void setValue(Vector3f value) {
this.type = Type.CONSTANT;
}

public void setMax(Vector3f max) {
this.second = max;
}

public void setValue(Vector3f min, Vector3f max) {
this.value = min;
this.second = max;
Expand Down

0 comments on commit 0942550

Please sign in to comment.