2002-07-17 04:07:32 +08:00
|
|
|
//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
|
2002-04-01 00:40:44 +08:00
|
|
|
//Distributed under the terms of the GNU Library General Public License (LGPL)
|
|
|
|
//as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
#ifndef OSG_PROJECTION
|
|
|
|
#define OSG_PROJECTION 1
|
|
|
|
|
|
|
|
#include <osg/Group>
|
|
|
|
#include <osg/Matrix>
|
|
|
|
|
|
|
|
namespace osg {
|
|
|
|
|
|
|
|
/** Projection nodes set up the frustum/orthographic projection used when rendering the scene .
|
|
|
|
*/
|
|
|
|
class SG_EXPORT Projection : public Group
|
|
|
|
{
|
|
|
|
public :
|
|
|
|
|
|
|
|
|
|
|
|
Projection();
|
|
|
|
|
|
|
|
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
|
|
|
Projection(const Projection&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
|
|
|
|
|
|
|
Projection(const Matrix& matix);
|
|
|
|
|
2002-06-06 21:25:36 +08:00
|
|
|
META_Node(osg, Projection);
|
2002-04-01 00:40:44 +08:00
|
|
|
|
|
|
|
/** Set the transform's matrix.*/
|
2003-01-10 17:25:42 +08:00
|
|
|
void setMatrix(const Matrix& mat) { _matrix = mat; }
|
2002-04-01 00:40:44 +08:00
|
|
|
|
|
|
|
/** Get the transform's matrix. */
|
2003-01-10 17:25:42 +08:00
|
|
|
inline const Matrix& getMatrix() const { return _matrix; }
|
2002-04-01 00:40:44 +08:00
|
|
|
|
|
|
|
/** preMult transform.*/
|
2003-01-10 17:25:42 +08:00
|
|
|
void preMult(const Matrix& mat) { _matrix.preMult(mat); }
|
2002-04-01 00:40:44 +08:00
|
|
|
|
|
|
|
/** postMult transform.*/
|
2003-01-10 17:25:42 +08:00
|
|
|
void postMult(const Matrix& mat) { _matrix.postMult(mat); }
|
2002-04-01 00:40:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
protected :
|
|
|
|
|
|
|
|
virtual ~Projection();
|
|
|
|
|
2003-01-10 17:25:42 +08:00
|
|
|
Matrix _matrix;
|
2002-04-01 00:40:44 +08:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|