remove old particle system.
also removed quat, dquat, and sumohandle from the Object struct since they aren't used anywhere.
This commit is contained in:
@@ -2866,143 +2866,6 @@ static int drawDispList(Base *base, int dt)
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* ******************************** */
|
||||
|
||||
|
||||
static void draw_particle_system(Base *base, PartEff *paf)
|
||||
{
|
||||
Object *ob= base->object;
|
||||
Particle *pa;
|
||||
float ptime, ctime, vec[3], vec1[3], mat[4][4];
|
||||
int a, totpart;
|
||||
|
||||
pa= paf->keys;
|
||||
// FSPARTICLE always rebuild fluid particle system upon change...
|
||||
if( (pa==NULL)
|
||||
|| ( (ob->fluidsimFlag & OB_FLUIDSIM_ENABLE) && (ob->fluidsimSettings) && (ob->fluidsimSettings->type == OB_FLUIDSIM_PARTICLE))
|
||||
) {
|
||||
build_particle_system(ob);
|
||||
pa= paf->keys;
|
||||
if(pa==NULL) return;
|
||||
}
|
||||
|
||||
myloadmatrix(G.vd->viewmat);
|
||||
/* flag abuse... but I need working code too now. This feature doesnt work for per frame animated objects */
|
||||
if( (base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP) ) {
|
||||
Mat4MulMat4(mat, paf->imat, ob->obmat);
|
||||
mymultmatrix(mat);
|
||||
}
|
||||
|
||||
if(ob->ipoflag & OB_OFFS_PARTICLE) ptime= give_timeoffset(ob);
|
||||
else ptime= 0.0;
|
||||
ctime= bsystem_time(ob, (float)(G.scene->r.cfra), ptime);
|
||||
|
||||
glPointSize(1.0);
|
||||
|
||||
if(paf->stype==PAF_VECT) glBegin(GL_LINES);
|
||||
else glBegin(GL_POINTS);
|
||||
|
||||
totpart= (paf->disp*paf->totpart)/100;
|
||||
for(a=0; a<totpart; a++, pa+=paf->totkey) {
|
||||
|
||||
if(ctime > pa->time) {
|
||||
if(ctime < pa->time+pa->lifetime) {
|
||||
|
||||
if(paf->stype==PAF_VECT) {
|
||||
where_is_particle(paf, pa, ctime, vec);
|
||||
where_is_particle(paf, pa, ctime+1.0, vec1);
|
||||
|
||||
glVertex3fv(vec);
|
||||
glVertex3fv(vec1);
|
||||
}
|
||||
else {
|
||||
where_is_particle(paf, pa, ctime, vec);
|
||||
|
||||
glVertex3fv(vec);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
|
||||
myloadmatrix(G.vd->viewmat);
|
||||
mymultmatrix(ob->obmat); // bring back local matrix for dtx
|
||||
}
|
||||
|
||||
static void draw_static_particle_system(Object *ob, PartEff *paf, int dt)
|
||||
{
|
||||
Particle *pa;
|
||||
float ctime, mtime, vec[3], veco[3];
|
||||
int a, use_norm=0, totpart;
|
||||
|
||||
pa= paf->keys;
|
||||
// FSPARTICLE always rebuild upon change...
|
||||
if( (pa==NULL)
|
||||
|| ( (ob->fluidsimFlag & OB_FLUIDSIM_ENABLE) && (ob->fluidsimSettings) && (ob->fluidsimSettings->type == OB_FLUIDSIM_PARTICLE))
|
||||
) {
|
||||
build_particle_system(ob);
|
||||
pa= paf->keys;
|
||||
if(pa==NULL) return;
|
||||
}
|
||||
|
||||
if(paf->stype==PAF_VECT) {
|
||||
if(dt>OB_WIRE) {
|
||||
|
||||
/* shaded/texture mode: we still draw solid, so have to set materials */
|
||||
if(dt>OB_SOLID) init_gl_materials(ob, 0);
|
||||
|
||||
glEnable(GL_LIGHTING);
|
||||
set_gl_material(paf->omat);
|
||||
use_norm= 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
glPointSize(1.0);
|
||||
glBegin(GL_POINTS);
|
||||
}
|
||||
|
||||
totpart= (paf->disp*paf->totpart)/100;
|
||||
for(a=0; a<totpart; a++, pa+=paf->totkey) {
|
||||
|
||||
if(paf->stype==PAF_VECT) {
|
||||
|
||||
glBegin(GL_LINE_STRIP);
|
||||
where_is_particle(paf, pa, pa->time, veco);
|
||||
|
||||
mtime= pa->time+pa->lifetime+paf->staticstep;
|
||||
for(ctime= pa->time+paf->staticstep; ctime<mtime; ctime+=paf->staticstep) {
|
||||
|
||||
where_is_particle(paf, pa, ctime, vec);
|
||||
|
||||
if(use_norm) {
|
||||
float no[3];
|
||||
VECSUB(no, vec, veco);
|
||||
glNormal3fv(no);
|
||||
}
|
||||
glVertex3fv(veco);
|
||||
VECCOPY(veco, vec);
|
||||
}
|
||||
|
||||
glVertex3fv(veco);
|
||||
glEnd();
|
||||
}
|
||||
else {
|
||||
mtime= pa->time+pa->lifetime+paf->staticstep-1;
|
||||
for(ctime= pa->time; ctime<mtime; ctime+=paf->staticstep) {
|
||||
where_is_particle(paf, pa, ctime, vec);
|
||||
glVertex3fv(vec);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(paf->stype==PAF_VECT) {
|
||||
glDisable(GL_LIGHTING);
|
||||
}
|
||||
else {
|
||||
glEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* unified drawing of all new particle systems draw types except dupli ob & group */
|
||||
/* mostly tries to use vertex arrays for speed */
|
||||
|
||||
@@ -4983,17 +4846,6 @@ void draw_object(Base *base, int flag)
|
||||
if (!(base->flag&OB_RADIO)) {
|
||||
empty_object= draw_mesh_object(base, dt, flag);
|
||||
if(flag!=DRAW_CONSTCOLOR) dtx &= ~OB_DRAWWIRE; // mesh draws wire itself
|
||||
|
||||
if(G.obedit!=ob && warning_recursive==0) {
|
||||
PartEff *paf = give_parteff(ob);
|
||||
|
||||
if(paf) {
|
||||
if(col || (ob->flag & SELECT)) cpack(0xFFFFFF); /* for visibility, also while wpaint */
|
||||
if(paf->flag & PAF_STATIC) draw_static_particle_system(ob, paf, dt);
|
||||
else if((flag & DRAW_PICKING) == 0) draw_particle_system(base, paf); // selection errors happen to easy
|
||||
if(col) cpack(col);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user