From 3ef113335f0ca08580961ee5bcc4b2dd93bff0aa Mon Sep 17 00:00:00 2001 From: Stanislaw Skowronek Date: Sat, 16 Nov 2013 19:06:12 -0500 Subject: Let's try and not mix parts in a solid. diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index f0bd48c..197e01f 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -4788,29 +4788,37 @@ int Simulation::GetParticleType(std::string type) void Simulation::solid_respawn(int i, int pp, int dx, int dy) { int nx = (int)(parts[pp].x + 0.5f), ny = (int)(parts[pp].y + 0.5f); - int nc, t, pq; + int nc, s, t, pq, pr, pt[4]; if(pmap[ny+dy][nx+dx]) return; - nc = 1; - t = pmap[ny+2*dy][nx+2*dx]; if(t && parts[t >> 8].sld == i+1) nc ++; - t = pmap[ny+dy+dx][nx+dx+dy]; if(t && parts[t >> 8].sld == i+1) nc ++; - t = pmap[ny+dy-dx][nx+dx-dy]; if(t && parts[t >> 8].sld == i+1) nc ++; + pt[0] = pp; nc = 1; + t = pmap[ny+2*dy][nx+2*dx]; if(t && parts[t >> 8].sld == i+1) { pt[nc] = t >> 8; nc ++; } + t = pmap[ny+dy+dx][nx+dx+dy]; if(t && parts[t >> 8].sld == i+1) { pt[nc] = t >> 8; nc ++; } + t = pmap[ny+dy-dx][nx+dx-dy]; if(t && parts[t >> 8].sld == i+1) { pt[nc] = t >> 8; nc ++; } if(nc < 3) return; - pq = create_part(-1, nx+dx, ny+dy, parts[pp].type); + pr = pt[0]; + for(s=0; s> 8].x) * 0.5f; parts[pq].y = (parts[pp].y + parts[pmap[ny+2*dy][nx+2*dx] >> 8].y) * 0.5f; @@ -4868,10 +4876,10 @@ void Simulation::update_solids() nx = (int)(parts[pp].x + 0.5f); ny = (int)(parts[pp].y + 0.5f); if((pmap[ny][nx] >> 8) != pp) { - if(!pmap[ny][nx-1] || parts[pmap[ny][nx-1] >> 8].sld != i+1) continue; - if(!pmap[ny][nx+1] || parts[pmap[ny][nx+1] >> 8].sld != i+1) continue; - if(!pmap[ny-1][nx] || parts[pmap[ny-1][nx] >> 8].sld != i+1) continue; - if(!pmap[ny+1][nx] || parts[pmap[ny+1][nx] >> 8].sld != i+1) continue; + if(!pmap[ny][nx-1] || parts[pmap[ny][nx-1] >> 8].sld != i+1 || parts[pmap[ny][nx-1] >> 8].type != parts[pp].type) continue; + if(!pmap[ny][nx+1] || parts[pmap[ny][nx+1] >> 8].sld != i+1 || parts[pmap[ny][nx+1] >> 8].type != parts[pp].type) continue; + if(!pmap[ny-1][nx] || parts[pmap[ny-1][nx] >> 8].sld != i+1 || parts[pmap[ny-1][nx] >> 8].type != parts[pp].type) continue; + if(!pmap[ny+1][nx] || parts[pmap[ny+1][nx] >> 8].sld != i+1 || parts[pmap[ny+1][nx] >> 8].type != parts[pp].type) continue; pq = pmap[ny][nx] >> 8; if(fabs(parts[pq].vx) < fabs(parts[pp].vx)) parts[pq].vx = parts[pp].vx; diff --git a/src/simulation/elements/DMND.cpp b/src/simulation/elements/DMND.cpp index 9b86a84..9b49a1a 100644 --- a/src/simulation/elements/DMND.cpp +++ b/src/simulation/elements/DMND.cpp @@ -12,7 +12,7 @@ Element_DMND::Element_DMND() Advection = 0.0f; AirDrag = 0.00f * CFDS; AirLoss = 0.90f; - Loss = 0.00f; + Loss = 1.00f; Collision = 0.0f; Gravity = 0.0f; Diffusion = 0.00f; diff --git a/src/simulation/elements/TTAN.cpp b/src/simulation/elements/TTAN.cpp index b37ac61..7b4262d 100644 --- a/src/simulation/elements/TTAN.cpp +++ b/src/simulation/elements/TTAN.cpp @@ -11,7 +11,7 @@ Element_TTAN::Element_TTAN() Enabled = 1; Advection = 0.0f; - AirDrag = 0.02f * CFDS; + AirDrag = 0.00f * CFDS; AirLoss = 0.90f; Loss = 0.999f; Collision = 0.0f; -- cgit v0.9.2-21-gd62e