Cracker64 please read - about eqve

  • me4502
    29th Jun 2011 Member 0 Permalink
    Hi,

    @Cracker64
    do you still have the coding for PT_EQUALVEL?
    if you do could i please have it as i was going to look at it and imrpove it(if possible) :D

    Thanks
    edit:::

    its not on github in the commit PT_EQUALVEL was added to powder.h
    Edited by me4502, 2011-06-28 03:39:32
  • dnerd
    29th Jun 2011 Member 0 Permalink
    @me4502 (View Post)
    I asked this a while ago, at that time he didn't so i doubt he has it now.
  • me4502
    29th Jun 2011 Member 0 Permalink
    @dnerd (View Post)
    well if he didnt have it beofre it cant just magically re appear so...

    Mods please lock this topic... or @cracker64... could u just basically say what sort of things you did and i could code myselfl?

    Thanks
  • Pilihp64
    29th Jun 2011 Developer 0 Permalink
    well it is pretty self-explanatory what it did, equal velocity. Every frame it averaged the velocity plus some from the vx/vy maps, and set it for each particle. That was pretty much it, anything else i did was just some improvements to make it look better. (i think removing collisions from itself helped)
  • me4502
    29th Jun 2011 Member 0 Permalink
    @cracker64 (View Post)
    Thanks :D

    edit:::

    int update_EQUALVEL(UPDATE_FUNC_ARGS) {
    int r,rx,ry;
    for(rx=-3; rx<4; rx++)<br /> for(ry=-3; ry<4; ry++)<br /> if(x+rx>=0 && y+ry>0 && x+rx {
    r = pmap[y+ry][x+rx];
    if((r>>PS)>=NPART || !r)
    continue;
    if (rx == -3 && ry == -3 || parts[i].num == 0){
    parts[i].a1 = parts[r>>PS].vx;
    parts[i].ay1 = parts[r>>PS].vy;
    parts[i].num = 1;
    } else if (parts[i].num > 9) {
    if (parts[i].num==2){
    parts[i].a2 = parts[r>>PS].vx;
    parts[i].ay2 = parts[r>>PS].vy;
    } else if (parts[i].num==3){
    parts[i].a3 = parts[r>>PS].vx;
    parts[i].ay3 = parts[r>>PS].vy;
    } else if (parts[i].num==4){
    parts[i].a4 = parts[r>>PS].vx;
    parts[i].ay4 = parts[r>>PS].vy;
    } else if (parts[i].num==5){
    parts[i].a5 = parts[r>>PS].vx;
    parts[i].ay5 = parts[r>>PS].vy;
    } else if (parts[i].num==6){
    parts[i].a6 = parts[r>>PS].vx;
    parts[i].ay6 = parts[r>>PS].vy;
    } else if (parts[i].num==7){
    parts[i].a7 = parts[r>>PS].vx;
    parts[i].ay7 = parts[r>>PS].vy;
    } else if (parts[i].num==8){
    parts[i].a8 = parts[r>>PS].vx;
    parts[i].ay8 = parts[r>>PS].vy;
    }
    parts[i].num++;
    } else {
    int tmpx = parts[i].a1 + parts[i].a2 + parts[i].a3 + parts[i].a4 + parts[i].a5 + parts[i].a6 + parts[i].a7 + parts[i].a8;
    int tmpy = parts[i].ay1 + parts[i].ay2 + parts[i].ay3 + parts[i].ay4 + parts[i].ay5 + parts[i].ay6 + parts[i].ay7 + parts[i].ay8;
    parts[i].vx = tmpx / 8;
    parts[i].vy = tmpy / 8;
    parts[i].num = 0;
    }
    }
    return 0;
    }
    Edited by me4502, 2011-06-28 08:29:00
  • Jammy45
    29th Jun 2011 Member 0 Permalink
    This post has been removed by Sylvi: Necro