spheres[1].radius = 50;
}
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
// Access the core master hue via this method call
float hv = hueParameter.getValuef();
float lfoValue = lfo.getValuef();
}
float distanceTo(Point p) {
- return distanceTo(p.fx, p.fy, p.fz);
+ return distanceTo(p.x, p.y, p.z);
}
void add(Vector3 other, float multiplier) {
}
// returns TRUE when this should die
- boolean age(int ms) {
- p.add(v, ms / 1000.0);
+ boolean age(double ms) {
+ p.add(v, (float) (ms / 1000.0));
return this.p.y < (0 - this.radius);
}
}
raindrops = new LinkedList<Raindrop>();
}
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
leftoverMs += deltaMs;
while (leftoverMs > msPerRaindrop) {
leftoverMs -= msPerRaindrop;
for (Point p : model.points) {
color c =
blendColor(
- color(210, 20, (float)Math.max(0, 1 - Math.pow((model.yMax - p.fy) / 10, 2)) * 50),
- color(220, 60, (float)Math.max(0, 1 - Math.pow((p.fy - model.yMin) / 10, 2)) * 100),
+ color(210, 20, (float)Math.max(0, 1 - Math.pow((model.yMax - p.y) / 10, 2)) * 50),
+ color(220, 60, (float)Math.max(0, 1 - Math.pow((p.y - model.yMin) / 10, 2)) * 100),
ADD);
for (Raindrop raindrop : raindrops) {
- if (p.fx >= (raindrop.p.x - raindrop.radius) && p.fx <= (raindrop.p.x + raindrop.radius) &&
- p.fy >= (raindrop.p.y - raindrop.radius) && p.fy <= (raindrop.p.y + raindrop.radius)) {
+ if (p.x >= (raindrop.p.x - raindrop.radius) && p.x <= (raindrop.p.x + raindrop.radius) &&
+ p.y >= (raindrop.p.y - raindrop.radius) && p.y <= (raindrop.p.y + raindrop.radius)) {
float d = raindrop.p.distanceTo(p) / raindrop.radius;
// float value = (float)Math.max(0, 1 - Math.pow(Math.min(0, d - raindrop.radius) / 5, 2));
if (d < 1) {
}
// returns TRUE if this should die
- boolean age(int ms) {
+ boolean age(double ms) {
if (!hasPeaked) {
- value = value + (ms / 1000.0f * ((attackParameter.getValuef() + 0.01) * 5));
+ value = value + (float) (ms / 1000.0f * ((attackParameter.getValuef() + 0.01) * 5));
if (value >= 1.0) {
value = 1.0;
hasPeaked = true;
}
return false;
} else {
- value = value - (ms / 1000.0f * ((decayParameter.getValuef() + 0.01) * 10));
+ value = value - (float) (ms / 1000.0f * ((decayParameter.getValuef() + 0.01) * 10));
return value <= 0;
}
}
flashes = new LinkedList<CubeFlash>();
}
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
leftoverMs += deltaMs;
float msPerFlash = 1000 / ((rateParameter.getValuef() + .01) * 100);
while (leftoverMs > msPerFlash) {
float prevRamp = 0;
float[] wobbleSpeeds = { 1.0/8, 1.0/4, 1.0/2, 1.0 };
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
float ramp = (float)lx.tempo.ramp();
if (ramp < prevRamp) {
beat = (beat + 1) % 32;
color c = 0;
for (Plane plane : planes) {
- normalizedPoint.x = p.fx - plane.center.x;
- normalizedPoint.y = p.fy - plane.center.y;
- normalizedPoint.z = p.fz - plane.center.z;
+ normalizedPoint.x = p.x - plane.center.x;
+ normalizedPoint.y = p.y - plane.center.y;
+ normalizedPoint.z = p.z - plane.center.z;
float v = plane.rotation.rotatedY(normalizedPoint);
float d = abs(v);
private float prevRamp = 0;
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
float ramp = lx.tempo.rampf();
float numBeats = (1 + ramp - prevRamp) % 1;
prevRamp = ramp;
// 1 -> 180
float hueSpread = (hueSpreadParameter.getValuef() - 0.5) * 360;
- float fadeAmount = (deltaMs / 1000.0) * pow(sharpnessParameter.getValuef() * 10, 1);
+ float fadeAmount = (float) (deltaMs / 1000.0) * pow(sharpnessParameter.getValuef() * 10, 1);
for (Pinwheel pw : pinwheels) {
pw.age(numBeats);
int value = 0;
for (Pinwheel pw : pinwheels) {
- value += (pw.isOnBlade(p.fx, p.fy - p.fz * zSlope) ? 1 : 0);
+ value += (pw.isOnBlade(p.x, p.y - p.z * zSlope) ? 1 : 0);
}
if (value == 1) {
values[i] = 1;
for (Strip s : model.strips) {
Vector3 v = new Vector3();
for (Point p : s.points) {
- v.add(p.fx, p.fy, p.fz);
+ v.add(p.x, p.y, p.z);
}
v.divide(s.points.size());
stripToCenter.put(s, v);
List<Strip> nearbyStrips = stripToNearbyStrips.get(s);
for (Point p : s.points) {
- Vector3 v = new Vector3(p.fx, p.fy, p.fz);
+ Vector3 v = new Vector3(p.x, p.y, p.z);
List<Point> neighbors = new ArrayList();
float closestPointDistance = 100000;
for (Point nsp : nearbyStrip.points) {
- float distance = v.distanceTo(nsp.fx, nsp.fy, nsp.fz);
+ float distance = v.distanceTo(nsp.x, nsp.y, nsp.z);
if (closestPoint == null || distance < closestPointDistance) {
closestPoint = nsp;
closestPointDistance = distance;
return m;
}
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
for (Point p : model.points) {
color c = colors[p.index];
colors[p.index] = color(hue(c), saturation(c), brightness(c) - 3);