Make my script react faster.
in
Contributed Library Questions
•
2 years ago
Hi everybody,
Can anybody look at my script and give me some advice to make it faster? FrameRate is now 10 or something :(
- for(int i=0; i< rValueAll[selectPerson].length-10; i++) {
- float RCircle = (float(rValueAll[selectPerson][i]) / maxTime) * (2*PI)-HALF_PI ; // user R de piek waarde
- float PCircle = (float(pValueAll[selectPerson][i]) / maxTime) * (2*PI)-HALF_PI ; // user R de piek waarde
- float TCircle = (float(tValueAll[selectPerson][i]) / maxTime) * (2*PI)-HALF_PI ; // user R de piek waarde
- // eerste
- float cr = cos(RCircle);
- float sr = sin(RCircle);
- Vec2D polar = new Vec2D(30,RCircle);
- Vec2D circ = polar.copy().toCartesian();
- Vec2D linear = new Vec2D((MathUtils.THREE_HALVES_PI + polar.y) * w2 / PI - (2*w2), 0);
- Vec2D dir = circ.getNormalized();
- circ.interpolateToSelf(linear, transition,is);
- dir.interpolateToSelf(normUp, transition,is).normalizeTo(len);
- line(circ.x, circ.y, circ.x + dir.x, circ.y + dir.y);
- Vec2D polar2 = new Vec2D(30,PCircle);
- Vec2D circ2 = polar2.copy().toCartesian();
- Vec2D linear2 = new Vec2D((MathUtils.THREE_HALVES_PI + polar2.y) * w2 / PI - (2*w2), 0);
- Vec2D dir2 = circ2.getNormalized();
- circ2.interpolateToSelf(linear2, transition,is);
- dir2.interpolateToSelf(normUp, transition,is).normalizeTo(len);
- pushMatrix();
- translate(0,len);
- line(circ2.x, circ2.y, circ2.x + dir2.x, circ2.y + dir2.y);
- popMatrix();
- Vec2D polar3 = new Vec2D(30,TCircle);
- Vec2D circ3 = polar3.copy().toCartesian();
- Vec2D linear3 = new Vec2D((MathUtils.THREE_HALVES_PI + polar3.y) * w2 / PI - (2*w2), 0);
- Vec2D dir3 = circ.getNormalized();
- circ3.interpolateToSelf(linear3, transition,is);
- dir3.interpolateToSelf(normUp, transition,is).normalizeTo(len);
- pushMatrix();
- translate(0,position1);
- line(circ3.x, circ3.y, circ3.x + dir3.x, circ3.y + dir3.y);
- popMatrix();
- }
- popMatrix();
1