PageRenderTime 30ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llhudeffectpointat.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 84 lines | 47 code | 11 blank | 26 comment | 0 complexity | 8340aeb7840601dbaa3b4851b8b6b971 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llhudeffectpointat.h
  3. * @brief LLHUDEffectPointAt class definition
  4. *
  5. * $LicenseInfo:firstyear=2002&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_LLHUDEFFECTPOINTAT_H
  27. #define LL_LLHUDEFFECTPOINTAT_H
  28. #include "llframetimer.h"
  29. #include "llhudeffect.h"
  30. class LLViewerObject;
  31. class LLVOAvatar;
  32. typedef enum e_pointat_type
  33. {
  34. POINTAT_TARGET_NONE,
  35. POINTAT_TARGET_SELECT,
  36. POINTAT_TARGET_GRAB,
  37. POINTAT_TARGET_CLEAR,
  38. POINTAT_NUM_TARGETS
  39. } EPointAtType;
  40. class LLHUDEffectPointAt : public LLHUDEffect
  41. {
  42. public:
  43. friend class LLHUDObject;
  44. /*virtual*/ void markDead();
  45. /*virtual*/ void setSourceObject(LLViewerObject* objectp);
  46. BOOL setPointAt(EPointAtType target_type, LLViewerObject *object, LLVector3 position);
  47. void clearPointAtTarget();
  48. EPointAtType getPointAtType() { return mTargetType; }
  49. const LLVector3& getPointAtPosAgent() { return mTargetPos; }
  50. const LLVector3d getPointAtPosGlobal();
  51. protected:
  52. LLHUDEffectPointAt(const U8 type);
  53. ~LLHUDEffectPointAt();
  54. /*virtual*/ void render();
  55. /*virtual*/ void packData(LLMessageSystem *mesgsys);
  56. /*virtual*/ void unpackData(LLMessageSystem *mesgsys, S32 blocknum);
  57. // lookat behavior has either target position or target object with offset
  58. void setTargetObjectAndOffset(LLViewerObject *objp, LLVector3d offset);
  59. void setTargetPosGlobal(const LLVector3d &target_pos_global);
  60. bool calcTargetPosition();
  61. void update();
  62. public:
  63. static BOOL sDebugPointAt;
  64. private:
  65. EPointAtType mTargetType;
  66. LLVector3d mTargetOffsetGlobal;
  67. LLVector3 mLastSentOffsetGlobal;
  68. F32 mKillTime;
  69. LLFrameTimer mTimer;
  70. LLVector3 mTargetPos;
  71. F32 mLastSendTime;
  72. };
  73. #endif // LL_LLHUDEFFECTPOINTAT_H