BillBoard.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /***************************************************************************
  2. BillBoard.cpp - description
  3. -------------------
  4. begin : Sun Dec 16 2001
  5. copyright : (C) 2001 by henqvist
  6. email : henqvist@excite.com
  7. ***************************************************************************/
  8. #include "Private.h"
  9. #include "BillBoard.h"
  10. BillBoard::BillBoard(EmTexture * tex, float sizex, float sizey) {
  11. EmAssert(tex != NULL, "texture not allowed to be null");
  12. m_iProperties = 0;
  13. p_Parent = NULL;
  14. m_Texture = tex;
  15. m_fSizexD2 = sizex / 2;
  16. m_fSizeyD2 = sizey / 2;
  17. m_fZOffset = 0;
  18. m_aTexCoord[0].u = 0;
  19. m_aTexCoord[0].v = 0;
  20. m_aTexCoord[1].u = 1;
  21. m_aTexCoord[1].v = 0;
  22. m_aTexCoord[2].u = 1;
  23. m_aTexCoord[2].v = 1;
  24. m_aTexCoord[3].u = 0;
  25. m_aTexCoord[3].v = 1;
  26. m_vtxSrc.x = 0;
  27. m_vtxSrc.y = 0;
  28. m_vtxSrc.z = 0;
  29. }
  30. BillBoard::~BillBoard() {
  31. }
  32. void BillBoard::setProperty(int p) {
  33. m_iProperties |= p;
  34. }
  35. void BillBoard::unsetProperty(int p) {
  36. m_iProperties -= (m_iProperties & p);
  37. }
  38. void BillBoard::setParent(Group* p) {
  39. p_Parent = p;
  40. }
  41. void BillBoard::setTexture(EmTexture* tex) {
  42. m_Texture = tex;
  43. }