dynamic.cc
Go to the documentation of this file.
1 #include "stage.hh"
2 using namespace Stg;
3 
4 
5 // Stage calls this when the model starts up
6 extern "C" int Init( Model* mod )
7 {
8  printf( "Creating 100 models" );
9 
10  for( int i=0; i<100; i++ )
11  {
12  Model* child = mod->GetWorld()->CreateModel( mod, "model" );
13  assert(child);
14 
15  child->SetPose( Pose::Random( -1, 1, -1, 1 ) );
16  child->SetGeom( Geom( Pose(), Stg::Size( 0.1, 0.1, 0.1 ) ));
17  child->SetColor( Color(0,0,1,1) );
18  }
19  return 0; //ok
20 }
21 
Model class
Definition: stage.hh:1742
The Stage library uses its own namespace.
Definition: canvas.hh:8
void SetPose(const Pose &pose)
Definition: model.cc:1396
void Init(int *argc, char **argv[])
Definition: stage.cc:18
World * GetWorld() const
Definition: stage.hh:2302
static Pose Random(meters_t xmin, meters_t xmax, meters_t ymin, meters_t ymax)
Definition: stage.hh:268
void SetGeom(const Geom &src)
Definition: model.cc:1243
Model * CreateModel(Model *parent, const std::string &typestr)
Definition: world.cc:328
void SetColor(Color col)
Definition: model.cc:1260


stage
Author(s): Richard Vaughan , Brian Gerkey , Reed Hedges , Andrew Howard , Toby Collett , Pooya Karimian , Jeremy Asher , Alex Couture-Beil , Geoff Biggs , Rich Mattes , Abbas Sadat
autogenerated on Mon Jun 10 2019 15:06:09