Frederic: Use display lists for 3d models also.
This commit is contained in:
@@ -208,6 +208,19 @@ sgMakeAnimation( ssgBranch * model,
|
||||
}
|
||||
|
||||
|
||||
static void makeDList( ssgBranch *b )
|
||||
{
|
||||
int nb = b->getNumKids();
|
||||
for (int i = 0; i<nb; i++) {
|
||||
ssgEntity *e = b->getKid(i);
|
||||
if (e->isAKindOf(ssgTypeLeaf())) {
|
||||
((ssgLeaf*)e)->makeDList();
|
||||
} else if (e->isAKindOf(ssgTypeBranch())) {
|
||||
makeDList( (ssgBranch*)e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -258,6 +271,10 @@ sgLoad3DModel( const string &fg_root, const string &path,
|
||||
throw sg_exception("Failed to load 3D model");
|
||||
}
|
||||
|
||||
if ( model != 0 ) {
|
||||
makeDList( model );
|
||||
}
|
||||
|
||||
// Set up the alignment node
|
||||
ssgTransform * alignmainmodel = new ssgTransform;
|
||||
if ( load_panel == 0 )
|
||||
|
||||
Reference in New Issue
Block a user