]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/sky/cloudfield.cxx
Work around apparent OSG 3.2.0 normal binding bug.
[simgear.git] / simgear / scene / sky / cloudfield.cxx
index 1d9ae9ea98016f97d3af2887fcb923e7234a390a..45ae15f83c4b4cd9feb71f7d376b28e5578b0d0d 100644 (file)
@@ -130,6 +130,11 @@ bool SGCloudField::reposition( const SGVec3f& p, const SGVec3f& up, double lon,
             ++itr) {
               
              osg::ref_ptr<osg::PositionAttitudeTransform> pat = itr->second;
+            
+             if (pat == 0) {
+                continue;
+             }
+             
              osg::Vec3f currpos = field_transform->getPosition() + fta * pat->getPosition();
                                       
              // Determine the vector from the new position to the cloud in cloud-space.
@@ -367,7 +372,7 @@ void SGCloudField::addCloudToTree(osg::ref_ptr<osg::PositionAttitudeTransform> t
         
 bool SGCloudField::deleteCloud(int identifier) {
     osg::ref_ptr<osg::PositionAttitudeTransform> transform = cloud_hash[identifier];
-    if (transform == NULL) return false;
+    if (transform == 0) return false;
         
     removeCloudFromTree(transform);
     cloud_hash.erase(identifier);
@@ -390,7 +395,7 @@ bool SGCloudField::repositionCloud(int identifier, float lon, float lat, float a
     }
 
 bool SGCloudField::isDefined3D(void) {
-    return (cloud_hash.size() > 0);
+    return (! cloud_hash.empty());
 }
 
 SGCloudField::CloudFog::CloudFog() {