Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/casensiom/particle_emitter
Header only 3D Particle Emitter in C99
https://github.com/casensiom/particle_emitter
Last synced: about 1 month ago
JSON representation
Header only 3D Particle Emitter in C99
- Host: GitHub
- URL: https://github.com/casensiom/particle_emitter
- Owner: casensiom
- License: mit
- Created: 2023-11-28T01:29:28.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-29T00:05:02.000Z (about 1 year ago)
- Last Synced: 2023-11-29T02:35:40.271Z (about 1 year ago)
- Language: C
- Size: 109 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Particle Emitter
![Thumbnail](./thumbnail.png)
Header only 3D Particle Emitter in C99
## About
[![Build Status](https://github.com/casensiom/particle_emitter/actions/workflows/cmake-multi-platform.yml/badge.svg)](https://github.com/casensiom/particle_emitter/actions)
This library computes 3d particles in pure C99.
![Thumbnail](./thumbnail.gif)
The example uses [raylib](https://www.raylib.com) as a render engine.
## How to use
This library follows [single-file C/C++ public domain libraries](https://github.com/nothings/single_file_libs) rules.
Include the header file and the definition to include the implementation code in just one of the includes.
```c
#define PARTICLE_EMITTER_IMPLEMENTATION
#include "particle_emitter.h"
```Refer the [examples](https://github.com/casensiom/particle_emitter/examples/exmaple0.c) to see the library usage.
### Create
Creates the emitter
```c
EmitConfiguration configuration;
configuration.particlesPerSecond = 30;
(...)
Emitter emitter = particle_emitter_create(configuration);
```### Update
Update the particles
```c
particle_emitter_update(&emitter, dt);
```### Destroy
Destroys the emitter
```c
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