llhudeffectspiral.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /**
  2. * @file llhudeffectspiral.h
  3. * @brief LLHUDEffectSpiral class definition
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewergpl$
  6. *
  7. * Copyright (c) 2002-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_LLHUDEFFECTSPIRAL_H
  33. #define LL_LLHUDEFFECTSPIRAL_H
  34. #include "llhudeffect.h"
  35. #include "llframetimer.h"
  36. #include "llinterp.h"
  37. #include "llviewerpartsim.h"
  38. class LLVector3d;
  39. class LLViewerObject;
  40. constexpr U32 NUM_TRAIL_POINTS = 40;
  41. class LLHUDEffectSpiral : public LLHUDEffect
  42. {
  43. friend class LLHUDObject;
  44. protected:
  45. LOG_CLASS(LLHUDEffectSpiral);
  46. public:
  47. void markDead() override;
  48. void setTargetObject(LLViewerObject* objectp) override;
  49. LL_INLINE void setVMag(F32 vmag) { mVMag = vmag; }
  50. LL_INLINE void setVOffset(F32 offset) { mVOffset = offset; }
  51. LL_INLINE void setInitialRadius(F32 radius) { mInitialRadius = radius; }
  52. LL_INLINE void setFinalRadius(F32 radius) { mFinalRadius = radius; }
  53. LL_INLINE void setScaleBase(F32 scale) { mScaleBase = scale; }
  54. LL_INLINE void setScaleVar(F32 scale) { mScaleVar = scale; }
  55. LL_INLINE void setSpinRate(F32 rate) { mSpinRate = rate; }
  56. LL_INLINE void setFlickerRate(F32 rate) { mFlickerRate = rate; }
  57. // Start the effect playing locally.
  58. void triggerLocal();
  59. // Factorized code to create the standard beam effect from the agent to an
  60. // object or a global position with the standard agent effect color. HB
  61. static void agentBeamToObject(LLViewerObject* objectp);
  62. static void agentBeamToPosition(const LLVector3d& pos);
  63. // Swirling particles at global position, with optional duration (0 to mark
  64. // dead once sent) and optional immediate sending to server. HB
  65. static void swirlAtPosition(const LLVector3d& pos, F32 duration = -1.f,
  66. bool send_now = false);
  67. // Sphere effect at global position, for 0.25s (used by LLToolPie only). HB
  68. static void sphereAtPosition(const LLVector3d& pos);
  69. protected:
  70. LLHUDEffectSpiral(U8 type);
  71. ~LLHUDEffectSpiral() override = default;
  72. void update() override;
  73. LL_INLINE void render() override {}
  74. void packData(LLMessageSystem* mesgsys) override;
  75. void unpackData(LLMessageSystem* mesgsys, S32 blocknum) override;
  76. private:
  77. LLPointer<LLViewerPartSource> mPartSourcep;
  78. F32 mKillTime;
  79. F32 mVMag;
  80. F32 mVOffset;
  81. F32 mInitialRadius;
  82. F32 mFinalRadius;
  83. F32 mSpinRate;
  84. F32 mFlickerRate;
  85. F32 mScaleBase;
  86. F32 mScaleVar;
  87. LLFrameTimer mTimer;
  88. LLInterpLinear mFadeInterp;
  89. };
  90. #endif // LL_LLHUDEFFECTSPIRAL_H