Commit 32d2bc38 authored by Philip Levis's avatar Philip Levis
Browse files

Inadvertently removed this file.

parent 51944aae
import java.util.List;
import heronarts.lx.LX;
import heronarts.lx.modulator.SinLFO;
import heronarts.lx.parameter.BoundedParameter;
// array of wing positions akin to colors[]
class FadeTest extends Pattern {
final BoundedParameter speed = new BoundedParameter("SPEE", 11000, 100000, 1000);
final SinLFO color = new SinLFO(0, 360, speed);
FadeTest(LX lx) {
super(lx);
addParameter(speed);
addModulator(color).start();
}
@Override
public void run(double deltaMs) {
float hue = color.getValuef();
int val = lx.hsb(hue, 100, 100);
int skew = (int)((hue - 180f) / 2);
for (Wing wing: model.getAllWings()) {
wing.setSkew(skew);
}
for (LightSamplePointModel bodyPoint : model.getAllBodyLights()) {
setColor(bodyPoint, LX.hsb(0, 0, 20));
}
for (LightSamplePointModel wingPoint : model.getAllWingsLights()) {
setColor(wingPoint, LX.hsb(hue, 100, 100));
}
}
}
class BlackPinkTest extends Pattern {
int FLYER_MOD = 75;
final BoundedParameter period = new BoundedParameter("RATE", 10000, 10000, 18000);
final SinLFO flyerIndex = new SinLFO(0, FLYER_MOD, period);
BlackPinkTest(LX lx) {
super(lx);
addParameter(period);
addModulator(flyerIndex).start();
}
@Override
public void run(double deltaMs) {
List<LightSamplePointModel> allLights = model.getAllLights();
for (LightSamplePointModel lightPoint : allLights) {
if (lightPoint.getBodyIndex() == (int) flyerIndex.getValue()) {
setColor(lightPoint, LX.hsb(330, 70, 70));
} else {
setColor(lightPoint, LX.hsb(0, 0, 20));
}
}
for (WingModel wing : model.getAllWings()) {
if (wing.getFlyerIndex() == (int) flyerIndex.getValue()) {
setSkew(wing, 180);
} else {
setSkew(wing, 0);
}
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment