/** * Based on fisica.FPoly by Ricard Marxer. * http://www.ricardmarxer.com/fisica/ * http://www.gitorious.com/fisica/fisica/blobs/master/src/fisica/FPoly.java * * Copyright (c) 2010 LAFKON/Benjamin Stephan. * * This is free software, and you may redistribute it under the GPL. * This Software comes with absolutely no warranty. * For details see the license (http://www.lafkon.net/gpl.txt) * * http://www.forkable.eu/generators/va300/ * http://www.lafkon.net/what/is/va300 */ // This is the live-version, made for continuous live projection! // For a pdf-outputting-version check the URLs above. // NOTE: These customized FPolyMinus and FPolyPlus-Classes would not be necessary // the way they are for this live-version. They are relicts from the pdf-output version. // A overwritten FBox would be the easier and more appropriate way for this live-version. public class FPolyPlus extends FPolyMinus { public FPolyPlus(){ super(); } public void setCollisionShape(RPoint[] points) { pnts = points; for ( int i = 0; i < pnts.length; i++ ) { this.vertex(pnts[i].x+startX, pnts[i].y+startY); } } public void setDrawShape(PShape drawshape) { drawShape = drawshape; drawShape.disableStyle(); } public void draw(PGraphics canvas) { if(visibility /*&& !resting*/) { canvas.pushStyle(); canvas.pushMatrix(); canvas.translate(getX(), getY()); canvas.rotate(getRotation()); canvas.ellipseMode(PConstants.CENTER); canvas.rectMode(PConstants.CENTER); appletFillStroke(canvas); //==================================================== if(invert) { canvas.fill(0); canvas.stroke(min(0+frameCount*2, 255)); if(frameCount >= -1000 && frameCount < -1) { canvas.stroke(0); } } else { canvas.fill(255); canvas.stroke(max(255-frameCount*2, 0)); if(frameCount >= -1000 && frameCount < -1) { canvas.stroke(255); } } setStrokeWeight(0.75); //canvas.stroke(max(255-frameCount*2,0)); //canvas.stroke(max(255-getY(),0)); //canvas.fill(max(255-frameCount/2,0)); //setStrokeWeight(0.15); //float muh = frameCount; /* if(muh < m_vertices.size()) { */ // draw CollisonShape ----------- /* canvas.beginShape(); for(int i = 0; i