Projection 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
  2. *
  3. * This library is open source and may be redistributed and/or modified under
  4. * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
  5. * (at your option) any later version. The full license is in LICENSE file
  6. * included with this distribution, and on the openscenegraph.org website.
  7. *
  8. * This library is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * OpenSceneGraph Public License for more details.
  12. */
  13. #ifndef OSG_PROJECTION
  14. #define OSG_PROJECTION 1
  15. #include <osg/Group>
  16. #include <osg/Matrix>
  17. namespace osg {
  18. /** Projection nodes set up the frustum/orthographic projection used when rendering the scene.
  19. */
  20. class OSG_EXPORT Projection : public Group
  21. {
  22. public :
  23. Projection();
  24. /** Copy constructor using CopyOp to manage deep vs shallow copy.*/
  25. Projection(const Projection&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
  26. Projection(const Matrix& matix);
  27. META_Node(osg, Projection);
  28. /** Set the transform's matrix.*/
  29. void setMatrix(const Matrix& mat) { _matrix = mat; }
  30. /** Get the transform's matrix. */
  31. inline const Matrix& getMatrix() const { return _matrix; }
  32. /** preMult transform.*/
  33. void preMult(const Matrix& mat) { _matrix.preMult(mat); }
  34. /** postMult transform.*/
  35. void postMult(const Matrix& mat) { _matrix.postMult(mat); }
  36. protected :
  37. virtual ~Projection();
  38. Matrix _matrix;
  39. };
  40. }
  41. #endif