Created
April 30, 2016 21:39
-
-
Save postspectacular/282a3d8524b86a9b2dfdc4411348ab17 to your computer and use it in GitHub Desktop.
3D particle system structs (full source: https://github.com/thi-ng/ws-ldn-8/blob/master/day3/ex07/particles.c)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// particle system structs | |
typedef struct { | |
float x,y,z; | |
} Vec3; | |
typedef struct { | |
Vec3 pos; // 12 bytes | |
Vec3 vel; // 12 bytes | |
Vec3 col; // 12 bytes | |
} Particle; | |
typedef struct { | |
Particle *particles; | |
uint32_t numParticles; | |
uint32_t maxParticles; | |
Vec3 emitPos; | |
Vec3 emitDir; | |
Vec3 gravity; | |
float speed; | |
uint32_t age; | |
uint32_t maxAge; | |
} ParticleSystem; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment