void copyVaryings(Varyings* out,const Varyings* src) { vec4Copy(out->loc,src->loc); vec3Copy(out->color,src->color); unsigned i; for(i=0;i<out->numAttributes;++i) { unsigned n = out->attributes[i].numValues; vecNCopy(n,out->attributePtrs[i],src->attributePtrs[i]); } }
static void add(struct particle_emitter *emit, struct pool *pool) { struct particle p; vec3Copy(emit->loc, p.loc); vec3Copy(emit->dir, p.dir); p.tex[0] = 0.0; p.tex[1] = 0.0; vec4Copy(emit->clr, p.clr); // vec4Set(p.clr, 1.0, 2.0, 3.0, 4.0); vec3Set(p.acc, 0.0, 0.0, 0.0); vec3Set(p.vel, 0.0, 0.0, 0.0); p.life = emit->life; p.mass = emit->mass; poolAdd(pool, &p); /* fprintf(stderr, "EMIT %d\n", pool->id); particlesDump(pool); */ }