Node.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //#ident "$Id: Node.h,v 1.8 2003/05/27 11:53:25 rzr Exp $"
  2. /***************************************************************************
  3. Node.h - description
  4. -------------------
  5. begin : Wed Jan 26 2000
  6. copyright : (C) 2000 by Henrik Enqvist
  7. email : henqvist@excite.com
  8. ***************************************************************************/
  9. #ifndef NODE_H
  10. #define NODE_H
  11. #include "EMath.h"
  12. /** The Node represents the transformation of an object. Group inherits this class. */
  13. class Node {
  14. public:
  15. Node();
  16. ~Node();
  17. void setTransform(float tx, float ty, float tz , float rx, float ry, float rz);
  18. void addTransform(float tx, float ty, float tz , float rx, float ry, float rz);
  19. void setTranslation(float x, float y, float z);
  20. void getTranslation(float & x, float & y, float & z);
  21. void addTranslation(float x, float y, float z);
  22. void getTranslation(Vertex3D & vtx) {
  23. this->getTranslation(vtx.x, vtx.y, vtx.z);
  24. };
  25. void setTranslation(Vertex3D & vtx) {
  26. this->setTranslation(vtx.x, vtx.y, vtx.z);
  27. };
  28. inline void addTranslation(Vertex3D & vtx) {
  29. m_vtxT.x += vtx.x;
  30. m_vtxT.y += vtx.y;
  31. m_vtxT.z += vtx.z;
  32. m_mtxSrc.t[0] = m_vtxT.x;
  33. m_mtxSrc.t[1] = m_vtxT.y;
  34. m_mtxSrc.t[2] = m_vtxT.z;
  35. };
  36. void setRotation(float x, float y, float z);
  37. void getRotation(float & x, float & y, float & z);
  38. void addRotation(float x, float y, float z);
  39. void setScale(float x, float y, float z);
  40. void getScale(float & x, float & y, float & z);
  41. void addScale(float x, float y, float z);
  42. Matrix m_mtxSrc;
  43. Matrix m_mtxTrans;
  44. private:
  45. Vertex3D m_vtxT;
  46. Vertex3D m_vtxR;
  47. Vertex3D m_vtxS;
  48. };
  49. #endif // NODE_H