Skip to content

casensiom/particle_emitter

Repository files navigation

Particle Emitter

Thumbnail

Header only 3D Particle Emitter in C99

About

Build Status

This library computes 3d particles in pure C99.

Thumbnail

The example uses raylib as a render engine.

How to use

This library follows single-file C/C++ public domain libraries rules.

Include the header file and the definition to include the implementation code in just one of the includes.

#define PARTICLE_EMITTER_IMPLEMENTATION
#include "particle_emitter.h"

Refer the examples to see the library usage.

Create

Creates the emitter

EmitConfiguration configuration;
configuration.particlesPerSecond = 30;
(...)
Emitter emitter = particle_emitter_create(configuration);

Update

Update the particles

particle_emitter_update(&emitter, dt);

Destroy

Destroys the emitter

particle_emitter_destroy(&emitter);

Features

  • General forces (gravity, wind)
  • Attraction / Repulsion vortices
  • Friction
  • Particle attributes
    • rotation
    • scale
    • color

Roadmap

  • Implement an editor
  • Load and save presets
  • Support more attributes

About

Header only 3D Particle Emitter in C99

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published