Skip to content

Instantly share code, notes, and snippets.

@postspectacular
Created April 30, 2016 21:39
Show Gist options
  • Save postspectacular/282a3d8524b86a9b2dfdc4411348ab17 to your computer and use it in GitHub Desktop.
Save postspectacular/282a3d8524b86a9b2dfdc4411348ab17 to your computer and use it in GitHub Desktop.
// 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