public void draw() { g.clear(); g.noDepthTest(); _myArcball.draw(g); g.blend(); g.color(255, 50); _myParticles.renderer().mesh().draw(g); }
public void update(final float theDeltaTime) { _myTargetForce.strength(_cTargetStrength); _myTargetForce.lookAhead(_cLookAhead); _myTargetForce.maxForce(_cMaxForce); _myTime += 1 / 30f * _cNoiseSpeed; _myParticles.update(theDeltaTime); _myForceField.noiseOffset(new CCVector3f(_myTime * 0.5f, 0, 0)); _myForceField.noiseScale(_cNoiseScale); _myForceField.strength(_cNoiseStrength); _myViscousDrag.drag(_cDrag); _myGravity.direction().set(_cGravityX, _cGravityY, _cGravityZ); _myGravity.strength(_cGravityStrength); }
@Override public void keyPressed(final CCKeyEvent theEvent) { switch (theEvent.keyCode()) { case VK_S: _myTileSaver.init("export_tile3/" + frameCount + ".png", 5); g.pointSize(10); // CCScreenCapture.capture("export/"+frameCount+".png", width, height); break; case VK_R: g.pointSize(1); // _myBasicShader.reload(); // _myColorScaleShader.reload(); break; case VK_D: g.pointSize(1); _myParticles.reset(); for (int i = 0; i < 700 * 700; i++) { _myEmitter.emit(new CCVector3f(0, 0, 0), CCVecMath.random3f(10), 10, true); } break; default: } }