void Path2dApp::setup(){
  thread.setup();
  controller = new ParticleController();
  controller->setup();
  mPerlin = Perlin();
  mImage = gl::Texture( loadImage( loadResource( "header.png" ) ) );
}
Exemple #2
0
void Box2DTestApp::setup()
{
	mousePressed = false;

	// first define a ground box (no mass)
	// 1. define a body
	b2BodyDef groundBodyDef;
	groundBodyDef.position.Set(Conversions::toPhysics(app::getWindowWidth()/2), Conversions::toPhysics(app::getWindowHeight())); // pos of ground

	// 2. use world to create body
	b2Body* groundBody = world.CreateBody(&groundBodyDef);

	// 3. define fixture
	b2PolygonShape groundBox;
	groundBox.SetAsBox(Conversions::toPhysics(app::getWindowWidth()/2), Conversions::toPhysics(1.0f)); // size the ground

	// 4. create fixture on body
	groundBody->CreateFixture(&groundBox, 0.0f);

	// pass world to ParticleController
	particleController.setup(world);
}