1 #include <osg/NodeVisitor>
2 #include <osg/BoundingBox>
3 #include <osg/BoundingSphere>
4 #include <osg/MatrixTransform>
5 #include <osg/Billboard>
21 m_transformMatrix.makeIdentity();
31 void apply( osg::Geode &geode ) {
38 if(geode.getNumDrawables() > 0) {
39 osg::BoundingBox bbox;
44 for(
unsigned int i = 0; i < geode.getNumDrawables(); ++i ){
50 bbox.expandBy( geode.getDrawable( i )->getBound());
56 osg::BoundingBox bboxTrans;
58 for(
unsigned int i = 0; i < 8; ++i ) {
60 osg::Vec3 xvec = bbox.corner( i ) * m_transformMatrix;
62 bboxTrans.expandBy( xvec );
69 m_boundingBox.expandBy( bboxTrans );
80 void apply( osg::MatrixTransform &node ) {
87 m_transformMatrix *= node.getMatrix();
98 void apply( osg::Billboard &node ){
117 osg::BoundingBox &getBoundBox() {
return m_boundingBox; }
121 osg::BoundingBox m_boundingBox;
122 osg::Matrix m_transformMatrix;
Classes for implementing the cm-labs vortex physics engine for AnimatLab.