Closed DarthSharkie closed 3 weeks ago
This allocates Bezier curves as needed at the polygon level instead of allocating on every draw step.
Test code:
ParticlePolygon polygon = ParticlePolygon.builder() .size(2f) .sides(9) .amount(75) .particleEffect(ParticleTypes.END_ROD) .offset(new Vector3f(4f, 2f, 5f)) .beforeDraw((data, obj) -> { obj.setSize(data.getCurrentStep() / 150.0f + 2f); obj.setSides(Math.floorDiv(data.getCurrentStep(), 100) + 3); obj.setRoundness((float) Math.sin(Math.PI * data.getCurrentStep() / 150f)); }) .build(); PointAnimator pointAnimator = PointAnimator.builder().point(new Vector3f()).delay(1).renderingSteps(600) .particleObject(polygon).build(); pointAnimator.beginAnimation(ApelServerRenderer.create(world));
This allocates Bezier curves as needed at the polygon level instead of allocating on every draw step.
Test code: