/indra/newview/llsprite.h

https://bitbucket.org/lindenlab/viewer-beta/ · C++ Header · 106 lines · 60 code · 18 blank · 28 comment · 0 complexity · 67e6807da49e6d063ac835702bd19562 MD5 · raw file

  1. /**
  2. * @file llsprite.h
  3. * @brief LLSprite class definition
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLSPRITE_H
  27. #define LL_LLSPRITE_H
  28. ////#include "vmath.h"
  29. //#include "llmath.h"
  30. #include "v3math.h"
  31. #include "v4math.h"
  32. #include "v4color.h"
  33. #include "lluuid.h"
  34. #include "llgl.h"
  35. #include "llviewertexture.h"
  36. class LLViewerCamera;
  37. class LLFace;
  38. class LLSprite
  39. {
  40. public:
  41. LLSprite(const LLUUID &image_uuid);
  42. ~LLSprite();
  43. void render(LLViewerCamera * camerap);
  44. F32 getWidth() const { return mWidth; }
  45. F32 getHeight() const { return mHeight; }
  46. F32 getYaw() const { return mYaw; }
  47. F32 getPitch() const { return mPitch; }
  48. F32 getAlpha() const { return mColor.mV[VALPHA]; }
  49. LLVector3 getPosition() const { return mPosition; }
  50. LLColor4 getColor() const { return mColor; }
  51. void setPosition(const LLVector3 &position);
  52. void setPitch(const F32 pitch);
  53. void setSize(const F32 width, const F32 height);
  54. void setYaw(const F32 yaw);
  55. void setFollow(const BOOL follow);
  56. void setUseCameraUp(const BOOL use_up);
  57. void setTexMode(LLGLenum mode);
  58. void setColor(const LLColor4 &color);
  59. void setColor(const F32 r, const F32 g, const F32 b, const F32 a);
  60. void setAlpha(const F32 alpha) { mColor.mV[VALPHA] = alpha; }
  61. void setNormal(const LLVector3 &normal) { sNormal = normal; sNormal.normalize();}
  62. F32 getAlpha();
  63. void updateFace(LLFace &face);
  64. public:
  65. LLUUID mImageID;
  66. LLPointer<LLViewerTexture> mImagep;
  67. private:
  68. F32 mWidth;
  69. F32 mHeight;
  70. F32 mWidthDiv2;
  71. F32 mHeightDiv2;
  72. F32 mPitch;
  73. F32 mYaw;
  74. LLVector3 mPosition;
  75. BOOL mFollow;
  76. BOOL mUseCameraUp;
  77. LLColor4 mColor;
  78. LLGLenum mTexMode;
  79. // put
  80. LLVector3 mScaledUp;
  81. LLVector3 mScaledRight;
  82. static LLVector3 sCameraUp;
  83. static LLVector3 sCameraRight;
  84. static LLVector3 sCameraPosition;
  85. static LLVector3 sNormal;
  86. LLVector3 mA,mB,mC,mD; // the four corners of a quad
  87. };
  88. #endif