OpenSceneGraph/applications/osgconv/OrientationConverter.h

33 lines
998 B
C
Raw Normal View History

#ifndef _ORIENTATION_CONVERTER_H
#define _ORIENTATION_CONVERTER_H
#include <osg/Vec3>
#include <osg/Matrix>
#include <osg/Node>
#include <osg/Geode>
class OrientationConverter {
public :
2011-05-27 19:18:44 +08:00
OrientationConverter(void);
void setRotation( const osg::Vec3 &from,
const osg::Vec3 &to );
void setRotation( float degrees, const osg::Vec3 &axis );
void setTranslation( const osg::Vec3 &trans);
void setScale( const osg::Vec3 &trans);
void useWorldFrame( bool worldFrame );
/** return the root of the updated subgraph as the subgraph
* the node passed in my flatten during optimization.*/
2011-05-27 19:18:44 +08:00
osg::Node* convert( osg::Node* node );
private :
2011-05-27 19:18:44 +08:00
OrientationConverter( const OrientationConverter& ) {}
OrientationConverter& operator = (const OrientationConverter& ) { return *this; }
2011-05-27 19:18:44 +08:00
osg::Matrix R, T, S;
bool _trans_set;
bool _use_world_frame;
};
#endif