X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=DanUtil.pde;h=44478befa3c5c8c6173bc1fe864d39497a65af9e;hb=e0b9d8726c661f54f47340449037ac7f6b410de6;hp=c3e899033c3d8cd7168caab13efd82e5fe108332;hpb=ab65d40b549a354ba5f70b08c29d35d0971243cf;p=SugarCubes.git diff --git a/DanUtil.pde b/DanUtil.pde index c3e8990..44478be 100644 --- a/DanUtil.pde +++ b/DanUtil.pde @@ -124,8 +124,8 @@ public class DPat extends SCPattern updateLights(); } - DPat(GLucose glucose) { - super(glucose); + DPat(LX lx) { + super(lx); pSpark = addParam("Sprk", 0); pWave = addParam("Wave", 0); @@ -250,7 +250,7 @@ class dVertex { dVertex(Strip _s, LXPoint _p) { s = _s; ci = _p.index; } LXPoint getPoint(int i) { return s.points.get(dir>0 ? i : 15-i); } - void setOpp( dVertex _opp) { opp = _opp; dir = (ci < opp.ci ? 1 : -1); } + void setOpp(dVertex _opp) { opp = _opp; dir = (ci < opp.ci ? 1 : -1); } } //---------------------------------------------------------------------------------------------------------------------------------- class dPixel { dVertex v; int pos; dPixel(dVertex _v, int _pos) { v=_v; pos=_pos; } } @@ -287,7 +287,7 @@ class dLattice { dPixel getClosest(PVector p) { dVertex v = null; int pos=0; float d = 500; - for (Strip s : glucose.model.strips) { + for (Strip s : model.strips) { float nd = pd2(s.points.get(0),p.x,p.y,p.z); if (nd < d) { v=v0(s); d=nd; pos=0; } if (nd > 30) continue; for (int k=0; k<=15; k++) { @@ -300,13 +300,13 @@ class dLattice { dLattice() { lattice=this; - for (Strip s : glucose.model.strips) { + for (Strip s : model.strips) { dVertex vrtx0 = new dVertex(s,s.points.get(0 )); s.obj1=vrtx0; dVertex vrtx1 = new dVertex(s,s.points.get(15)); s.obj2=vrtx1; vrtx0.setOpp(vrtx1); vrtx1.setOpp(vrtx0); } - for (Strip s1 : glucose.model.strips) { for (Strip s2 : glucose.model.strips) { + for (Strip s1 : model.strips) { for (Strip s2 : model.strips) { if (s1.points.get(0).index < s2.points.get(0).index) continue; int c=0; if (sameSame(s1,s2)) { v0(s1).same = v0(s2); v1(s1).same = v1(s2);