15 #ifndef OSGPARTICLE_MULTISEGMENT_PLACER
16 #define OSGPARTICLE_MULTISEGMENT_PLACER 1
18 #include <osgParticle/Export>
19 #include <osgParticle/Placer>
20 #include <osgParticle/Particle>
44 inline int numVertices()
const;
47 inline const osg::Vec3& getVertex(
int i)
const;
50 inline void setVertex(
int i,
const osg::Vec3& v);
53 inline void setVertex(
int i,
float x,
float y,
float z);
56 inline void addVertex(
const osg::Vec3& v);
59 inline void addVertex(
float x,
float y,
float z);
62 inline void removeVertex(
int i);
68 inline float volume()
const;
71 inline osg::Vec3 getControlPosition()
const;
78 typedef std::pair<osg::Vec3, float> Vertex_data;
79 typedef std::vector<Vertex_data> Vertex_vector;
84 void recompute_length();
92 return static_cast<int>(_vx.size());
108 _vx[i].first.set(x, y, z);
115 if (_vx.size() > 0) {
116 l = (v - _vx.back().first).length();
119 _vx.push_back(std::make_pair(v, _total_length));
129 _vx.erase(_vx.begin()+i);
135 return _total_length;
140 return _vx.empty() ?
osg::Vec3(0.0f,0.0f,0.0f) : _vx[0].first;
float volume() const
return the length of the multi-segment
int numVertices() const
Get the number of vertices which define the segments.
virtual ~MultiSegmentPlacer()
osg::Vec3 getControlPosition() const
return the control position
void setVertex(int i, const osg::Vec3 &v)
Set a vertex.
const osg::Vec3 & getVertex(int i) const
Get a vertex.
#define OSGPARTICLE_EXPORT
void removeVertex(int i)
Remove a vertex.
MultiSegmentPlacer & operator=(const MultiSegmentPlacer &)
#define META_Object(library, name)
void addVertex(const osg::Vec3 &v)
Add a vertex.