Add radius setting to vortex styles

This commit is contained in:
Esophose 2020-01-17 05:01:44 -07:00
parent b72516b378
commit d13111b299
2 changed files with 10 additions and 4 deletions

View file

@ -13,6 +13,7 @@ public class ParticleStylePopper extends DefaultParticleStyle {
private int step = 0;
private double radius;
private double grow;
private double radials;
private int helices;
@ -30,7 +31,7 @@ public class ParticleStylePopper extends DefaultParticleStyle {
public List<PParticle> getParticles(ParticlePair particle, Location location) {
List<PParticle> particles = new ArrayList<>();
double radius = (1 - (double) this.step / this.maxStep);
double radius = this.radius * (1 - (double) this.step / this.maxStep);
for (int i = 0; i < this.helices; i++) {
double angle = this.step * this.radials + (2 * Math.PI * i / this.helices);
Vector v = new Vector(MathL.cos(angle) * radius, this.step * this.grow - 1, MathL.sin(angle) * radius);
@ -52,7 +53,8 @@ public class ParticleStylePopper extends DefaultParticleStyle {
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("grow", 0.08, "How much to change the radius per particle");
this.setIfNotExists("radius", 1.0, "The radius at the bottom of the vortex");
this.setIfNotExists("grow", 0.08, "How much to change the height per particle");
this.setIfNotExists("radials", 16, "The steepness of how fast the particles grow upwards", "More = faster/taller growth");
this.setIfNotExists("helices", 2, "The number of orbs spinning around the player");
this.setIfNotExists("step-amount", 32, "How many steps it takes to reach the highest point");
@ -64,6 +66,7 @@ public class ParticleStylePopper extends DefaultParticleStyle {
@Override
protected void loadSettings(CommentedFileConfiguration config) {
this.radius = config.getDouble("radius");
this.grow = config.getDouble("grow");
this.radials = Math.PI / config.getInt("radials");
this.helices = config.getInt("helices");

View file

@ -36,6 +36,7 @@ public class ParticleStyleVortex extends DefaultParticleStyle {
private int step = 0;
private double radius;
private double grow;
private double radials;
private int helices;
@ -49,7 +50,7 @@ public class ParticleStyleVortex extends DefaultParticleStyle {
public List<PParticle> getParticles(ParticlePair particle, Location location) {
List<PParticle> particles = new ArrayList<>();
double radius = 2 * (1 - (double) this.step / this.maxStep);
double radius = this.radius * (1 - (double) this.step / this.maxStep);
for (int i = 0; i < this.helices; i++) {
double angle = this.step * this.radials + (2 * Math.PI * i / this.helices);
Vector v = new Vector(MathL.cos(angle) * radius, this.step * this.grow - 1, MathL.sin(angle) * radius);
@ -67,7 +68,8 @@ public class ParticleStyleVortex extends DefaultParticleStyle {
@Override
protected void setDefaultSettings(CommentedFileConfiguration config) {
this.setIfNotExists("grow", 0.05, "How much to change the radius per particle");
this.setIfNotExists("radius", 2.0, "The bottom radius of the vortex");
this.setIfNotExists("grow", 0.05, "How much to change the height per particle");
this.setIfNotExists("radials", 16, "The steepness of how fast the particles grow upwards", "More = faster/taller growth");
this.setIfNotExists("helices", 4, "The number of orbs spinning around the player");
this.setIfNotExists("step-amount", 70, "How many steps it takes to reach the highest point");
@ -75,6 +77,7 @@ public class ParticleStyleVortex extends DefaultParticleStyle {
@Override
protected void loadSettings(CommentedFileConfiguration config) {
this.radius = config.getDouble("radius");
this.grow = config.getDouble("grow");
this.radials = Math.PI / config.getInt("radials");
this.helices = config.getInt("helices");