Hello,
In an OSG scene, I have to objects imported from a 3DS file. I can grossly
approximate these objects with bounding boxes (but not with bounding spheres).
I load my objects in this way :
Code:
Registry::instance()->getDataFilePathList().push_back("resources/data");
ref_ptr< ReaderWriter::Options > options = new ReaderWriter::Options;
options->setObjectCacheHint( ReaderWriter::Options::CACHE_NONE);
m_ksterNode = osgDB::readNodeFile(FILE_NAME, options);
So my object is an osg::Node. I had seen that OSG::Node have a method
computeBound wich return a bounding Sphere (but I want a bounding box).
I had seen that both osg::Geode, osg::Drawable and osg::Shape can return a
bounding box thanks to the method getBoundingBox.
I read a method to wich explain how to convert an OSG::Drawable object into an
bullet TriangleMesh object to perform fine collision detection with bullet.
But, my imported object isn't a OSG::Drawable, that is an OSG::Node.
So here are my questions :
1 - How to convert an OSG::Node into an osg::Drawable or osg::Geode ?
2 - If question 1 is absurd, my second question is : How to load a 3DS object
as a osg::Drawable or osg::Geode (and not as an osg::Node).
I had read a nice tutorial
(http://www.cs.clemson.edu/~malloy/courses/3dgames-2007/tutor/web/collisions/collisions.html)
on the collision detection, but this tutorial doesn't answer to my questions.
So , thanks very much for your answers,
Regads, A. BARRAL
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=32018#32018
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org