From 4c576770fbce2b8efa71d62478d2bd33e54bb07b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 5 Jul 2003 19:08:30 +0000 Subject: [PATCH] Integrated various fixes from users. --- README.txt | 2 +- src/osg/Drawable.cpp | 5 +++-- src/osgDB/DynamicLibrary.cpp | 2 +- src/osgParticle/FluidFrictionOperator.cpp | 9 ++++++++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.txt b/README.txt index c0045776b..fbf878ce8 100644 --- a/README.txt +++ b/README.txt @@ -1,6 +1,6 @@ Welcome to the OpenSceneGraph (OSG). -For information on the project, this distribtion, how to compile and +For information on the project, this distribution, how to compile and run libraries and examples, and for documention open up index.html in your perfered html browser. diff --git a/src/osg/Drawable.cpp b/src/osg/Drawable.cpp index f86faf0e9..cee86086a 100644 --- a/src/osg/Drawable.cpp +++ b/src/osg/Drawable.cpp @@ -263,7 +263,8 @@ void Drawable::setUseDisplayList(bool flag) void Drawable::dirtyDisplayList() { - for(unsigned int i=0;i<_globjList.size();++i) + unsigned int i; + for(i=0;i<_globjList.size();++i) { if (_globjList[i] != 0) { @@ -272,7 +273,7 @@ void Drawable::dirtyDisplayList() } } - for(unsigned int i=0;i<_vboList.size();++i) + for(i=0;i<_vboList.size();++i) { if (_vboList[i] != 0) { diff --git a/src/osgDB/DynamicLibrary.cpp b/src/osgDB/DynamicLibrary.cpp index c6af59712..61f7c512b 100644 --- a/src/osgDB/DynamicLibrary.cpp +++ b/src/osgDB/DynamicLibrary.cpp @@ -125,7 +125,7 @@ DynamicLibrary::getLibraryHandle( const std::string& libraryName) BIND_DEFERRED|BIND_FIRST|BIND_VERBOSE, 0); return handle; #else // other unix - handle = dlopen( libraryName.c_str(), RTLD_LAZY ); + handle = dlopen( libraryName.c_str(), RTLD_LAZY | RTLD_GLOBAL); #endif return handle; } diff --git a/src/osgParticle/FluidFrictionOperator.cpp b/src/osgParticle/FluidFrictionOperator.cpp index e9788b074..8144eeac9 100644 --- a/src/osgParticle/FluidFrictionOperator.cpp +++ b/src/osgParticle/FluidFrictionOperator.cpp @@ -41,5 +41,12 @@ void osgParticle::FluidFrictionOperator::operate(Particle *P, double dt) Fr = current_program_->rotateLocalToWorld(Fr); } - P->addVelocity(Fr * (P->getMassInv() * dt)); + // correct unwanted velocity increments + osg::Vec3 dv = Fr * (P->getMassInv() * 0.01); + float dvl = dv.length(); + if (dvl > vm) { + dv *= vm / dvl; + } + + P->addVelocity(dv); }