From Ruben Lopez, updates to VRML/IV loader.

From Ben Discoe, corrections to comments in osg::Transform

From Alberto Barbati, Lazy evaluation of inverse matrix in osg::MatrixTransfrom
This commit is contained in:
Robert Osfield
2002-08-04 20:34:48 +00:00
parent fb0d87b29c
commit cab49a9307
8 changed files with 101 additions and 68 deletions

View File

@@ -672,9 +672,12 @@ void Viewer::display()
// application traverasal.
times[2].timeApp+=app(i);
// cull traverasal.
times[2].timeCull+=cull(i);
if (_printStats>=1) glFinish();
// draw traverasal.
times[2].timeDraw+=draw(i);
if (_printStats==Statistics::STAT_PRIMSPERVIEW)

View File

@@ -33,14 +33,17 @@ extern int yyparse();
extern int yydebug;
extern MyNode *getRoot();
extern FILE *yyin;
int isatty(int) { return 0; }
extern void flush_scanner();
osg::Node *readVRMLNode(const char *file) {
yydebug=0;
yyin=fopen(file,"r");
std::cout << "Parsing..." << std::endl;
if (yyparse()!=0) return 0;
if (yyparse()!=0) {
flush_scanner();
return 0;
}
osg::ref_ptr<MyNode> n=getRoot();
try {
std::cout << "Generating OSG tree..." << std::endl;

View File

@@ -225,10 +225,10 @@ void OSGVisitor::makeGeode(osg::Geode *geode, osg::Geometry *geometry, bool twoS
state->setAttributeAndModes(frontface,osg::StateAttribute::ON);
osg::CullFace *cull=new osg::CullFace();
cull->setMode(osg::CullFace::BACK);
if (twoSided) {
if (!twoSided) {
state->setAttributeAndModes(cull,osg::StateAttribute::ON);
} else {
std::cout << "Deactivating culling for this object" << std::endl;
//std::cout << "Deactivating culling for this object" << std::endl;
state->setAttributeAndModes(cull,osg::StateAttribute::OFF);
osg::Transparency *transp=new osg::Transparency();
transp->setFunction(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);

View File

@@ -2116,3 +2116,8 @@ int yywrap(void)
{
return (1);
}
void flush_scanner(void) {
yy_flush_buffer(YY_CURRENT_BUFFER);
}

View File

@@ -84,3 +84,8 @@ int yywrap(void)
{
return (1);
}
void flush_scanner(void) {
yy_flush_buffer(YY_CURRENT_BUFFER);
}