15#ifndef OSGPARTICLE_COMPOSITEPLACER
16#define OSGPARTICLE_COMPOSITEPLACER
61 inline float volume()
const;
79 float current = 0.0f, selected = sizeRange.
get_random();
80 for ( PlacerList::const_iterator itr=
_placers.begin(); itr!=
_placers.end(); ++itr )
82 current += (*itr)->volume();
83 if ( selected<=current ) (*itr)->place( P );
89 float total_size = 0.0f;
90 for ( PlacerList::const_iterator itr=
_placers.begin(); itr!=
_placers.end(); ++itr )
91 total_size += (*itr)->volume();
98 return _placers.front()->getControlPosition();
Definition CompositePlacer:27
void setPlacer(unsigned int i, Placer *p)
Definition CompositePlacer:37
CompositePlacer(const CompositePlacer ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
Definition CompositePlacer:31
float volume() const
return the volume of the box
Definition CompositePlacer:87
std::vector< osg::ref_ptr< Placer > > PlacerList
Definition CompositePlacer:70
Placer * getPlacer(unsigned int i)
Get a child placer.
Definition CompositePlacer:51
const Placer * getPlacer(unsigned int i) const
Definition CompositePlacer:52
void addPlacer(Placer *p)
Add a child placer.
Definition CompositePlacer:44
META_Object(osgParticle, CompositePlacer)
void removePlacer(unsigned int i)
Remove a child placer.
Definition CompositePlacer:47
osg::Vec3 getControlPosition() const
return the control position
Definition CompositePlacer:95
CompositePlacer()
Definition CompositePlacer:29
virtual ~CompositePlacer()
Definition CompositePlacer:67
unsigned int getNumPlacers() const
Get number of placers.
Definition CompositePlacer:55
PlacerList _placers
Definition CompositePlacer:71
CompositePlacer & operator=(const CompositePlacer &)
Definition CompositePlacer:68
void place(Particle *P) const
Place a particle. Do not call it manually.
Definition CompositePlacer:76
@ SHALLOW_COPY
Definition CopyOp:47
Definition AccelOperator:27
Vec3f Vec3
Definition Vec3:21
ValueType get_random() const
Get a random value between min and max.
Definition range:57