AlignVisitor.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /***************************************************************************
  2. AVisitor.h - description
  3. -------------------
  4. begin : Wed Jan 26 2000
  5. copyright : (C) 2000 by Henrik Enqvist
  6. email : henqvist@excite.com
  7. ***************************************************************************/
  8. #ifndef ALIGNVISITOR_H
  9. #define ALIGNVISITOR_H
  10. #include "Visitor.h"
  11. #include "EMath.h"
  12. class CollisionBounds;
  13. /** Only for internal use.
  14. * AlignVisitor alignes transformed vertices to aligned vertices
  15. * by applying the camera matrix.
  16. * @see visitor */
  17. class AlignVisitor : public Visitor {
  18. protected:
  19. AlignVisitor();
  20. public:
  21. ~AlignVisitor();
  22. static AlignVisitor * getInstance();
  23. /** Applys the camera matrix to the Shape3D and Sound objects
  24. * of the group. Checks first if the objects are NULL. */
  25. void visit(Group* g);
  26. void empty();
  27. /** The Engine object uses this function when setting the camera marix. */
  28. void setCamera(Group * g);
  29. private:
  30. Group* p_GroupCamera;
  31. Matrix m_mtxInverse;
  32. Vertex3D m_vtxFront;
  33. Vertex3D m_vtxUp;
  34. Vertex3D m_vtxTrans;
  35. Vertex3D m_vtxRot;
  36. static AlignVisitor * p_AlignVisitor;
  37. };
  38. #endif // ALIGNVISITOR_H