2001-10-04 23:12:57 +08:00
|
|
|
//C++ header - Open Scene Graph - Copyright (C) 1998-2001 Robert Osfield
|
|
|
|
//Distributed under the terms of the GNU Library General Public License (LGPL)
|
|
|
|
//as published by the Free Software Foundation.
|
|
|
|
|
2001-09-20 05:19:47 +08:00
|
|
|
#ifndef OSG_TRANSFORM
|
|
|
|
#define OSG_TRANSFORM 1
|
|
|
|
|
|
|
|
#include <osg/Group>
|
|
|
|
#include <osg/Matrix>
|
|
|
|
|
|
|
|
namespace osg {
|
|
|
|
|
|
|
|
/** Transform - is group which all children
|
|
|
|
are transformed by the the Transform's osg::Matrix. Typical uses
|
|
|
|
of the Transform is for positioning objects within a scene or
|
2001-10-01 19:15:55 +08:00
|
|
|
producing trakerball functionality or for animation.
|
2001-09-20 05:19:47 +08:00
|
|
|
*/
|
|
|
|
class SG_EXPORT Transform : public Group
|
|
|
|
{
|
|
|
|
public :
|
|
|
|
Transform();
|
|
|
|
Transform(const Matrix& matix);
|
|
|
|
|
2001-09-22 10:42:08 +08:00
|
|
|
META_Node(Transform);
|
2001-09-20 05:19:47 +08:00
|
|
|
|
|
|
|
void setMatrix(const Matrix& mat );
|
|
|
|
inline Matrix& getMatrix() { return *_matrix; }
|
|
|
|
inline const Matrix& getMatrix() const { return *_matrix; }
|
|
|
|
|
|
|
|
void preMult( const Matrix& mat );
|
|
|
|
void preScale( const float sx, const float sy, const float sz );
|
|
|
|
void preTranslate( const float tx, const float ty, const float tz );
|
|
|
|
void preRotate( const float deg, const float x, const float y, const float z );
|
|
|
|
|
|
|
|
|
|
|
|
protected :
|
|
|
|
|
|
|
|
virtual ~Transform();
|
|
|
|
|
|
|
|
virtual const bool computeBound() const;
|
|
|
|
|
|
|
|
ref_ptr<Matrix> _matrix;
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|