Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4379 in orxonox.OLD for orxonox/trunk/src/subprojects


Ignore:
Timestamp:
May 29, 2005, 2:41:50 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: preparing to add fields to the particles-demo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/subprojects/particles/particle_fun.cc

    r4378 r4379  
    3535#define PINIT_PARTICLE_MASS          1.0
    3636
     37
     38Field* twirl;
     39Field* gravity;
     40Field* pointGravity;
     41
    3742void Framework::moduleInit(int argc, char** argv)
    3843{
     
    5560  emitter->setType(PINIT_EMITTER_TYPE);
    5661  emitter->setSize(PINIT_EMITTER_SIZE);
     62  emitter->setAbsCoor(Vector(3,0,0));
    5763  // Add the Flow from the Emitter into the System
    5864  ParticleEngine::getInstance()->addConnection(emitter, system);
    5965
    6066
    61   Field* twirl = new Twirl();
    62   twirl->setMagnitude(.1);
    63   new PhysicsConnection(system, twirl);
     67  twirl = new Twirl();
     68  twirl->setMagnitude(10);
     69  gravity = new Gravity();
     70  pointGravity = new PointGravity();
    6471}
    6572
     
    200207}
    201208
     209int fieldsChange(GtkWidget* nonInterest, void* widget)
     210{
     211  Option* option = (Option*) widget;
     212  const char* name = option->getTitle();
     213  char* value = option->save();
     214
     215
     216  if (!strcmp(name, "Twirl"))
     217    {
     218      if (static_cast<CheckButton*>(option)->isActive())
     219        new PhysicsConnection(ParticleEngine::getInstance()->getSystemByNumber(1), twirl);
     220      else
     221        ;
     222    }
     223
     224}
    202225
    203226void Framework::moduleInitGui(int argc, char** argv)
     
    209232  guiMainWindow = new Window("ParticlesFUN");
    210233  {
    211     Box* windowBox = new Box('v');
     234    Box* windowBox = new Box('h');
    212235    {
    213236      Frame* emitterFrame = new Frame("emitter-settings");
     
    318341      }
    319342      windowBox->fill(systemFrame);
     343
     344      Frame* fieldsFrame = new Frame("Field-Settings");
     345      {
     346        Box* fieldsBox = new Box('v');
     347        {
     348          CheckButton* Twirl = new CheckButton("Twirl");
     349          Twirl->connectSignal("clicked", (void*)Twirl, fieldsChange);
     350          fieldsBox->fill(Twirl);
     351        }
     352        fieldsFrame->fill(fieldsBox);
     353      }
     354      windowBox->fill(fieldsFrame);
    320355     
    321356      Button* quitButton = new Button("quit");
Note: See TracChangeset for help on using the changeset viewer.