Permalink
Browse files

render city

  • Loading branch information...
1 parent c2a73c9 commit ca18c5a18de7446cdc28629edecc0c1e69bb8c61 @obviousjim committed May 8, 2012
@@ -19,6 +19,7 @@ class CloudInterludeParticle {
velocity = ofVec3f(0,0,0);
force = ofVec3f(0,0,0);
connectorEnergy = 0;
+ hasType = false;
}
void update(){
@@ -27,14 +28,16 @@ class CloudInterludeParticle {
direction = velocity.getNormalized();
force = ofVec3f(0,0,0);
energy--;
- connectorEnergy = MAX(connectorEnergy-1, 0);
+ connectorEnergy = MAX(connectorEnergy-1, 0);
+ energyPercent = energy/initialEnergy;
}
ofVec3f connectorPoint;
float connectorEnergy;
-
+ bool hasType;
float energy;
float initialEnergy;
+ float energyPercent;
ofVec3f origin;
ofVec3f position;
ofVec3f velocity;
@@ -29,11 +29,17 @@ class CloudInterludeParticleGenerator {
p.energy = p.initialEnergy = lifespan + ofRandom(-lifespanVariance/2, lifespanVariance/2);
p.origin = p.position = position;
p.velocity = direction;
+ if(showType && ofRandomuf() < typeChance){
+ p.hasType = true;
+ }
particles.push_back(p);
numToBear--;
remainingParticles--;
}
+ //sacrifice the rest
+ numToBear -= int(numToBear);
+
for(int i = 0; i < forces.size(); i++){
forces[i]->applyForce(particles);
}
@@ -92,7 +98,9 @@ class CloudInterludeParticleGenerator {
float lifespanVariance;
ofVec3f position;
ofVec3f direction;
-
+
+ bool showType;
+ float typeChance;
protected:
float numToBear;
};
Oops, something went wrong.

0 comments on commit ca18c5a

Please sign in to comment.