Skip to content

Commit

Permalink
disabled crashy schlabberbox
Browse files Browse the repository at this point in the history
  • Loading branch information
obviousjim committed Jun 29, 2014
1 parent 2a915e5 commit f19f979
Show file tree
Hide file tree
Showing 8 changed files with 766 additions and 16 deletions.
33 changes: 24 additions & 9 deletions CloudsLibrary/src/VisualSystems/Schlabberbox/vs_src/GridFluid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ void FluidBox::update() {
}

void FluidBox::draw() {

ofPushStyle();

float scaleMulti = width / (float)size;
int i = 0;
int j = 0;
Expand All @@ -133,11 +136,12 @@ void FluidBox::draw() {

float len = vel.lengthSquared();

if(len > .01)
if(len > .01){
meshVelocity.setVertex(j+1, (ofVec3f(ix, iy, iz) + vel * 6) * scaleMulti);
else
}
else{
meshVelocity.setVertex(j+1, ofVec3f(ix * scaleMulti, iy * scaleMulti, iz * scaleMulti));

}
/*
if(len > .01) {
float c = len * 100;
Expand All @@ -156,25 +160,34 @@ void FluidBox::draw() {
}
}
}
if(drawForceField)

if(drawForceField){
meshVelocity.draw();
}

ofSetColor(255);

std::vector<FluidParticle> skip;
vector<FluidParticle> skip;

//TODO: optimize this for performance

if(drawLines) {
for(std::vector<FluidParticle>::iterator it = particles.begin(); it<particles.end(); it+=2) {

vector<FluidParticle> close;
vector<FluidParticle>::iterator it;
for(it = particles.begin(); it != particles.end(); it++) {

//vector<FluidParticle> close;
cout << " DRAWING PARTICLE " << endl;
nn.findPointsWithinRadius(*it, particleConnectDistance, nnMatches);

for (unsigned i = 0; i < nnMatches.size(); ++i) {
ofLine(*it * scaleMulti, particles[nnMatches[i].first] * scaleMulti);
}

if(it != particles.end()){
it++; //skip one
if(it == particles.end()){
break;
}
}
}
}

Expand All @@ -188,6 +201,8 @@ void FluidBox::draw() {
ofPopMatrix();
}
}

ofPopStyle();
}

void FluidBox::addVelocity(int x, int y, int z, float amountX, float amountY, float amountZ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ class FluidBox {
unsigned int size;

/** Location of "marker particles" that represent the fluid. */
std::vector<FluidParticle> particles;
vector<FluidParticle> particles;

FluidBox();

~FluidBox();

void setup(int nSize, float viscosity = 0.001);
Expand Down
55 changes: 55 additions & 0 deletions VSSchlabberbox/VSSchlabberbox.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openframeworksLib", "..\..\..\libs\openFrameworksCompiled\project\vs\openframeworksLib.vcxproj", "{5837595D-ACA9-485C-8E76-729040CE4B0B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ofxUILib", "..\..\..\addons\ofxUI\ofxUILib\ofxUILib.vcxproj", "{641DB976-E775-4D72-86EB-897E2C4A0EEE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ofxTimelineLib", "..\..\..\addons\ofxTimeline\ofxTimelineLib\ofxTimelineLib.vcxproj", "{A72C4F16-CB16-4143-BA5C-5E4FA802D636}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VSSchlabberbox", "VSSchlabberbox.vcxproj", "{7FD42DF7-442E-479A-BA76-D0022F99702A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Debug|Win32.ActiveCfg = Debug|Win32
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Debug|Win32.Build.0 = Debug|Win32
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Debug|x64.ActiveCfg = Debug|x64
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Debug|x64.Build.0 = Debug|x64
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Release|Win32.ActiveCfg = Release|Win32
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Release|Win32.Build.0 = Release|Win32
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Release|x64.ActiveCfg = Release|x64
{5837595D-ACA9-485C-8E76-729040CE4B0B}.Release|x64.Build.0 = Release|x64
{641DB976-E775-4D72-86EB-897E2C4A0EEE}.Debug|Win32.ActiveCfg = Debug|Win32
{641DB976-E775-4D72-86EB-897E2C4A0EEE}.Debug|Win32.Build.0 = Debug|Win32
{641DB976-E775-4D72-86EB-897E2C4A0EEE}.Debug|x64.ActiveCfg = Debug|x64
{641DB976-E775-4D72-86EB-897E2C4A0EEE}.Debug|x64.Build.0 = Debug|x64
{641DB976-E775-4D72-86EB-897E2C4A0EEE}.Release|Win32.ActiveCfg = Release|Win32
{641DB976-E775-4D72-86EB-897E2C4A0EEE}.Release|Win32.Build.0 = Release|Win32
{641DB976-E775-4D72-86EB-897E2C4A0EEE}.Release|x64.ActiveCfg = Release|x64
{641DB976-E775-4D72-86EB-897E2C4A0EEE}.Release|x64.Build.0 = Release|x64
{A72C4F16-CB16-4143-BA5C-5E4FA802D636}.Debug|Win32.ActiveCfg = Debug|Win32
{A72C4F16-CB16-4143-BA5C-5E4FA802D636}.Debug|Win32.Build.0 = Debug|Win32
{A72C4F16-CB16-4143-BA5C-5E4FA802D636}.Debug|x64.ActiveCfg = Debug|x64
{A72C4F16-CB16-4143-BA5C-5E4FA802D636}.Debug|x64.Build.0 = Debug|x64
{A72C4F16-CB16-4143-BA5C-5E4FA802D636}.Release|Win32.ActiveCfg = Release|Win32
{A72C4F16-CB16-4143-BA5C-5E4FA802D636}.Release|Win32.Build.0 = Release|Win32
{A72C4F16-CB16-4143-BA5C-5E4FA802D636}.Release|x64.ActiveCfg = Release|x64
{A72C4F16-CB16-4143-BA5C-5E4FA802D636}.Release|x64.Build.0 = Release|x64
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Debug|Win32.ActiveCfg = Debug|Win32
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Debug|Win32.Build.0 = Debug|Win32
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Debug|x64.ActiveCfg = Debug|x64
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Debug|x64.Build.0 = Debug|x64
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Release|Win32.ActiveCfg = Release|Win32
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Release|Win32.Build.0 = Release|Win32
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Release|x64.ActiveCfg = Release|x64
{7FD42DF7-442E-479A-BA76-D0022F99702A}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Loading

0 comments on commit f19f979

Please sign in to comment.