PageRenderTime 43ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llvowater.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 96 lines | 52 code | 18 blank | 26 comment | 0 complexity | c11aae8b80a0d377371a00189ea71bc7 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llvowater.h
  3. * @brief Description of LLVOWater class
  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_VOWATER_H
  27. #define LL_VOWATER_H
  28. #include "llviewerobject.h"
  29. #include "llviewertexture.h"
  30. #include "pipeline.h"
  31. #include "v2math.h"
  32. const U32 N_RES = 16; //32 // number of subdivisions of wave tile
  33. const U8 WAVE_STEP = 8;
  34. class LLSurface;
  35. class LLHeavenBody;
  36. class LLVOSky;
  37. class LLFace;
  38. class LLVOWater : public LLStaticViewerObject
  39. {
  40. public:
  41. enum
  42. {
  43. VERTEX_DATA_MASK = (1 << LLVertexBuffer::TYPE_VERTEX) |
  44. (1 << LLVertexBuffer::TYPE_NORMAL) |
  45. (1 << LLVertexBuffer::TYPE_TEXCOORD0)
  46. };
  47. LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
  48. /*virtual*/ void markDead();
  49. // Initialize data that's only inited once per class.
  50. static void initClass();
  51. static void cleanupClass();
  52. /*virtual*/ BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
  53. /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
  54. /*virtual*/ BOOL updateGeometry(LLDrawable *drawable);
  55. /*virtual*/ void updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax);
  56. /*virtual*/ void updateTextures();
  57. /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area
  58. virtual U32 getPartitionType() const;
  59. /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate.
  60. void setUseTexture(const BOOL use_texture);
  61. void setIsEdgePatch(const BOOL edge_patch);
  62. BOOL getUseTexture() const { return mUseTexture; }
  63. BOOL getIsEdgePatch() const { return mIsEdgePatch; }
  64. protected:
  65. BOOL mUseTexture;
  66. BOOL mIsEdgePatch;
  67. S32 mRenderType;
  68. };
  69. class LLVOVoidWater : public LLVOWater
  70. {
  71. public:
  72. LLVOVoidWater(LLUUID const& id, LLPCode pcode, LLViewerRegion* regionp) : LLVOWater(id, pcode, regionp)
  73. {
  74. mRenderType = LLPipeline::RENDER_TYPE_VOIDWATER;
  75. }
  76. /*virtual*/ U32 getPartitionType() const;
  77. };
  78. #endif // LL_VOSURFACEPATCH_H