754755756757758759760761762763764
collisionsFound++; //we found a intersection with the plane if (intersect != null) { float distToP1 = intersect.distanceTo(p1); //dist to intersection float distToP2 = intersect.distanceTo(p2); //dist to intersection float distBetweenP1P2 = p1.distanceTo(p2); float percentBetween = distToP1 / distBetweenP1P2; //distBetweenP1P2; float percent = 0;
755756757758759760761762763764765
3435363738394041424344
if (prev.isZeroVector()) { prev.set(point.scale(scale)); } cur = point.scale(scale); float dist = cur.distanceTo(prev); dist = PApplet.constrain(dist, 1, 20); g.pushMatrix(); if (g.is3D()) { g.translate(cur.x, cur.y, cur.z);