From: ehofman Date: Fri, 2 Apr 2004 14:39:19 +0000 (+0000) Subject: Frederic Bouvier: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4b04450fa6def04449f53b9a7334951255f11b4a;p=simgear.git Frederic Bouvier: 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. --- diff --git a/simgear/scene/tgdb/obj.cxx b/simgear/scene/tgdb/obj.cxx index 7ec65041..b8826f66 100644 --- a/simgear/scene/tgdb/obj.cxx +++ b/simgear/scene/tgdb/obj.cxx @@ -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;