Tweaks from using a ReadWriteMutex& to a ReadWriteMutex* parameter to avoid
problems with osgIntrospection generation.
This commit is contained in:
parent
b2a0b50a5a
commit
11fef2d75e
@ -166,7 +166,7 @@ namespace osgParticle
|
||||
|
||||
virtual osg::BoundingBox computeBound() const;
|
||||
|
||||
osgDB::ReadWriteMutex& getReadWriteMutex() const { return _readWriteMutex; }
|
||||
osgDB::ReadWriteMutex* getReadWriteMutex() const { return &_readWriteMutex; }
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -114,9 +114,12 @@ void ConnectedParticleSystem::reuseParticle(int particleIndex)
|
||||
|
||||
void ConnectedParticleSystem::drawImplementation(osg::State& state) const
|
||||
{
|
||||
osgDB::ScopedReadLock lock(_readWriteMutex);
|
||||
|
||||
const Particle* particle = (_startParticle != Particle::INVALID_INDEX) ? &_particles[_startParticle] : 0;
|
||||
if (!particle) return;
|
||||
|
||||
|
||||
osg::Vec4 pixelSizeVector = osg::CullingSet::computePixelSizeVector(*state.getCurrentViewport(),state.getProjectionMatrix(),state.getModelViewMatrix());
|
||||
float unitPixelSize = fabs(1.0/(particle->getPosition()*pixelSizeVector));
|
||||
float pixelSizeOfFirstParticle = unitPixelSize * particle->getCurrentSize();
|
||||
|
@ -64,7 +64,7 @@ void osgParticle::ParticleProcessor::traverse(osg::NodeVisitor& nv)
|
||||
{
|
||||
if (nv.getFrameStamp())
|
||||
{
|
||||
osgDB::ScopedWriteLock lock(_ps->getReadWriteMutex());
|
||||
osgDB::ScopedWriteLock lock(*(_ps->getReadWriteMutex()));
|
||||
|
||||
//added- 1/17/06- bgandere@nps.edu
|
||||
//a check to make sure we havent updated yet this frame
|
||||
|
@ -40,7 +40,7 @@ void osgParticle::ParticleSystemUpdater::traverse(osg::NodeVisitor& nv)
|
||||
{
|
||||
ParticleSystem* ps = i->get();
|
||||
|
||||
osgDB::ScopedWriteLock lock(ps->getReadWriteMutex());
|
||||
osgDB::ScopedWriteLock lock(*(ps->getReadWriteMutex()));
|
||||
|
||||
if (!ps->isFrozen() && (ps->getLastFrameNumber() >= (nv.getFrameStamp()->getFrameNumber() - 1) || !ps->getFreezeOnCull()))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user