1
0
Fork 0

Start adding support for loading additional models per tile.

This commit is contained in:
curt 1999-11-03 20:59:34 +00:00
parent 369f052c7b
commit 8ce39244df
2 changed files with 21 additions and 7 deletions

View file

@ -269,7 +269,7 @@ ssgBranch *fgGenTile( const string& path, FGTileEntry *t) {
// Load a .obj file and build the fragment list // Load a .obj file and build the fragment list
ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) { ssgBranch *fgObjLoad( const string& path, FGTileEntry *t, const bool is_base) {
fgFRAGMENT fragment; fgFRAGMENT fragment;
Point3D pp; Point3D pp;
double approx_normal[3] /*, normal[3], scale = 0.0 */; double approx_normal[3] /*, normal[3], scale = 0.0 */;
@ -312,10 +312,14 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
shading = current_options.get_shading(); shading = current_options.get_shading();
in_fragment = false; in_fragment = false;
if ( is_base ) {
t->ncount = 0; t->ncount = 0;
}
vncount = 0; vncount = 0;
vtcount = 0; vtcount = 0;
if ( is_base ) {
t->bounding_radius = 0.0; t->bounding_radius = 0.0;
}
center = t->center; center = t->center;
StopWatch stopwatch; StopWatch stopwatch;
@ -355,7 +359,13 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
// cout << "scenery_version = " << scenery_version << endl; // cout << "scenery_version = " << scenery_version << endl;
} else if ( token == "gbs" ) { } else if ( token == "gbs" ) {
// reference point (center offset) // reference point (center offset)
if ( is_base ) {
in >> t->center >> t->bounding_radius; in >> t->center >> t->bounding_radius;
} else {
Point3D junk1;
double junk2;
in >> junk1 >> junk2;
}
center = t->center; center = t->center;
// cout << "center = " << center // cout << "center = " << center
// << " radius = " << t->bounding_radius << endl; // << " radius = " << t->bounding_radius << endl;
@ -513,7 +523,9 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
>> nodes[t->ncount][2]; */ >> nodes[t->ncount][2]; */
in >> node; in >> node;
nodes.push_back(node); nodes.push_back(node);
if ( is_base ) {
t->ncount++; t->ncount++;
}
} else { } else {
FG_LOG( FG_TERRAIN, FG_ALERT, FG_LOG( FG_TERRAIN, FG_ALERT,
"Read too many nodes in " << path "Read too many nodes in " << path
@ -937,7 +949,9 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
xglEnd(); xglEnd();
#endif #endif
if ( is_base ) {
t->nodes = nodes; t->nodes = nodes;
}
stopwatch.stop(); stopwatch.stop();
FG_LOG( FG_TERRAIN, FG_DEBUG, FG_LOG( FG_TERRAIN, FG_DEBUG,

View file

@ -52,7 +52,7 @@ FG_USING_STD(string);
// Load a .obj file and build the fragment list // Load a .obj file and build the fragment list
ssgBranch *fgObjLoad(const string& path, FGTileEntry *tile); ssgBranch *fgObjLoad(const string& path, FGTileEntry *tile, const bool is_base);
#endif // _OBJ_HXX #endif // _OBJ_HXX