Apel is a library that brings particle animations to the table with flexible behaviour and a clean developer interface. It promises also lots of predefined shapes & paths to help the developer on their particle scene
By inserting a renderer, the developer can now control how and where particles are rendered. Right now, the only option is still via ServerWorld, so this seems simple. Future options will include the ability to "bake" an animation, send the rendering instructions to the client, and potentially more destinations.
ApelRenderer is an interface that all renderers should satisfy, and it is currently used as a factory for producing instances. This may change, but that will evolve as more renderers come along and have one or more options to configure them.
Once an animation is baked (perhaps via ApelBakingRenderer), loading that file to a (future) ReplayAnimator would then be able to use the existing ApelServerWorldRenderer to display it. Once packets are ready, it could use a ApelPacketRenderer.
Super simple example code:
void animate(ServerWorld world, PlayerEntity user) {
// Setup a line
Vector3f start = new Vector3f(-3, 1, 1);
Vector3f end = new Vector3f(3, 1, 1);
ParticleLine line1 = new ParticleLine(ParticleTypes.COMPOSTER, start, end, 5);
// Setup an Animator
Vector3f origin = user.getPos().toVector3f().add(0, 1, 4);
PointAnimator animator = new PointAnimator(1, line1, origin, 100);.
// Perform the animation
animator.beginAnimation(ApelRenderer.create(world));
}
By inserting a renderer, the developer can now control how and where particles are rendered. Right now, the only option is still via
ServerWorld
, so this seems simple. Future options will include the ability to "bake" an animation, send the rendering instructions to the client, and potentially more destinations.ApelRenderer
is an interface that all renderers should satisfy, and it is currently used as a factory for producing instances. This may change, but that will evolve as more renderers come along and have one or more options to configure them.Once an animation is baked (perhaps via
ApelBakingRenderer
), loading that file to a (future)ReplayAnimator
would then be able to use the existingApelServerWorldRenderer
to display it. Once packets are ready, it could use aApelPacketRenderer
.Super simple example code: