ParticleSystem
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
//osgParticle - Copyright (C) 2002 Marco Jez
#ifndef OSGPARTICLE_PARTICLESYSTEM
#define OSGPARTICLE_PARTICLESYSTEM 1
#include <osgParticle/Export>
#include <osgParticle/Particle>
#include <vector>
#include <stack>
#include <algorithm>
#include <string>
#include <osg/Object>
#include <osg/Drawable>
#include <osg/CopyOp>
#include <osg/State>
#include <osg/Vec3>
#include <osg/BoundingBox>
// 9th Febrary 2009, disabled the use of ReadWriteMutex as it looks like this
// is introducing threading problems due to threading problems in OpenThreads::ReadWriteMutex.
// #define OSGPARTICLE_USE_ReadWriteMutex
#ifdef OSGPARTICLE_USE_ReadWriteMutex
#include <OpenThreads/ReadWriteMutex>
#else
#include <OpenThreads/Mutex>
#include <OpenThreads/ScopedLock>
#endif
namespace osgParticle
{
class OSGPARTICLE_EXPORT ParticleSystem: public osg::Drawable {
public:
enum Alignment {
BILLBOARD,
FIXED
};
ParticleSystem();
ParticleSystem(const ParticleSystem& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
META_Object(osgParticle, ParticleSystem);
inline Alignment getParticleAlignment() const;
inline void setParticleAlignment(Alignment a);
inline const osg::Vec3& getAlignVectorX() const;
inline void setAlignVectorX(const osg::Vec3& v);
inline const osg::Vec3& getAlignVectorY() const;
inline void setAlignVectorY(const osg::Vec3& v);
inline void setAlignVectors(const osg::Vec3& X, const osg::Vec3& Y);
enum ParticleScaleReferenceFrame
{
LOCAL_COORDINATES,
WORLD_COORDINATES
};
void setParticleScaleReferenceFrame(ParticleScaleReferenceFrame rf) { _particleScaleReferenceFrame = rf; }
ParticleScaleReferenceFrame getParticleScaleReferenceFrame() const { return _particleScaleReferenceFrame; }
inline const osg::BoundingBox& getDefaultBoundingBox() const;
inline void setDefaultBoundingBox(const osg::BoundingBox& bbox);
bool getUseVertexArray() const { return _useVertexArray; }
void setUseVertexArray(bool v) { _useVertexArray = v; }
bool getUseShaders() const { return _useShaders; }
void setUseShaders(bool v) { _useShaders = v; _dirty_uniforms = true; }
inline bool getDoublePassRendering() const;
inline void setDoublePassRendering(bool v);
bool getFrozen() const { return _frozen; }
inline bool isFrozen() const;
inline void setFrozen(bool v);
inline int numParticles() const;
inline int numDeadParticles() const;
inline bool areAllParticlesDead() const { return numDeadParticles()==numParticles(); }
inline Particle* getParticle(int i);
inline const Particle* getParticle(int i) const;
virtual Particle* createParticle(const Particle* ptemplate);
inline virtual void destroyParticle(int i);
inline virtual void reuseParticle(int i) { _deadparts.push(&(_particles[i])); }
inline unsigned int getLastFrameNumber() const;
inline double& getDeltaTime( double currentTime );
inline Particle& getDefaultParticleTemplate();
inline const Particle& getDefaultParticleTemplate() const;
inline void setDefaultParticleTemplate(const Particle& p);
inline bool getFreezeOnCull() const;
inline void setFreezeOnCull(bool v);
void setDefaultAttributes(const std::string& texturefile = "", bool emissive_particles = true, bool lighting = false, int texture_unit = 0);
void setDefaultAttributesUsingShaders(const std::string& texturefile = "", bool emissive_particles = true, int texture_unit = 0);
inline int getLevelOfDetail() const;
inline void setLevelOfDetail(int v);
enum SortMode
{
NO_SORT,
SORT_FRONT_TO_BACK,
SORT_BACK_TO_FRONT
};
inline SortMode getSortMode() const;
inline void setSortMode(SortMode mode);
inline double getVisibilityDistance() const;
inline void setVisibilityDistance(double distance);
virtual void update(double dt, osg::NodeVisitor& nv);
virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
virtual osg::BoundingBox computeBoundingBox() const;
#ifdef OSGPARTICLE_USE_ReadWriteMutex
typedef OpenThreads::ReadWriteMutex ReadWriterMutex;
typedef OpenThreads::ScopedReadLock ScopedReadLock;
typedef OpenThreads::ScopedWriteLock ScopedWriteLock;
#else
typedef OpenThreads::Mutex ReadWriterMutex;
typedef OpenThreads::ScopedLock<OpenThreads::Mutex> ScopedReadLock;
typedef OpenThreads::ScopedLock<OpenThreads::Mutex> ScopedWriteLock;
#endif
ReadWriterMutex* getReadWriteMutex() const { return &_readWriteMutex; }
virtual void resizeGLObjectBuffers(unsigned int maxSize);
virtual void releaseGLObjects(osg::State* state=0) const;
virtual osg::VertexArrayState* createVertexArrayStateImplementation(osg::RenderInfo& renderInfo) const;
void adjustEstimatedMaxNumOfParticles(int delta) { _estimatedMaxNumOfParticles += delta; }
void setEstimatedMaxNumOfParticles(int num) { _estimatedMaxNumOfParticles = num; }
int getEstimatedMaxNumOfParticles() const { return _estimatedMaxNumOfParticles; }
protected:
virtual ~ParticleSystem();
ParticleSystem& operator=(const ParticleSystem&) { return *this; }
inline void update_bounds(const osg::Vec3& p, float r);
typedef std::vector<Particle> Particle_vector;
typedef std::stack<Particle*> Death_stack;
Particle_vector _particles;
Death_stack _deadparts;
osg::BoundingBox _def_bbox;
Alignment _alignment;
osg::Vec3 _align_X_axis;
osg::Vec3 _align_Y_axis;
ParticleScaleReferenceFrame _particleScaleReferenceFrame;
bool _useVertexArray;
bool _useShaders;
bool _dirty_uniforms;
bool _doublepass;
bool _frozen;
osg::Vec3 _bmin;
osg::Vec3 _bmax;
bool _reset_bounds_flag;
bool _bounds_computed;
Particle _def_ptemp;
mutable unsigned int _last_frame;
mutable bool _dirty_dt;
bool _freeze_on_cull;
double _t0;
double _dt;
int _detail;
SortMode _sortMode;
double _visibilityDistance;
mutable ReadWriterMutex _readWriteMutex;
int _estimatedMaxNumOfParticles;
struct OSGPARTICLE_EXPORT ArrayData
{
ArrayData();
void init();
void init3();
void reserve(unsigned int numVertices);
void resize(unsigned int numVertices);
void resizeGLObjectBuffers(unsigned int maxSize);
void releaseGLObjects(osg::State* state);
void clear();
void dirty();
void dispatchArrays(osg::State& state);
void dispatchPrimitives();
osg::ref_ptr<osg::BufferObject> vertexBufferObject;
osg::ref_ptr<osg::Vec3Array> vertices;
osg::ref_ptr<osg::Vec3Array> normals;
osg::ref_ptr<osg::Vec4Array> colors;
osg::ref_ptr<osg::Vec2Array> texcoords2;
osg::ref_ptr<osg::Vec3Array> texcoords3;
typedef std::pair<GLenum, unsigned int> ModeCount;
typedef std::vector<ModeCount> Primitives;
Primitives primitives;
};
typedef osg::buffered_object< ArrayData > BufferedArrayData;
mutable BufferedArrayData _bufferedArrayData;
};
// INLINE FUNCTIONS
inline ParticleSystem::Alignment ParticleSystem::getParticleAlignment() const
{
return _alignment;
}
inline void ParticleSystem::setParticleAlignment(Alignment a)
{
_alignment = a;
}
inline const osg::Vec3& ParticleSystem::getAlignVectorX() const
{
return _align_X_axis;
}
inline void ParticleSystem::setAlignVectorX(const osg::Vec3& v)
{
_align_X_axis = v;
}
inline const osg::Vec3& ParticleSystem::getAlignVectorY() const
{
return _align_Y_axis;
}
inline void ParticleSystem::setAlignVectorY(const osg::Vec3& v)
{
_align_Y_axis = v;
}
inline void ParticleSystem::setAlignVectors(const osg::Vec3& X, const osg::Vec3& Y)
{
_align_X_axis = X;
_align_Y_axis = Y;
}
inline bool ParticleSystem::isFrozen() const
{
return _frozen;
}
inline void ParticleSystem::setFrozen(bool v)
{
_frozen = v;
}
inline const osg::BoundingBox& ParticleSystem::getDefaultBoundingBox() const
{
return _def_bbox;
}
inline void ParticleSystem::setDefaultBoundingBox(const osg::BoundingBox& bbox)
{
_def_bbox = bbox;
}
inline bool ParticleSystem::getDoublePassRendering() const
{
return _doublepass;
}
inline void ParticleSystem::setDoublePassRendering(bool v)
{
_doublepass = v;
}
inline int ParticleSystem::numParticles() const
{
return static_cast<int>(_particles.size());
}
inline int ParticleSystem::numDeadParticles() const
{
return static_cast<int>(_deadparts.size());
}
inline Particle* ParticleSystem::getParticle(int i)
{
return &_particles[i];
}
inline const Particle* ParticleSystem::getParticle(int i) const
{
return &_particles[i];
}
inline void ParticleSystem::destroyParticle(int i)
{
_particles[i].kill();
}
inline unsigned int ParticleSystem::getLastFrameNumber() const
{
return _last_frame;
}
inline double& ParticleSystem::getDeltaTime( double currentTime )
{
if ( _dirty_dt )
{
_dt = currentTime - _t0;
if ( _dt<0.0 ) _dt = 0.0;
_t0 = currentTime;
_dirty_dt = false;
}
return _dt;
}
inline void ParticleSystem::update_bounds(const osg::Vec3& p, float r)
{
if (_reset_bounds_flag) {
_reset_bounds_flag = false;
_bmin = p - osg::Vec3(r,r,r);
_bmax = p + osg::Vec3(r,r,r);
} else {
if (p.x() - r < _bmin.x()) _bmin.x() = p.x() - r;
if (p.y() - r < _bmin.y()) _bmin.y() = p.y() - r;
if (p.z() - r < _bmin.z()) _bmin.z() = p.z() - r;
if (p.x() + r > _bmax.x()) _bmax.x() = p.x() + r;
if (p.y() + r > _bmax.y()) _bmax.y() = p.y() + r;
if (p.z() + r > _bmax.z()) _bmax.z() = p.z() + r;
}
if (!_bounds_computed)
_bounds_computed = true;
}
inline Particle& ParticleSystem::getDefaultParticleTemplate()
{
return _def_ptemp;
}
inline const Particle& ParticleSystem::getDefaultParticleTemplate() const
{
return _def_ptemp;
}
inline void ParticleSystem::setDefaultParticleTemplate(const Particle& p)
{
_def_ptemp = p;
}
inline bool ParticleSystem::getFreezeOnCull() const
{
return _freeze_on_cull;
}
inline void ParticleSystem::setFreezeOnCull(bool v)
{
_freeze_on_cull = v;
}
inline int ParticleSystem::getLevelOfDetail() const
{
return _detail;
}
inline void ParticleSystem::setLevelOfDetail(int v)
{
if (v < 1) v = 1;
_detail = v;
}
inline ParticleSystem::SortMode ParticleSystem::getSortMode() const
{
return _sortMode;
}
inline void ParticleSystem::setSortMode(SortMode mode)
{
_sortMode = mode;
}
inline double ParticleSystem::getVisibilityDistance() const
{
return _visibilityDistance;
}
inline void ParticleSystem::setVisibilityDistance(double distance)
{
_visibilityDistance = distance;
if (_useShaders) _dirty_uniforms = true;
}
}
#endif
BoundingBox
CopyOp
Drawable
Mutex
Object
Particle
ReadWriteMutex
ScopedLock
State
Vec3
OpenThreads::Mutex
This class provides an object-oriented thread mutex interface.
Definition Mutex:31
OpenThreads::ReadWriteMutex
Definition ReadWriteMutex:23
OpenThreads::ScopedLock
Definition ScopedLock:25
OpenThreads::ScopedReadLock
Definition ReadWriteMutex:86
OpenThreads::ScopedWriteLock
Definition ReadWriteMutex:100
osgParticle::ParticleSystem::ParticleScaleReferenceFrame
ParticleScaleReferenceFrame
Definition ParticleSystem:91
osgParticle::ParticleSystem::WORLD_COORDINATES
@ WORLD_COORDINATES
Definition ParticleSystem:93
osgParticle::ParticleSystem::LOCAL_COORDINATES
@ LOCAL_COORDINATES
Definition ParticleSystem:92
osgParticle::ParticleSystem::getEstimatedMaxNumOfParticles
int getEstimatedMaxNumOfParticles() const
Definition ParticleSystem:273
osgParticle::ParticleSystem::Death_stack
std::stack< Particle * > Death_stack
Definition ParticleSystem:284
osgParticle::ParticleSystem::setDefaultBoundingBox
void setDefaultBoundingBox(const osg::BoundingBox &bbox)
Definition ParticleSystem:412
osgParticle::ParticleSystem::setFrozen
void setFrozen(bool v)
Definition ParticleSystem:402
osgParticle::ParticleSystem::_detail
int _detail
Definition ParticleSystem:317
osgParticle::ParticleSystem::SortMode
SortMode
Definition ParticleSystem:219
osgParticle::ParticleSystem::SORT_BACK_TO_FRONT
@ SORT_BACK_TO_FRONT
Definition ParticleSystem:222
osgParticle::ParticleSystem::NO_SORT
@ NO_SORT
Definition ParticleSystem:220
osgParticle::ParticleSystem::SORT_FRONT_TO_BACK
@ SORT_FRONT_TO_BACK
Definition ParticleSystem:221
osgParticle::ParticleSystem::resizeGLObjectBuffers
virtual void resizeGLObjectBuffers(unsigned int maxSize)
osgParticle::ParticleSystem::getUseShaders
bool getUseShaders() const
Return true if shaders are required.
Definition ParticleSystem:125
osgParticle::ParticleSystem::_bmin
osg::Vec3 _bmin
Definition ParticleSystem:303
osgParticle::ParticleSystem::_doublepass
bool _doublepass
Definition ParticleSystem:300
osgParticle::ParticleSystem::setLevelOfDetail
void setLevelOfDetail(int v)
Definition ParticleSystem:518
osgParticle::ParticleSystem::_estimatedMaxNumOfParticles
int _estimatedMaxNumOfParticles
Definition ParticleSystem:323
osgParticle::ParticleSystem::getUseVertexArray
bool getUseVertexArray() const
Return true if we use vertex arrays for rendering particles.
Definition ParticleSystem:114
osgParticle::ParticleSystem::_freeze_on_cull
bool _freeze_on_cull
Definition ParticleSystem:312
osgParticle::ParticleSystem::setParticleScaleReferenceFrame
void setParticleScaleReferenceFrame(ParticleScaleReferenceFrame rf)
Definition ParticleSystem:97
osgParticle::ParticleSystem::drawImplementation
virtual void drawImplementation(osg::RenderInfo &renderInfo) const
osgParticle::ParticleSystem::ScopedReadLock
OpenThreads::ScopedLock< OpenThreads::Mutex > ScopedReadLock
Definition ParticleSystem:254
osgParticle::ParticleSystem::createParticle
virtual Particle * createParticle(const Particle *ptemplate)
Create a new particle from the specified template (or the default one if ptemplate is null).
osgParticle::ParticleSystem::_t0
double _t0
Definition ParticleSystem:314
osgParticle::ParticleSystem::getDefaultParticleTemplate
Particle & getDefaultParticleTemplate()
Get a reference to the default particle template.
Definition ParticleSystem:488
osgParticle::ParticleSystem::destroyParticle
virtual void destroyParticle(int i)
Destroy the i-th particle.
Definition ParticleSystem:447
osgParticle::ParticleSystem::Particle_vector
std::vector< Particle > Particle_vector
Definition ParticleSystem:283
osgParticle::ParticleSystem::update_bounds
void update_bounds(const osg::Vec3 &p, float r)
Definition ParticleSystem:470
osgParticle::ParticleSystem::getSortMode
SortMode getSortMode() const
Get the sort mode.
Definition ParticleSystem:524
osgParticle::ParticleSystem::_particles
Particle_vector _particles
Definition ParticleSystem:286
osgParticle::ParticleSystem::getLastFrameNumber
unsigned int getLastFrameNumber() const
Get the last frame number.
Definition ParticleSystem:452
osgParticle::ParticleSystem::_def_ptemp
Particle _def_ptemp
Definition ParticleSystem:309
osgParticle::ParticleSystem::ParticleSystem
ParticleSystem()
osgParticle::ParticleSystem::setUseShaders
void setUseShaders(bool v)
Definition ParticleSystem:131
osgParticle::ParticleSystem::getParticle
Particle * getParticle(int i)
Get a pointer to the i-th particle.
Definition ParticleSystem:437
osgParticle::ParticleSystem::_visibilityDistance
double _visibilityDistance
Definition ParticleSystem:319
osgParticle::ParticleSystem::_reset_bounds_flag
bool _reset_bounds_flag
Definition ParticleSystem:306
osgParticle::ParticleSystem::operator=
ParticleSystem & operator=(const ParticleSystem &)
Definition ParticleSystem:279
osgParticle::ParticleSystem::createVertexArrayStateImplementation
virtual osg::VertexArrayState * createVertexArrayStateImplementation(osg::RenderInfo &renderInfo) const
osgParticle::ParticleSystem::setDefaultAttributes
void setDefaultAttributes(const std::string &texturefile="", bool emissive_particles=true, bool lighting=false, int texture_unit=0)
osgParticle::ParticleSystem::BufferedArrayData
osg::buffered_object< ArrayData > BufferedArrayData
Definition ParticleSystem:355
osgParticle::ParticleSystem::_readWriteMutex
ReadWriterMutex _readWriteMutex
Definition ParticleSystem:321
osgParticle::ParticleSystem::setAlignVectorY
void setAlignVectorY(const osg::Vec3 &v)
Set the Y-axis alignment vector.
Definition ParticleSystem:386
osgParticle::ParticleSystem::ParticleSystem
ParticleSystem(const ParticleSystem &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgParticle::ParticleSystem::getDefaultBoundingBox
const osg::BoundingBox & getDefaultBoundingBox() const
Get the default bounding box.
Definition ParticleSystem:407
osgParticle::ParticleSystem::_bmax
osg::Vec3 _bmax
Definition ParticleSystem:304
osgParticle::ParticleSystem::getFreezeOnCull
bool getFreezeOnCull() const
Get whether the particle system can freeze when culled.
Definition ParticleSystem:503
osgParticle::ParticleSystem::_dt
double _dt
Definition ParticleSystem:315
osgParticle::ParticleSystem::setEstimatedMaxNumOfParticles
void setEstimatedMaxNumOfParticles(int num)
Definition ParticleSystem:272
osgParticle::ParticleSystem::reuseParticle
virtual void reuseParticle(int i)
Reuse the i-th particle.
Definition ParticleSystem:176
osgParticle::ParticleSystem::computeBoundingBox
virtual osg::BoundingBox computeBoundingBox() const
osgParticle::ParticleSystem::_dirty_dt
bool _dirty_dt
Definition ParticleSystem:311
osgParticle::ParticleSystem::setSortMode
void setSortMode(SortMode mode)
Definition ParticleSystem:529
osgParticle::ParticleSystem::isFrozen
bool isFrozen() const
Definition ParticleSystem:397
osgParticle::ParticleSystem::getVisibilityDistance
double getVisibilityDistance() const
Get the visibility distance.
Definition ParticleSystem:534
osgParticle::ParticleSystem::releaseGLObjects
virtual void releaseGLObjects(osg::State *state=0) const
osgParticle::ParticleSystem::META_Object
META_Object(osgParticle, ParticleSystem)
osgParticle::ParticleSystem::adjustEstimatedMaxNumOfParticles
void adjustEstimatedMaxNumOfParticles(int delta)
Definition ParticleSystem:270
osgParticle::ParticleSystem::_bufferedArrayData
BufferedArrayData _bufferedArrayData
Definition ParticleSystem:356
osgParticle::ParticleSystem::setParticleAlignment
void setParticleAlignment(Alignment a)
Set the alignment type of particles.
Definition ParticleSystem:366
osgParticle::ParticleSystem::getReadWriteMutex
ReadWriterMutex * getReadWriteMutex() const
Definition ParticleSystem:258
osgParticle::ParticleSystem::getParticleAlignment
Alignment getParticleAlignment() const
Get the alignment type of particles.
Definition ParticleSystem:361
osgParticle::ParticleSystem::setFreezeOnCull
void setFreezeOnCull(bool v)
Set whether the particle system can freeze when culled (default is true).
Definition ParticleSystem:508
osgParticle::ParticleSystem::getAlignVectorY
const osg::Vec3 & getAlignVectorY() const
Get the Y-axis alignment vector.
Definition ParticleSystem:381
osgParticle::ParticleSystem::setAlignVectors
void setAlignVectors(const osg::Vec3 &X, const osg::Vec3 &Y)
Set the alignment vectors.
Definition ParticleSystem:391
osgParticle::ParticleSystem::~ParticleSystem
virtual ~ParticleSystem()
osgParticle::ParticleSystem::_dirty_uniforms
bool _dirty_uniforms
Definition ParticleSystem:298
osgParticle::ParticleSystem::_alignment
Alignment _alignment
Definition ParticleSystem:291
osgParticle::ParticleSystem::getDeltaTime
double & getDeltaTime(double currentTime)
Get the unique delta time for emitters and updaters to use.
Definition ParticleSystem:457
osgParticle::ParticleSystem::_align_Y_axis
osg::Vec3 _align_Y_axis
Definition ParticleSystem:293
osgParticle::ParticleSystem::setDefaultParticleTemplate
void setDefaultParticleTemplate(const Particle &p)
Set the default particle template (particle is copied).
Definition ParticleSystem:498
osgParticle::ParticleSystem::update
virtual void update(double dt, osg::NodeVisitor &nv)
Update the particles. Don't call this directly, use a ParticleSystemUpdater instead.
osgParticle::ParticleSystem::_deadparts
Death_stack _deadparts
Definition ParticleSystem:287
osgParticle::ParticleSystem::_align_X_axis
osg::Vec3 _align_X_axis
Definition ParticleSystem:292
osgParticle::ParticleSystem::setDefaultAttributesUsingShaders
void setDefaultAttributesUsingShaders(const std::string &texturefile="", bool emissive_particles=true, int texture_unit=0)
osgParticle::ParticleSystem::_particleScaleReferenceFrame
ParticleScaleReferenceFrame _particleScaleReferenceFrame
Definition ParticleSystem:294
osgParticle::ParticleSystem::_sortMode
SortMode _sortMode
Definition ParticleSystem:318
osgParticle::ParticleSystem::ScopedWriteLock
OpenThreads::ScopedLock< OpenThreads::Mutex > ScopedWriteLock
Definition ParticleSystem:255
osgParticle::ParticleSystem::Alignment
Alignment
Definition ParticleSystem:57
osgParticle::ParticleSystem::FIXED
@ FIXED
Definition ParticleSystem:59
osgParticle::ParticleSystem::BILLBOARD
@ BILLBOARD
Definition ParticleSystem:58
osgParticle::ParticleSystem::getParticleScaleReferenceFrame
ParticleScaleReferenceFrame getParticleScaleReferenceFrame() const
Definition ParticleSystem:100
osgParticle::ParticleSystem::_def_bbox
osg::BoundingBox _def_bbox
Definition ParticleSystem:289
osgParticle::ParticleSystem::numDeadParticles
int numDeadParticles() const
Get the number of dead particles.
Definition ParticleSystem:432
osgParticle::ParticleSystem::getFrozen
bool getFrozen() const
Return true if the particle system is frozen.
Definition ParticleSystem:146
osgParticle::ParticleSystem::getDoublePassRendering
bool getDoublePassRendering() const
Get the double pass rendering flag.
Definition ParticleSystem:417
osgParticle::ParticleSystem::getAlignVectorX
const osg::Vec3 & getAlignVectorX() const
Get the X-axis alignment vector.
Definition ParticleSystem:371
osgParticle::ParticleSystem::getLevelOfDetail
int getLevelOfDetail() const
(EXPERIMENTAL) Get the level of detail.
Definition ParticleSystem:513
osgParticle::ParticleSystem::numParticles
int numParticles() const
Get the number of allocated particles (alive + dead).
Definition ParticleSystem:427
osgParticle::ParticleSystem::setAlignVectorX
void setAlignVectorX(const osg::Vec3 &v)
Set the X-axis alignment vector.
Definition ParticleSystem:376
osgParticle::ParticleSystem::_useShaders
bool _useShaders
Definition ParticleSystem:297
osgParticle::ParticleSystem::_last_frame
unsigned int _last_frame
Definition ParticleSystem:310
osgParticle::ParticleSystem::_useVertexArray
bool _useVertexArray
Definition ParticleSystem:296
osgParticle::ParticleSystem::_bounds_computed
bool _bounds_computed
Definition ParticleSystem:307
osgParticle::ParticleSystem::ReadWriterMutex
OpenThreads::Mutex ReadWriterMutex
Definition ParticleSystem:253
osgParticle::ParticleSystem::setDoublePassRendering
void setDoublePassRendering(bool v)
Definition ParticleSystem:422
osgParticle::ParticleSystem::setUseVertexArray
void setUseVertexArray(bool v)
Definition ParticleSystem:122
osgParticle::ParticleSystem::areAllParticlesDead
bool areAllParticlesDead() const
Get whether all particles are dead.
Definition ParticleSystem:161
osgParticle::ParticleSystem::_frozen
bool _frozen
Definition ParticleSystem:301
osgParticle::ParticleSystem::setVisibilityDistance
void setVisibilityDistance(double distance)
Definition ParticleSystem:539
osgParticle::Particle
Definition Particle:47
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::Drawable
Definition Drawable:89
osg::NodeVisitor
Definition NodeVisitor:82
osg::RenderInfo
Definition RenderInfo:28
osg::State
Definition State:80
osg::Vec3f::z
value_type & z()
Definition Vec3f:82
osg::Vec3f::y
value_type & y()
Definition Vec3f:81
osg::Vec3f::x
value_type & x()
Definition Vec3f:80
osg::VertexArrayState
Definition VertexArrayState:25
osg::buffered_object< ArrayData >
osg::ref_ptr
Definition ref_ptr:32
osgParticle
Definition AccelOperator:27
osg::Vec3
Vec3f Vec3
Definition Vec3:21
osg::BoundingBox
BoundingBoxd BoundingBox
Definition BoundingBox:257
Export
OSGPARTICLE_EXPORT
#define OSGPARTICLE_EXPORT
Definition osgParticle/Export:40
osgParticle::ParticleSystem::ArrayData::init
void init()
osgParticle::ParticleSystem::ArrayData::ArrayData
ArrayData()
osgParticle::ParticleSystem::ArrayData::init3
void init3()
osgParticle::ParticleSystem::ArrayData::resize
void resize(unsigned int numVertices)
osgParticle::ParticleSystem::ArrayData::texcoords2
osg::ref_ptr< osg::Vec2Array > texcoords2
Definition ParticleSystem:347
osgParticle::ParticleSystem::ArrayData::normals
osg::ref_ptr< osg::Vec3Array > normals
Definition ParticleSystem:345
osgParticle::ParticleSystem::ArrayData::primitives
Primitives primitives
Definition ParticleSystem:352
osgParticle::ParticleSystem::ArrayData::vertices
osg::ref_ptr< osg::Vec3Array > vertices
Definition ParticleSystem:344
osgParticle::ParticleSystem::ArrayData::colors
osg::ref_ptr< osg::Vec4Array > colors
Definition ParticleSystem:346
osgParticle::ParticleSystem::ArrayData::texcoords3
osg::ref_ptr< osg::Vec3Array > texcoords3
Definition ParticleSystem:348
osgParticle::ParticleSystem::ArrayData::ModeCount
std::pair< GLenum, unsigned int > ModeCount
Definition ParticleSystem:350
osgParticle::ParticleSystem::ArrayData::dispatchPrimitives
void dispatchPrimitives()
osgParticle::ParticleSystem::ArrayData::clear
void clear()
osgParticle::ParticleSystem::ArrayData::releaseGLObjects
void releaseGLObjects(osg::State *state)
osgParticle::ParticleSystem::ArrayData::resizeGLObjectBuffers
void resizeGLObjectBuffers(unsigned int maxSize)
osgParticle::ParticleSystem::ArrayData::dirty
void dirty()
osgParticle::ParticleSystem::ArrayData::vertexBufferObject
osg::ref_ptr< osg::BufferObject > vertexBufferObject
Definition ParticleSystem:343
osgParticle::ParticleSystem::ArrayData::Primitives
std::vector< ModeCount > Primitives
Definition ParticleSystem:351
osgParticle::ParticleSystem::ArrayData::dispatchArrays
void dispatchArrays(osg::State &state)
osgParticle::ParticleSystem::ArrayData::reserve
void reserve(unsigned int numVertices)