]> git.mxchange.org Git - simgear.git/commitdiff
Frederic Bouvier:
authorehofman <ehofman>
Fri, 2 Apr 2004 14:39:19 +0000 (14:39 +0000)
committerehofman <ehofman>
Fri, 2 Apr 2004 14:39:19 +0000 (14:39 +0000)
 put all leaf is a seperated branch so that it is
 possible to use a pretrav callback to cull out
 terrain without culling out light or dynamic
 objects. It appears that plib is not calling the
 pretrav callback for leaves.

simgear/scene/tgdb/obj.cxx

index 7ec6504177534ba672a67c29b26d13e6ae3b622b..b8826f664ba54c1d86bd3c692c6c079683dc2226 100644 (file)
@@ -327,6 +327,10 @@ bool sgBinObjLoad( const string& path, const bool is_base,
         return false;
     }
 
+    ssgBranch *local_terrain = new ssgBranch;
+    local_terrain->setName( "LocalTerrain" );
+    geometry->addKid( local_terrain );
+
     geometry->setName( (char *)path.c_str() );
 
     // reference point (center offset/bounding sphere)
@@ -375,7 +379,7 @@ bool sgBinObjLoad( const string& path, const bool is_base,
                                         nodes, normals, texcoords,
                                         pts_v[i], pts_n[i], tex_index,
                                         false, ground_lights );
-            geometry->addKid( leaf );
+            local_terrain->addKid( leaf );
         }
     }
 
@@ -415,7 +419,7 @@ bool sgBinObjLoad( const string& path, const bool is_base,
                                             center, mat );
             }
         }
-        geometry->addKid( leaf );
+        local_terrain->addKid( leaf );
     }
 
     // generate strips
@@ -441,7 +445,7 @@ bool sgBinObjLoad( const string& path, const bool is_base,
                                             center, mat );
             }
         }
-        geometry->addKid( leaf );
+        local_terrain->addKid( leaf );
     }
 
     // generate fans
@@ -467,7 +471,7 @@ bool sgBinObjLoad( const string& path, const bool is_base,
             }
         }
 
-        geometry->addKid( leaf );
+        local_terrain->addKid( leaf );
     }
 
     return true;