15#ifndef OSGPARTICLE_MULTISEGMENT_PLACER
16#define OSGPARTICLE_MULTISEGMENT_PLACER 1
53 inline void setVertex(
int i,
float x,
float y,
float z);
59 inline void addVertex(
float x,
float y,
float z);
68 inline float volume()
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;
Vec3f Vec3
Definition Vec3:21
The osgParticle library is a NodeKit that extends the core scene graph to support particle effects.
Definition AccelOperator:27
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
const osg::Vec3 & getVertex(int i) const
Get a vertex.
Definition MultiSegmentPlacer:95
META_Object(osgParticle, MultiSegmentPlacer)
void addVertex(const osg::Vec3 &v)
Add a vertex.
Definition MultiSegmentPlacer:112
virtual ~MultiSegmentPlacer()
Definition MultiSegmentPlacer:74
float volume() const
return the length of the multi-segment
Definition MultiSegmentPlacer:133
int numVertices() const
Get the number of vertices which define the segments.
Definition MultiSegmentPlacer:90
osg::Vec3 getControlPosition() const
return the control position
Definition MultiSegmentPlacer:138
MultiSegmentPlacer(const MultiSegmentPlacer ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
void place(Particle *P) const
Place a partice. Called automatically by ModularEmitter, do not call this method manually.
MultiSegmentPlacer & operator=(const MultiSegmentPlacer &)
Definition MultiSegmentPlacer:75
void removeVertex(int i)
Remove a vertex.
Definition MultiSegmentPlacer:127
void setVertex(int i, const osg::Vec3 &v)
Set a vertex.
Definition MultiSegmentPlacer:100
Implementation of a particle.
Definition Particle:47
Placer()
Definition Placer:56
#define OSGPARTICLE_EXPORT
Definition Export:40