Created
October 9, 2017 17:03
-
-
Save Waterpicker/e592c0517cab187a43d78defbbcd874e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class ObjectBase { | |
protected Multimap<ParticleEffect, Vector4d> set_v = ArrayListMultimap.create(); | |
public void render(Viewer viewer, Matrix4d... matrices) { | |
for(Map.Entry<ParticleEffect, Vector4d> entry : set_v.entries()) { | |
Vector4d transformed = entry.getValue(); | |
for(Matrix4d m : matrices) { | |
transformed = m.transform(transformed); | |
} | |
viewer.spawnParticles(entry.getKey(), transformed.toVector3()); | |
} | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ParametricEquation extends ObjectBase { | |
private int counter; | |
private ParametricEquation(ParticleEffect effect, Function<Double, Vector3d> function, double interval) { | |
double increment = 16; | |
for (double i = 0d; i <= TrigMath.TWO_PI * interval; i += TrigMath.TWO_PI / increment) { | |
Vector4d current = function.apply(i).toVector4(1); | |
set_v.put(effect, current); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment