llvopartgroup.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /**
  2. * @file llvopartgroup.h
  3. * @brief Group of particle systems
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewergpl$
  6. *
  7. * Copyright (c) 2001-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLVOPARTGROUP_H
  33. #define LL_LLVOPARTGROUP_H
  34. #include "llframetimer.h"
  35. #include "llvertexbuffer.h"
  36. #include "llcolor3.h"
  37. #include "llvector3.h"
  38. #include "llviewerobject.h"
  39. #include "llviewerpartsim.h"
  40. #include "llviewerregion.h"
  41. class LLViewerPartGroup;
  42. class LLVOPartGroup : public LLAlphaObject
  43. {
  44. public:
  45. LLVOPartGroup(const LLUUID& id, LLViewerRegion* regionp,
  46. // This is LL_VO_HUD_PART_GROUP for LLVOHUDPartGroup
  47. LLPCode pcode = LL_VO_PART_GROUP);
  48. LL_INLINE LLVOPartGroup* asVOPartGroup() override { return this; }
  49. LL_INLINE bool isActive() const override { return false; }
  50. // Nothing to do.
  51. LL_INLINE void idleUpdate(F64) override {}
  52. F32 getBinRadius() override;
  53. void updateSpatialExtents(LLVector4a& min, LLVector4a& max) override;
  54. LL_INLINE U32 getPartitionType() const override
  55. {
  56. return LLViewerRegion::PARTITION_PARTICLE;
  57. }
  58. bool lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end,
  59. S32 face, bool pick_transparent = false,
  60. bool pick_rigged = false,
  61. S32* face_hit = NULL,
  62. LLVector4a* intersection = NULL,
  63. // Unused pointers:
  64. LLVector2* tex_coord = NULL,
  65. LLVector4a* normal = NULL,
  66. LLVector4a* tangent = NULL) override;
  67. void setPixelAreaAndAngle() override;
  68. LL_INLINE void updateTextures() override {}
  69. LL_INLINE void updateFaceSize(S32) override {}
  70. LLDrawable* createDrawable() override;
  71. bool updateGeometry(LLDrawable* drawable) override;
  72. void getGeometry(const LLViewerPart& part,
  73. LLStrider<LLVector4a>& verticesp);
  74. void getGeometry(S32 idx,
  75. LLStrider<LLVector4a>& verticesp,
  76. LLStrider<LLVector3>& normalsp,
  77. LLStrider<LLVector2>& texcoordsp,
  78. LLStrider<LLColor4U>& colorsp,
  79. LLStrider<LLColor4U>& emissivep,
  80. LLStrider<U16>& indicesp) override;
  81. F32 getPartSize(S32 idx) override;
  82. bool getBlendFunc(S32 idx, U32& src, U32& dst) override;
  83. const LLUUID& getPartOwner(S32 idx);
  84. const LLUUID& getPartSource(S32 idx);
  85. LL_INLINE void setViewerPartGroup(LLViewerPartGroup* group)
  86. {
  87. mViewerPartGroupp = group;
  88. }
  89. LL_INLINE LLViewerPartGroup* getViewerPartGroup() { return mViewerPartGroupp; }
  90. protected:
  91. ~LLVOPartGroup() override = default;
  92. virtual const LLVector3& getCameraPosition() const;
  93. protected:
  94. LLViewerPartGroup* mViewerPartGroupp;
  95. };
  96. class LLVOHUDPartGroup final : public LLVOPartGroup
  97. {
  98. public:
  99. LL_INLINE LLVOHUDPartGroup(const LLUUID& id, LLViewerRegion* regionp)
  100. : LLVOPartGroup(id, regionp, LL_VO_HUD_PART_GROUP)
  101. {
  102. }
  103. protected:
  104. LLDrawable* createDrawable() override;
  105. LL_INLINE U32 getPartitionType() const override
  106. {
  107. return LLViewerRegion::PARTITION_HUD_PARTICLE;
  108. }
  109. LL_INLINE const LLVector3& getCameraPosition() const override
  110. {
  111. return LLVector3::x_axis_neg;
  112. }
  113. };
  114. #endif // LL_LLVOPARTGROUP_H