15#ifndef OSGPARTICLE_PARTICLEPROCESSOR
16#define OSGPARTICLE_PARTICLEPROCESSOR 1
49 virtual const char*
libraryName()
const {
return "osgParticle"; }
50 virtual const char*
className()
const {
return "ParticleProcessor"; }
55 inline ReferenceFrame getReferenceFrame()
const;
58 inline void setReferenceFrame(ReferenceFrame rf);
62 inline bool isEnabled()
const;
65 inline void setEnabled(
bool v);
81 inline bool isEndless()
const;
84 inline void setLifeTime(
double t);
87 inline double getLifeTime()
const;
90 inline void setStartTime(
double t);
93 inline double getStartTime()
const;
96 inline void setCurrentTime(
double t);
99 inline double getCurrentTime()
const;
102 inline void setResetTime(
double t);
105 inline double getResetTime()
const;
114 inline bool isAlive()
const;
Vec3f Vec3
Definition Vec3:21
BoundingSphered BoundingSphere
Definition BoundingSphere:308
Matrixd Matrix
Definition Matrix:27
OSG_EXPORT Matrix computeLocalToWorld(const NodePath &nodePath, bool ignoreCameras=true)
Compute the matrix which transforms objects in local coords to world coords, by accumulating the Tran...
OSG_EXPORT Matrix computeWorldToLocal(const NodePath &nodePath, bool ignoreCameras=true)
Compute the matrix which transforms objects in world coords to local coords, by accumulating the Tran...
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
Vec3f preMult(const Vec3f &v) const
Definition Matrixd:618
Base class for all internal nodes in the scene graph.
Definition Node:72
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
virtual void apply(Drawable &drawable)
void pushOntoNodePath(Node *node)
Method called by osg::Node::accept() method before a call to the NodeVisitor::apply(....
Definition NodeVisitor:287
bool validNodeMask(const osg::Node &node) const
Method to called by Node and its subclass' Node::accept() method, if the result is true it is used to...
Definition NodeVisitor:221
void popFromNodePath()
Method called by osg::Node::accept() method after a call to NodeVisitor::apply(..).
Definition NodeVisitor:293
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
osg::Vec3 rotateWorldToLocal(const osg::Vec3 &P)
Transform a vector from world to local coordinates, discarding translation (valid only during cull tr...
Definition ParticleProcessor:321
double getLifeTime() const
Get the lifetime of this processor.
Definition ParticleProcessor:229
ReferenceFrame
Definition ParticleProcessor:41
@ RELATIVE_RF
Definition ParticleProcessor:42
@ ABSOLUTE_RF
Definition ParticleProcessor:43
void setStartTime(double t)
Set the start time of this processor.
Definition ParticleProcessor:234
virtual const char * className() const
return the name of the node's class type.
Definition ParticleProcessor:50
ParticleProcessor(const ParticleProcessor ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
bool isEndless() const
Definition ParticleProcessor:219
const osg::Matrix & getWorldToLocalMatrix()
Get the current world-to-local transformation matrix (valid only during cull traversal).
Definition ParticleProcessor:278
const osg::Matrix & getLocalToWorldMatrix()
Get the current local-to-world transformation matrix (valid only during cull traversal).
Definition ParticleProcessor:263
virtual void setParticleSystem(ParticleSystem *ps)
Set the destination particle system.
ReferenceFrame getReferenceFrame() const
Get the reference frame.
Definition ParticleProcessor:179
double getStartTime() const
Get the start time of this processor.
Definition ParticleProcessor:239
bool getEndless() const
Check whether this processor is endless.
Definition ParticleProcessor:80
double _resetTime
Definition ParticleProcessor:170
osg::Matrix _wtl_matrix
Definition ParticleProcessor:160
void setEndless(bool type)
Set the endless flag of this processor.
Definition ParticleProcessor:214
void setResetTime(double t)
Set the reset time of this processor. A value of 0 disables reset.
Definition ParticleProcessor:253
const osg::Matrix & getPreviousLocalToWorldMatrix()
Get the previous local-to-world transformation matrix (valid only during cull traversal).
Definition ParticleProcessor:293
virtual void accept(osg::NodeVisitor &nv)
Visitor Pattern : calls the apply method of a NodeVisitor with this node's type.
Definition ParticleProcessor:52
double _lifeTime
Definition ParticleProcessor:167
osg::Vec3 transformWorldToLocal(const osg::Vec3 &P)
Transform a point from world to local coordinates (valid only during cull traversal).
Definition ParticleProcessor:310
bool _endless
Definition ParticleProcessor:165
ParticleProcessor & operator=(const ParticleProcessor &)
Definition ParticleProcessor:147
bool _first_wtl_compute
Definition ParticleProcessor:157
ParticleSystem * getParticleSystem()
Get a pointer to the destination particle system.
Definition ParticleProcessor:203
bool isAlive() const
Check whether the processor is alive with respect to start time and life duration.
Definition ParticleProcessor:327
void setEnabled(bool v)
Set whether this processor is enabled or not.
Definition ParticleProcessor:194
void setReferenceFrame(ReferenceFrame rf)
Set the reference frame.
Definition ParticleProcessor:184
double getCurrentTime() const
Get the current time of this processor.
Definition ParticleProcessor:248
virtual void process(double dt)=0
virtual const char * libraryName() const
return the name of the node's library.
Definition ParticleProcessor:49
double _t0
Definition ParticleProcessor:153
double _startTime
Definition ParticleProcessor:168
bool getEnabled() const
Get whether this processor is enabled or not.
Definition ParticleProcessor:61
osg::Vec3 rotateLocalToWorld(const osg::Vec3 &P)
Transform a vector from local to world coordinates, discarding translation (valid only during cull tr...
Definition ParticleProcessor:315
ReferenceFrame _rf
Definition ParticleProcessor:151
void setLifeTime(double t)
Set the lifetime of this processor.
Definition ParticleProcessor:224
osg::ref_ptr< ParticleSystem > _ps
Definition ParticleProcessor:154
double getResetTime() const
Get the reset time of this processor.
Definition ParticleProcessor:258
virtual osg::BoundingSphere computeBound() const
Compute the bounding sphere around Node's geometry or children.
bool _first_ltw_compute
Definition ParticleProcessor:155
osg::Matrix _previous_wtl_matrix
Definition ParticleProcessor:162
virtual ~ParticleProcessor()
Definition ParticleProcessor:146
unsigned int _frameNumber
Definition ParticleProcessor:174
osg::Matrix _previous_ltw_matrix
Definition ParticleProcessor:161
void setCurrentTime(double t)
Set the current time of this processor.
Definition ParticleProcessor:243
osg::NodeVisitor * _current_nodevisitor
Definition ParticleProcessor:163
bool _need_wtl_matrix
Definition ParticleProcessor:158
bool _enabled
Definition ParticleProcessor:152
virtual bool isSameKindAs(const osg::Object *obj) const
return true if this and obj are of the same kind of object.
Definition ParticleProcessor:51
void traverse(osg::NodeVisitor &nv)
Traverse downwards : calls children's accept method with NodeVisitor.
const osg::Matrix & getPreviousWorldToLocalMatrix()
Get the previous world-to-local transformation matrix (valid only during cull traversal).
Definition ParticleProcessor:299
bool _need_ltw_matrix
Definition ParticleProcessor:156
osg::Matrix _ltw_matrix
Definition ParticleProcessor:159
double _currentTime
Definition ParticleProcessor:169
bool isEnabled() const
Definition ParticleProcessor:189
osg::Vec3 transformLocalToWorld(const osg::Vec3 &P)
Transform a point from local to world coordinates (valid only during cull traversal).
Definition ParticleProcessor:305
The heart of this class library; its purpose is to hold a set of particles and manage particle creati...
Definition ParticleSystem:54
#define OSGPARTICLE_EXPORT
Definition Export:40