llvoavatar.h 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314
  1. /**
  2. * @file llvoavatar.h
  3. * @brief Declaration of LLVOAvatar class which is a derivation of
  4. * LLViewerObject
  5. *
  6. * $LicenseInfo:firstyear=2001&license=viewergpl$
  7. *
  8. * Copyright (c) 2001-2009, Linden Research, Inc.
  9. *
  10. * Second Life Viewer Source Code
  11. * The source code in this file ("Source Code") is provided by Linden Lab
  12. * to you under the terms of the GNU General Public License, version 2.0
  13. * ("GPL"), unless you have obtained a separate licensing agreement
  14. * ("Other License"), formally executed by you and Linden Lab. Terms of
  15. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  16. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  17. *
  18. * There are special exceptions to the terms and conditions of the GPL as
  19. * it is applied to this Source Code. View the full text of the exception
  20. * in the file doc/FLOSS-exception.txt in this software distribution, or
  21. * online at
  22. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  23. *
  24. * By copying, modifying or distributing this software, you acknowledge
  25. * that you have read and understood your obligations described above,
  26. * and agree to abide by those obligations.
  27. *
  28. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  29. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  30. * COMPLETENESS OR PERFORMANCE.
  31. * $/LicenseInfo$
  32. */
  33. #ifndef LL_VOAVATAR_H
  34. #define LL_VOAVATAR_H
  35. #include <deque>
  36. #include "boost/signals2.hpp"
  37. #include "boost/unordered_map.hpp"
  38. #include "llavatarappearancedefines.h"
  39. #include "llcharacter.h"
  40. #include "lldriverparam.h"
  41. #include "llmaterialtable.h"
  42. #include "llrendertarget.h"
  43. #include "lltexglobalcolor.h"
  44. #include "llwearabletype.h"
  45. #include "llchat.h"
  46. #include "llmutelist.h"
  47. #include "llviewerjointattachment.h"
  48. #include "llviewerjointmesh.h"
  49. #include "llviewertexlayer.h"
  50. class LLHUDEffectSpiral;
  51. class LLHUDText;
  52. class LLMeshSkinInfo;
  53. #if LL_PUPPETRY
  54. class LLPuppetMotion;
  55. #endif
  56. class LLViewerWearable;
  57. class LLVoiceVisualizer;
  58. struct LLAppearanceMessageContents;
  59. //------------------------------------------------------------------------
  60. // LLVOAvatar
  61. //------------------------------------------------------------------------
  62. class LLVOAvatar : public LLAvatarAppearance, public LLViewerObject,
  63. public LLMuteListObserver, public boost::signals2::trackable
  64. {
  65. protected:
  66. LOG_CLASS(LLVOAvatar);
  67. public:
  68. friend class LLVOAvatarSelf;
  69. /******************************************************************************
  70. ** **
  71. ** INITIALIZATION
  72. **/
  73. public:
  74. LL_VOLUME_AREANA_NEW_DELETE
  75. LLVOAvatar(const LLUUID& id, LLViewerRegion* regionp);
  76. void markDead() override;
  77. // Setups data that is only initialized once per class.
  78. static void initClass();
  79. // Cleanups data that is only initialized once per class.
  80. static void cleanupClass();
  81. // Called after construction to initialize the class.
  82. void initInstance() override;
  83. protected:
  84. ~LLVOAvatar() override;
  85. /** Initialization
  86. ** **
  87. *****************************************************************************/
  88. /******************************************************************************
  89. ** **
  90. ** INHERITED
  91. **/
  92. // LLMuteListObserver interface
  93. void onChange() override;
  94. //--------------------------------------------------------------------
  95. // LLViewerObject interface and related
  96. //--------------------------------------------------------------------
  97. public:
  98. void updateGL() override;
  99. LL_INLINE LLVOAvatar* asAvatar() override { return this; }
  100. U32 processUpdateMessage(LLMessageSystem* mesgsys, void** user_data,
  101. U32 block_num, EObjectUpdateType upd_type,
  102. LLDataPacker* dp) override;
  103. void idleUpdate(F64 time) override;
  104. bool updateLOD() override;
  105. bool updateJointLODs();
  106. void updateLODRiggedAttachments();
  107. // Whether this object needs to do an idleUpdate:
  108. LL_INLINE bool isActive() const override { return true; }
  109. void bakedTextureOriginCounts(S32& sb_count, S32& host_count,
  110. S32& both_count, S32& neither_count);
  111. void updateTextures() override;
  112. LLViewerFetchedTexture* getBakedTextureImage(U8 te, const LLUUID& id);
  113. LLViewerTexture* getBakedTexture(U8 te);
  114. // If setting a baked texture, need to request it from a non-local sim:
  115. S32 setTETexture(U8 te, const LLUUID& uuid) override;
  116. void onShift(const LLVector4a& shift_vector) override;
  117. U32 getPartitionType() const override;
  118. const LLVector3 getRenderPosition() const override;
  119. void updateDrawable(bool force_damped) override;
  120. LLDrawable* createDrawable() override;
  121. LL_INLINE bool updateGeometry(LLDrawable*) override { return true; }
  122. void setPixelAreaAndAngle() override;
  123. void updateRegion(LLViewerRegion*) override {}
  124. void updateSpatialExtents(LLVector4a& min, LLVector4a& max) override;
  125. void calculateSpatialExtents(LLVector4a& new_min, LLVector4a& new_max);
  126. // 'face' is the face to check, -1 = ALL_SIDES
  127. // 'face_hit' is the face that got hit
  128. // 'intersection' returns the intersection point
  129. // 'tex_coord' returns the texture coordinates of the intersection point
  130. // 'normal' returns the surface normal at the intersection point
  131. // 'tangent'returns the surface tangent at the intersection point
  132. bool lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end,
  133. S32 face = -1, bool pick_transparent = false,
  134. bool pick_rigged = false, S32* face_hit = NULL,
  135. LLVector4a* intersection = NULL,
  136. LLVector2* tex_coord = NULL,
  137. LLVector4a* normal = NULL,
  138. LLVector4a* tangent = NULL) override;
  139. virtual LLViewerObject* lineSegmentIntersectRiggedAttachments(
  140. const LLVector4a& start,
  141. const LLVector4a& end,
  142. S32 face = -1,
  143. bool pick_transparent = false,
  144. bool pick_rigged = false,
  145. S32* face_hit = NULL,
  146. LLVector4a* intersection = NULL,
  147. LLVector2* tex_coord = NULL,
  148. LLVector4a* normal = NULL,
  149. LLVector4a* tangent = NULL);
  150. protected:
  151. bool allLocalTexturesCompletelyDownloaded() const;
  152. bool allBakedTexturesCompletelyDownloaded() const;
  153. bool allTexturesCompletelyDownloaded(uuid_list_t& ids) const;
  154. void collectLocalTextureUUIDs(uuid_list_t& ids) const;
  155. void collectBakedTextureUUIDs(uuid_list_t& ids) const;
  156. void collectTextureUUIDs(uuid_list_t& ids);
  157. void releaseOldTextures();
  158. //--------------------------------------------------------------------
  159. // LLCharacter interface and related
  160. //--------------------------------------------------------------------
  161. public:
  162. LLVector3 getCharacterPosition() override;
  163. LLQuaternion getCharacterRotation() override;
  164. LLVector3 getCharacterVelocity() override;
  165. LLVector3 getCharacterAngularVelocity() override;
  166. LLUUID remapMotionID(const LLUUID& id);
  167. bool startMotion(const LLUUID& id, F32 time_offset = 0.f) override;
  168. bool stopMotion(const LLUUID& id, bool stop_immediate = false) override;
  169. LL_INLINE virtual bool hasMotionFromSource(const LLUUID& source_id)
  170. {
  171. return false;
  172. }
  173. LL_INLINE virtual void stopMotionFromSource(const LLUUID& source_id)
  174. {
  175. }
  176. void requestStopMotion(LLMotion* motion) override;
  177. LLMotion* findMotion(const LLUUID& id) const;
  178. void startDefaultMotions();
  179. LLJoint* getJoint(U32 key) override;
  180. void rebuildAttachmentOverrides();
  181. void updateAttachmentOverrides();
  182. void addAttachmentOverridesForObject(LLViewerObject* vo,
  183. uuid_list_t* meshes_seen = NULL,
  184. bool recursive = true);
  185. void removeAttachmentOverridesForObject(LLViewerObject* vo);
  186. void removeAttachmentOverridesForObject(const LLUUID& mesh_id);
  187. bool jointIsRiggedTo(U32 joint_key);
  188. void clearAttachmentOverrides();
  189. LL_INLINE const LLUUID& getID() override { return mID; }
  190. void addDebugText(const std::string& text) override;
  191. F32 getTimeDilation() override;
  192. void getGround(const LLVector3& in_pos, LLVector3& out_pos,
  193. LLVector3& out_norm) override;
  194. F32 getPixelArea() const override;
  195. LLVector3d getPosGlobalFromAgent(const LLVector3& position) override;
  196. LLVector3 getPosAgentFromGlobal(const LLVector3d& position) override;
  197. void updateVisualParams() override;
  198. void updateRiggingInfo() override;
  199. private:
  200. uuid_list_t mActiveOverrideMeshes;
  201. // Used by updateRiggingInfo() only, to detect rigging changes in meshes
  202. // or their LOD. Implemented with two vectors replacing mLastRiggingInfoKey
  203. // to avoid costly maps reallocations and comparisons. HB
  204. uuid_vec_t mLastRiggingInfoIDs;
  205. std::vector<S32> mLastRiggingInfoLODs;
  206. // Replaces a stack-allocated vector that would end up being reallocated
  207. // and resized in a very costly way at each call. HB
  208. std::vector<LLVOVolume*> mTempVolumes;
  209. /** Inherited
  210. ** **
  211. *****************************************************************************/
  212. /******************************************************************************
  213. ** **
  214. ** STATE
  215. **/
  216. public:
  217. // True if this avatar is for UI preview floaters (no associated user)
  218. virtual LL_INLINE bool isUIAvatar() const { return false; }
  219. // True if this avatar is a puppet (no associated user)
  220. virtual LL_INLINE bool isPuppetAvatar() const { return false; }
  221. virtual LL_INLINE LLVOAvatar* getAttachedAvatar()
  222. {
  223. return NULL;
  224. }
  225. virtual LL_INLINE LLVOAvatar* getAttachedAvatar() const
  226. {
  227. return NULL;
  228. }
  229. private: // Aligned members
  230. alignas(16) LLVector4a mImpostorExtents[2];
  231. //--------------------------------------------------------------------
  232. // Updates
  233. //--------------------------------------------------------------------
  234. private:
  235. void updateFootstepSounds();
  236. void computeUpdatePeriod(bool& visible);
  237. void updateTimeStep();
  238. void updateRootPositionAndRotation(F32 speed, bool sat_on_ground);
  239. void accountRenderComplexityForObject(LLViewerObject* object, U32& cost);
  240. public:
  241. virtual bool updateCharacter();
  242. void idleUpdateVoiceVisualizer(bool voice_enabled);
  243. void idleUpdateMisc(bool detailed_update);
  244. virtual void idleUpdateAppearanceAnimation();
  245. void idleUpdateLipSync();
  246. void idleUpdateLoadingEffect();
  247. void idleUpdateWindEffect();
  248. void idleUpdateNameTag(const LLVector3& root_pos_last);
  249. void clearNameTag();
  250. void deleteNameTag();
  251. static void invalidateNameTag(const LLUUID& agent_id);
  252. // Forces all name tags to rebuild, useful when display names turned on/off
  253. static void invalidateNameTags();
  254. void idleUpdateRenderComplexity();
  255. void calculateUpdateRenderComplexity();
  256. LL_INLINE void updateVisualComplexity() { mVisualComplexityStale = true; }
  257. LL_INLINE U32 getVisualComplexity() { return mVisualComplexity; }
  258. LL_INLINE F32 getAttachmentSurfaceArea() { return mAttachmentSurfaceArea; }
  259. LL_INLINE void addAttachmentArea(F32 delta) { mAttachmentSurfaceArea += delta; }
  260. LL_INLINE void subtractAttachmentArea(F32 delta)
  261. {
  262. if (mAttachmentSurfaceArea <= delta)
  263. {
  264. mAttachmentSurfaceArea = 0.f;
  265. }
  266. else
  267. {
  268. mAttachmentSurfaceArea -= delta;
  269. }
  270. }
  271. LL_INLINE U32 getAttachmentSurfaceBytes() { return mAttachmentGeometryBytes; }
  272. LL_INLINE void addAttachmentBytes(U32 dlt) { mAttachmentGeometryBytes += dlt; }
  273. LL_INLINE void subtractAttachmentBytes(U32 delta)
  274. {
  275. if (mAttachmentGeometryBytes < delta)
  276. {
  277. mAttachmentGeometryBytes = 0;
  278. }
  279. else
  280. {
  281. mAttachmentGeometryBytes -= delta;
  282. }
  283. }
  284. LL_INLINE LLColor4& getMutedAVColor() { return mMutedAVColor; }
  285. LL_INLINE virtual bool useImpostors() { return sUseImpostors; }
  286. LL_INLINE virtual U32 getMaxNonImpostors() { return sMaxNonImpostors; }
  287. void idleUpdateBelowWater();
  288. static void updateSettings();
  289. //--------------------------------------------------------------------
  290. // Static preferences (controlled by user settings/menus)
  291. //--------------------------------------------------------------------
  292. public:
  293. static S32 sRenderName;
  294. static S32 sNumLODChangesThisFrame;
  295. static S32 sNumVisibleChatBubbles;
  296. // Distance at which avatars will render:
  297. static F32 sRenderDistance;
  298. static F32 sLODFactor; // User-settable LOD factor
  299. static F32 sPhysicsLODFactor; // User-settable physics LOD factor
  300. static bool sRenderGroupTitles;
  301. static bool sShowAnimationDebug; // Show animation debug info
  302. static bool sUseImpostors; // Use impostors for far avatars
  303. static bool sUsePuppetImpostors; // Use impostors for avatar puppets
  304. static U32 sMaxNonImpostors;
  305. static U32 sMaxNonImpostorsPuppets;
  306. static bool sVisibleInFirstPerson;
  307. static bool sDebugInvisible;
  308. static bool sShowAttachmentPoints;
  309. static bool sAvatarPhysics; // true to enable avatar physics
  310. // Output total number of joints being touched for each avatar:
  311. static bool sJointDebug;
  312. static bool sLipSyncEnabled;
  313. static std::string sAgentAppearanceServiceURL;
  314. //--------------------------------------------------------------------
  315. // Region state
  316. //--------------------------------------------------------------------
  317. public:
  318. const LLHost& getObjectHost() const;
  319. //--------------------------------------------------------------------
  320. // Loading state
  321. //--------------------------------------------------------------------
  322. public:
  323. bool isFullyLoaded(bool truly = false) const;
  324. virtual bool isTooComplex() const;
  325. bool visualParamWeightsAreDefault();
  326. bool sendAvatarTexturesRequest(bool force = false);
  327. protected:
  328. virtual bool getIsCloud();
  329. bool updateIsFullyLoaded();
  330. bool processFullyLoadedChange(bool loading);
  331. void updateRuthTimer(bool loading);
  332. F32 calcMorphAmount();
  333. private:
  334. bool mFullyLoaded;
  335. bool mPreviousFullyLoaded;
  336. bool mFullyLoadedInitialized;
  337. S32 mFullyLoadedFrameCounter;
  338. LLFrameTimer mFullyLoadedTimer;
  339. LLFrameTimer mRuthTimer;
  340. protected:
  341. LLFrameTimer mInvisibleTimer;
  342. /** State
  343. ** **
  344. *****************************************************************************/
  345. /******************************************************************************
  346. ** **
  347. ** SKELETON
  348. **/
  349. protected:
  350. // Returns LLViewerJoint
  351. LLAvatarJoint* createAvatarJoint() override;
  352. // Returns LLViewerJointMesh
  353. LLAvatarJointMesh* createAvatarJointMesh() override;
  354. public:
  355. void updateHeadOffset();
  356. void postPelvisSetRecalc();
  357. bool loadSkeletonNode() override;
  358. void buildCharacter() override;
  359. void initAttachmentPoints(bool ignore_hud_joints = false);
  360. void resetVisualParams();
  361. public:
  362. U32 mLastSkeletonSerialNum;
  363. /** Skeleton
  364. ** **
  365. *****************************************************************************/
  366. /******************************************************************************
  367. ** **
  368. ** RENDERING
  369. **/
  370. public:
  371. enum VisualMuteSettings
  372. {
  373. AV_RENDER_NORMALLY = 0,
  374. AV_DO_NOT_RENDER = 1,
  375. AV_ALWAYS_RENDER = 2
  376. };
  377. void setVisualMuteSettings(VisualMuteSettings value);
  378. LL_INLINE VisualMuteSettings getVisualMuteSettings()
  379. {
  380. return sUseImpostors? mVisuallyMuteSetting : AV_RENDER_NORMALLY;
  381. }
  382. virtual bool isVisuallyMuted();
  383. LL_INLINE bool isInMuteList() { return mCachedMute; }
  384. //MK
  385. LL_INLINE bool isRLVMuted() { return mCachedRLVMute; }
  386. //mk
  387. U32 renderImpostor(LLColor4U color = LLColor4U(255, 255, 255, 255),
  388. S32 diffuse_channel = 0);
  389. U32 renderRigid();
  390. U32 renderSkinned();
  391. LL_INLINE F32 getLastSkinTime() { return mLastSkinTime; }
  392. U32 renderTransparent(bool first_pass);
  393. void renderCollisionVolumes();
  394. void renderBones(const std::string& selected_joint = LLStringUtil::null);
  395. void renderJoints();
  396. void setMinimapColor(const LLColor4& color);
  397. LL_INLINE const LLColor4& getMinimapColor() const
  398. {
  399. return mMinimapColor;
  400. }
  401. static const LLColor4& getMinimapColor(const LLUUID& id);
  402. void setNameTagColor(const LLColor4& color);
  403. LL_INLINE void setRadarColor(const LLColor4& color)
  404. {
  405. mRadarColor = color;
  406. }
  407. LL_INLINE const LLColor4& getRadarColor() const
  408. {
  409. return mRadarColor;
  410. }
  411. static void deleteCachedImages(bool clearAll = true);
  412. static void destroyGL();
  413. static void restoreGL();
  414. private:
  415. bool shouldAlphaMask();
  416. public:
  417. S32 mSpecialRenderMode; // Special lighting
  418. // Estimated surface area of attachments:
  419. F32 mAttachmentSurfaceArea;
  420. // Estimated bytes used by attachments
  421. U32 mAttachmentGeometryBytes;
  422. private:
  423. // value of gFrameTimeSeconds at last skin update
  424. F32 mLastSkinTime;
  425. S32 mUpdatePeriod;
  426. // number of faces generated when creating the avatar drawable, does not
  427. // include splitted faces due to long vertex buffer.
  428. S32 mNumInitFaces;
  429. // Time to update mCachedVisualMute
  430. F32 mCachedVisualMuteUpdateTime;
  431. // Cached mute flags and description for this avatar
  432. S32 mCachedMuteFlags;
  433. std::string mCachedMuteDesc;
  434. LLColor4 mMutedAVColor;
  435. LLColor4 mMinimapColor;
  436. LLColor4 mNameTagColor;
  437. LLColor4 mRadarColor;
  438. VisualMuteSettings mVisuallyMuteSetting;
  439. // avatar has been animated and verts have not been updated
  440. bool mNeedsSkin;
  441. // Cached return values for mutes checking functions
  442. bool mCachedVisualMute;
  443. bool mCachedMute;
  444. //MK
  445. bool mCachedRLVMute;
  446. //mk
  447. mutable bool mVisualComplexityStale;
  448. mutable U32 mVisualComplexity;
  449. F32 mComplexityUpdateTime;
  450. typedef fast_hmap<LLUUID, LLColor4> colors_map_t;
  451. static colors_map_t sMinimapColorsMap;
  452. //--------------------------------------------------------------------
  453. // Morph masks
  454. //--------------------------------------------------------------------
  455. public:
  456. void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_comp,
  457. LLAvatarAppearanceDefines::EBakedTextureIndex index =
  458. LLAvatarAppearanceDefines::BAKED_NUM_INDICES) override;
  459. //--------------------------------------------------------------------
  460. // Global colors
  461. //--------------------------------------------------------------------
  462. public:
  463. void onGlobalColorChanged(const LLTexGlobalColor* global_color,
  464. bool upload_bake) override;
  465. //--------------------------------------------------------------------
  466. // Visibility
  467. //--------------------------------------------------------------------
  468. //MK
  469. LL_INLINE bool getVisible() { return mVisible; }
  470. //mk
  471. protected:
  472. void updateVisibility();
  473. private:
  474. U32 mVisibilityRank;
  475. bool mVisible;
  476. //--------------------------------------------------------------------
  477. // Impostors
  478. //--------------------------------------------------------------------
  479. public:
  480. virtual bool isImpostor();
  481. LL_INLINE bool needsImpostorUpdate() const { return mNeedsImpostorUpdate; }
  482. LL_INLINE const LLVector3& getImpostorOffset() const
  483. {
  484. return mImpostorOffset;
  485. }
  486. LL_INLINE void setImpostorDim(const LLVector2& dim)
  487. {
  488. mImpostorDim = dim;
  489. }
  490. LL_INLINE const LLVector2& getImpostorDim() const
  491. {
  492. return mImpostorDim;
  493. }
  494. void getImpostorValues(LLVector4a* extents, LLVector3& angle,
  495. F32& distance) const;
  496. void cacheImpostorValues();
  497. LL_INLINE const LLVector3* getLastAnimExtents() const
  498. {
  499. return mLastAnimExtents;
  500. }
  501. static void resetImpostors();
  502. static void updateImpostors();
  503. public:
  504. LLRenderTarget mImpostor;
  505. bool mNeedsImpostorUpdate;
  506. private:
  507. LLVector3 mImpostorOffset;
  508. LLVector2 mImpostorDim;
  509. bool mNeedsAnimUpdate;
  510. bool mNeedsExtentUpdate;
  511. S32 mNextFrameForExtentUpdate;
  512. LLVector3 mImpostorAngle;
  513. F32 mImpostorDistance;
  514. F32 mImpostorPixelArea;
  515. LLVector3 mLastAnimExtents[2];
  516. LLVector3 mLastAnimBasePos;
  517. //--------------------------------------------------------------------
  518. // Wind rippling in clothes
  519. //--------------------------------------------------------------------
  520. public:
  521. LLVector4 mWindVec;
  522. F32 mRipplePhase;
  523. bool mBelowWater;
  524. private:
  525. F32 mWindFreq;
  526. LLFrameTimer mRippleTimer;
  527. F32 mRippleTimeLast;
  528. LLVector3 mRippleAccel;
  529. LLVector3 mLastVel;
  530. //--------------------------------------------------------------------
  531. // Culling
  532. //--------------------------------------------------------------------
  533. public:
  534. static void cullAvatarsByPixelArea();
  535. LL_INLINE bool isCulled() const { return mCulled; }
  536. LL_INLINE static void setAvatarCullingDirty()
  537. {
  538. sAvatarCullingDirty = true;
  539. }
  540. LL_INLINE static bool avatarCullingDirty() { return sAvatarCullingDirty; }
  541. private:
  542. bool mCulled;
  543. static bool sAvatarCullingDirty;
  544. /** Rendering
  545. ** **
  546. *****************************************************************************/
  547. /******************************************************************************
  548. ** **
  549. ** TEXTURES
  550. **/
  551. //--------------------------------------------------------------------
  552. // Loading status
  553. //--------------------------------------------------------------------
  554. public:
  555. bool isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type,
  556. U32 index = 0) const override;
  557. virtual bool isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type,
  558. U32 index = 0) const;
  559. virtual bool isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type,
  560. LLViewerWearable* wearable) const;
  561. protected:
  562. bool isFullyBaked();
  563. //--------------------------------------------------------------------
  564. // Baked textures
  565. //--------------------------------------------------------------------
  566. public:
  567. // Return LLViewerTexLayerSet
  568. LLTexLayerSet* createTexLayerSet() override;
  569. // ! BACKWARDS COMPATIBILITY !
  570. void releaseComponentTextures();
  571. protected:
  572. static void onBakedTextureMasksLoaded(bool success,
  573. LLViewerFetchedTexture* src_vi,
  574. LLImageRaw* src,
  575. LLImageRaw* aux_src,
  576. S32 discard_level,
  577. bool is_final,
  578. void* userdata);
  579. static void onInitialBakedTextureLoaded(bool success,
  580. LLViewerFetchedTexture* src_vi,
  581. LLImageRaw* src,
  582. LLImageRaw* aux_src,
  583. S32 discard_level,
  584. bool is_final,
  585. void* userdata);
  586. static void onBakedTextureLoaded(bool success,
  587. LLViewerFetchedTexture* src_vi,
  588. LLImageRaw* src,
  589. LLImageRaw* aux_src,
  590. S32 discard_level,
  591. bool is_final,
  592. void* userdata);
  593. LL_INLINE virtual void removeMissingBakedTextures() {}
  594. void useBakedTexture(const LLUUID& id);
  595. LL_INLINE LLViewerTexLayerSet* getTexLayerSet(U32 index)
  596. {
  597. LLTexLayerSet* layer = mBakedTextureDatas[index].mTexLayerSet;
  598. return layer ? layer->asViewerTexLayerSet() : NULL;
  599. }
  600. uuid_list_t mTextureIDs;
  601. uuid_list_t mCallbackTextureList;
  602. bool mLoadedCallbacksPaused;
  603. //--------------------------------------------------------------------
  604. // Local Textures
  605. //--------------------------------------------------------------------
  606. protected:
  607. virtual void setLocalTexture(LLAvatarAppearanceDefines::ETextureIndex type,
  608. LLViewerTexture* tex,
  609. bool baked_version_exists, U32 index = 0);
  610. virtual void addLocalTextureStats(LLAvatarAppearanceDefines::ETextureIndex type,
  611. LLViewerFetchedTexture* imagep,
  612. F32 texel_area_ratio, bool rendered,
  613. bool covered_by_baked);
  614. // MULTI-WEARABLE: make self-only ?
  615. virtual void setBakedReady(LLAvatarAppearanceDefines::ETextureIndex type,
  616. bool baked_version_exists, U32 index = 0);
  617. //--------------------------------------------------------------------
  618. // Texture accessors
  619. //--------------------------------------------------------------------
  620. private:
  621. virtual void setImage(U8 te, LLViewerTexture* imagep, U32 index);
  622. virtual LLViewerTexture* getImage(U8 te, U32 index) const;
  623. std::string getImageURL(U8 te, const LLUUID& uuid);
  624. void checkTextureLoading();
  625. //--------------------------------------------------------------------
  626. // Layers
  627. //--------------------------------------------------------------------
  628. protected:
  629. void deleteLayerSetCaches(bool clear_all = true);
  630. void addBakedTextureStats(LLViewerFetchedTexture* imagep, F32 pixel_area,
  631. F32 texel_area_ratio);
  632. //--------------------------------------------------------------------
  633. // Composites
  634. //--------------------------------------------------------------------
  635. public:
  636. LL_INLINE void invalidateComposite(LLTexLayerSet*, bool) override
  637. {
  638. }
  639. LL_INLINE virtual void invalidateAll() {}
  640. LL_INLINE virtual void setCompositeUpdatesEnabled(bool) {}
  641. LL_INLINE virtual void setCompositeUpdatesEnabled(U32, bool) {}
  642. LL_INLINE virtual bool isCompositeUpdateEnabled(U32) { return false; }
  643. //--------------------------------------------------------------------
  644. // Static texture/mesh/baked dictionary
  645. //--------------------------------------------------------------------
  646. public:
  647. static bool isIndexLocalTexture(LLAvatarAppearanceDefines::ETextureIndex i);
  648. static bool isIndexBakedTexture(LLAvatarAppearanceDefines::ETextureIndex i);
  649. private:
  650. LL_INLINE static const LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* getDictionary()
  651. {
  652. return sAvatarDictionary;
  653. }
  654. private:
  655. static LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* sAvatarDictionary;
  656. //--------------------------------------------------------------------
  657. // Messaging
  658. //--------------------------------------------------------------------
  659. public:
  660. void onFirstTEMessageReceived();
  661. private:
  662. bool mFirstTEMessageReceived;
  663. bool mFirstAppearanceMessageReceived;
  664. /** Textures
  665. ** **
  666. *****************************************************************************/
  667. /******************************************************************************
  668. ** **
  669. ** MESHES
  670. **/
  671. public:
  672. void debugColorizeSubMeshes(U32 i, const LLColor4& color);
  673. void updateMeshTextures() override;
  674. void updateMeshVisibility();
  675. void updateSexDependentLayerSets(bool upload_bake);
  676. void dirtyMesh() override; // Dirties the avatar mesh
  677. void resetSkeleton();
  678. void updateMeshData();
  679. const F32* getRiggedMatrix(const LLMeshSkinInfo* skin, U32& count);
  680. const LLMatrix4a* getRiggedMatrix4a(const LLMeshSkinInfo* skin,
  681. U32& count);
  682. protected:
  683. void refreshAttachmentBakes();
  684. void releaseMeshData();
  685. virtual void restoreMeshData();
  686. private:
  687. // This ref-counted sub-class is used to cache rigged meshes matrix for use
  688. // by the multiple render passes during one frame. The cache is valid only
  689. // for the current frame, thus the reason for the mFrameNumber stamp. HB
  690. class alignas(16) RiggedMatrix final : public LLRefCount
  691. {
  692. public:
  693. LL_VOLUME_AREANA_NEW_DELETE
  694. public:
  695. // Note: before these variables, we find the 32 bits counter from
  696. // LLRefCount... Since mMatrix4a will be 16-bytes aligned, try and
  697. // reduce the alignment gap in the cache line by filling it up with
  698. // other member variables. HB
  699. U32 mFrameNumber;
  700. U32 mCount;
  701. alignas(16) LLMatrix4a mMatrix4a[LL_MAX_JOINTS_PER_MESH_OBJECT];
  702. F32 mMatrix[LL_MAX_JOINTS_PER_MESH_OBJECT * 12];
  703. };
  704. typedef fast_hmap<LLUUID, LLPointer<RiggedMatrix> > rig_tf_cache_t;
  705. typedef rig_tf_cache_t::iterator rtf_cache_it_t;
  706. rtf_cache_it_t initRiggedMatrixCache(const LLMeshSkinInfo* skin,
  707. U32& count);
  708. // Dirties the avatar mesh with priority:
  709. void dirtyMesh(S32 priority) override;
  710. LLViewerJoint* getViewerJoint(S32 idx);
  711. private:
  712. rig_tf_cache_t mRiggedMatrixDataCache;
  713. S32 mDirtyMesh; // 0 = not dirty, 1 = morphed, 2 = LOD
  714. bool mMeshTexturesDirty;
  715. //--------------------------------------------------------------------
  716. // Destroy invisible mesh
  717. //--------------------------------------------------------------------
  718. protected:
  719. bool mMeshValid;
  720. LLFrameTimer mMeshInvisibleTime;
  721. /** Meshes
  722. ** **
  723. *****************************************************************************/
  724. /******************************************************************************
  725. ** **
  726. ** APPEARANCE
  727. **/
  728. public:
  729. void parseAppearanceMessage(LLMessageSystem* mesgsys,
  730. LLAppearanceMessageContents& msg);
  731. void processAvatarAppearance(LLMessageSystem* mesgsys);
  732. void applyParsedAppearanceMessage(LLAppearanceMessageContents& contents,
  733. bool slam_params = false);
  734. void hideHair();
  735. void hideSkirt();
  736. void startAppearanceAnimation();
  737. void bodySizeChanged() override;
  738. //--------------------------------------------------------------------
  739. // Appearance morphing
  740. //--------------------------------------------------------------------
  741. LL_INLINE bool getIsAppearanceAnimating() const
  742. {
  743. return mAppearanceAnimating;
  744. }
  745. // True if we are computing our appearance via local compositing instead of
  746. // baked textures, as for example during wearable editing or when waiting
  747. // for a subsequent server rebake.
  748. // *FIXME: review isUsingLocalAppearance uses, some should be isEditing
  749. // instead.
  750. LL_INLINE bool isUsingLocalAppearance() const override
  751. {
  752. return mUseLocalAppearance;
  753. }
  754. // True if this avatar should fetch its baked textures via the new
  755. // appearance mechanism.
  756. bool isUsingServerBakes() const override;
  757. void setIsUsingServerBakes(bool newval);
  758. // True if we are currently in appearance editing mode. Often but not
  759. // always the same as isUsingLocalAppearance().
  760. LL_INLINE bool isEditingAppearance() const override
  761. {
  762. return mIsEditingAppearance;
  763. }
  764. private:
  765. LLPointer<LLAppearanceMessageContents> mLastProcessedAppearance;
  766. LLFrameTimer mAppearanceMorphTimer;
  767. F32 mLastAppearanceBlendTime;
  768. bool mAppearanceAnimating;
  769. // Flag for if we are actively in appearance editing mode
  770. bool mIsEditingAppearance;
  771. // Flag for if we are using a local composite
  772. bool mUseLocalAppearance;
  773. // Flag for if baked textures should be fetched from baking service (false
  774. // if they are temporary uploads)
  775. bool mUseServerBakes;
  776. //--------------------------------------------------------------------
  777. // Visibility
  778. //--------------------------------------------------------------------
  779. public:
  780. bool isVisible() const;
  781. virtual LL_INLINE bool shouldRenderRigged() const { return true; }
  782. public:
  783. static S32 sNumVisibleAvatars; // Number of instances of this class
  784. /** Appearance
  785. ** **
  786. *****************************************************************************/
  787. /******************************************************************************
  788. ** **
  789. ** WEARABLES
  790. **/
  791. //--------------------------------------------------------------------
  792. // Attachments
  793. //--------------------------------------------------------------------
  794. public:
  795. void clampAttachmentPositions();
  796. virtual const LLViewerJointAttachment* attachObject(LLViewerObject* vobj);
  797. virtual bool detachObject(LLViewerObject* vobj);
  798. #if 0 // Not used/needed
  799. void cleanupAttachedMesh(LLViewerObject* vobj);
  800. #endif
  801. static bool getRiggedMeshID(LLViewerObject* vobj, LLUUID& mesh_id);
  802. static LLVOAvatar* findAvatarFromAttachment(LLViewerObject* vobj);
  803. bool isWearingWearableType(LLWearableType::EType type) const override;
  804. LLViewerJointAttachment* getTargetAttachmentPoint(LLViewerObject* vobj);
  805. U32 getNumAttachments() const;
  806. U32 getNumAnimatedObjectAttachments() const; // O(N), not O(1)
  807. protected:
  808. void lazyAttach();
  809. void rebuildRiggedAttachments();
  810. //--------------------------------------------------------------------
  811. // Map of attachment points, by ID
  812. //--------------------------------------------------------------------
  813. public:
  814. // Map of attachment points, by ID
  815. typedef flat_hmap<S32, LLViewerJointAttachment*> attachment_map_t;
  816. attachment_map_t mAttachmentPoints;
  817. std::vector<LLPointer<LLViewerObject> > mPendingAttachment;
  818. typedef std::vector<std::pair<LLViewerObject*,
  819. LLViewerJointAttachment*> > attachments_vec_t;
  820. attachments_vec_t mAttachedObjectsVector;
  821. public:
  822. //--------------------------------------------------------------------
  823. // HUD functions
  824. //--------------------------------------------------------------------
  825. bool hasHUDAttachment() const;
  826. LLBBox getHUDBBox() const;
  827. virtual S32 getMaxAnimatedObjectAttachments() const;
  828. bool canAttachMoreAnimatedObjects(U32 n = 1) const;
  829. /** Wearables
  830. ** **
  831. *****************************************************************************/
  832. /******************************************************************************
  833. ** **
  834. ** ACTIONS
  835. **/
  836. //--------------------------------------------------------------------
  837. // Animations
  838. //--------------------------------------------------------------------
  839. public:
  840. void resetAnimations();
  841. bool isAnyAnimationSignaled(const LLUUID* anim_array, S32 num_anims) const;
  842. void processAnimationStateChanges();
  843. protected:
  844. bool processSingleAnimationStateChange(const LLUUID& anim_id, bool start);
  845. private:
  846. LLTimer mAnimTimer;
  847. F32 mTimeLast;
  848. //--------------------------------------------------------------------
  849. // Animation state data
  850. //--------------------------------------------------------------------
  851. public:
  852. // NOTE: DO NOT convert to safe_hmap: it would crash when using anything
  853. // else than std or boost containers... HB
  854. typedef boost::unordered_map<LLUUID, S32> anim_map_t;
  855. typedef anim_map_t::iterator anim_it_t;
  856. // Requested state of Animation name/value
  857. anim_map_t mSignaledAnimations;
  858. // Current state of Animation name/value
  859. anim_map_t mPlayingAnimations;
  860. typedef std::multimap<LLUUID, LLUUID> anim_src_map_t;
  861. typedef anim_src_map_t::iterator anim_src_map_it_t;
  862. // Object ids that triggered anim ids
  863. anim_src_map_t mAnimationSources;
  864. #if LL_PUPPETRY
  865. LLPuppetMotion* getPuppetMotion();
  866. #endif
  867. //--------------------------------------------------------------------
  868. // Chat
  869. //--------------------------------------------------------------------
  870. public:
  871. void addChat(const LLChat& chat);
  872. void clearChat();
  873. LL_INLINE void startTyping() { mTyping = true; mTypingTimer.reset(); }
  874. LL_INLINE void stopTyping() { mTyping = false; }
  875. private:
  876. bool mVisibleChat;
  877. //--------------------------------------------------------------------
  878. // Lip synch morphs
  879. //--------------------------------------------------------------------
  880. private:
  881. bool mLipSyncActive; // We are morphing for lip sync
  882. LLVisualParam* mOohMorph; // Cached pointers morphs for lip sync
  883. LLVisualParam* mAahMorph; // Cached pointers morphs for lip sync
  884. //--------------------------------------------------------------------
  885. // Flight
  886. //--------------------------------------------------------------------
  887. public:
  888. LLFrameTimer mTimeInAir;
  889. bool mInAir;
  890. /** Actions
  891. ** **
  892. *****************************************************************************/
  893. /******************************************************************************
  894. ** **
  895. ** PHYSICS
  896. **/
  897. private:
  898. bool mTurning; // Controls hysteresis on avatar rotation
  899. F32 mSpeedAccum; // Measures speed (for diagnostics mostly).
  900. F32 mSpeed; // Misc. animation repeated state
  901. //--------------------------------------------------------------------
  902. // Dimensions
  903. //--------------------------------------------------------------------
  904. public:
  905. void resolveHeightGlobal(const LLVector3d& in_pos, LLVector3d& out_pos,
  906. LLVector3& out_norm);
  907. bool distanceToGround(const LLVector3d& start_pt, LLVector3d& collision_pt,
  908. F32 dist_to_intersection_along_ray);
  909. void resolveHeightAgent(const LLVector3& in_pos, LLVector3& out_pos,
  910. LLVector3& out_norm);
  911. void resolveRayCollisionAgent(const LLVector3d start_pt,
  912. const LLVector3d end_pt, LLVector3d& out_pos,
  913. LLVector3& out_norm);
  914. // Slams position to transmitted position (for teleport);
  915. void slamPosition();
  916. //--------------------------------------------------------------------
  917. // Material being stepped on
  918. //--------------------------------------------------------------------
  919. private:
  920. bool mStepOnLand;
  921. U8 mStepMaterial;
  922. LLVector3 mStepObjectVelocity;
  923. /** Physics
  924. ** **
  925. *****************************************************************************/
  926. /******************************************************************************
  927. ** **
  928. ** HIERARCHY
  929. **/
  930. public:
  931. bool setParent(LLViewerObject* parent) override;
  932. void addChild(LLViewerObject* childp) override;
  933. void removeChild(LLViewerObject* childp) override;
  934. //--------------------------------------------------------------------
  935. // Sitting
  936. //--------------------------------------------------------------------
  937. public:
  938. void sitOnObject(LLViewerObject* sit_object);
  939. void getOffObject();
  940. public:
  941. bool mIsSitting;
  942. /** Hierarchy
  943. ** **
  944. *****************************************************************************/
  945. /*****************************************************************************
  946. ** **
  947. ** NAME
  948. **/
  949. public:
  950. // Returns "FirstName LastName". Always omit " Resident" when passed true.
  951. std::string getFullname(bool omit_resident = false);
  952. protected:
  953. static void getAnimLabels(std::vector<std::string>* labels);
  954. static void getAnimNames(std::vector<std::string>* names);
  955. private:
  956. LLWString mNameString; // UTF-8 title + name + status
  957. std::string mTitle;
  958. std::string mCompleteName;
  959. std::string mLegacyName;
  960. S32 mNameMute;
  961. bool mNewResident; // Is last name "Resident" ?
  962. bool mNameAway;
  963. bool mNameBusy;
  964. bool mNameTyping;
  965. bool mNameAppearance;
  966. bool mRenderGroupTitles;
  967. //--------------------------------------------------------------------
  968. // Display the name (then optionally fade it out)
  969. //--------------------------------------------------------------------
  970. public:
  971. LLFrameTimer mChatTimer;
  972. LLPointer<LLHUDText> mNameText;
  973. private:
  974. LLFrameTimer mTimeVisible;
  975. LLFrameTimer mTypingTimer;
  976. std::deque<LLChat> mChats;
  977. bool mTyping;
  978. /** Name
  979. ** **
  980. *****************************************************************************/
  981. /******************************************************************************
  982. ** **
  983. ** SOUNDS
  984. **/
  985. private:
  986. // Responsible for detecting the user's voice signal (and when the user
  987. // speaks, it puts a voice symbol over the avatar's head) and
  988. // gesticulations
  989. LLVoiceVisualizer* mVoiceVisualizer;
  990. F32 mNextVoiceVisualizerUpdate;
  991. S32 mCurrentGesticulationLevel;
  992. //--------------------------------------------------------------------
  993. // Step sound
  994. //--------------------------------------------------------------------
  995. protected:
  996. const LLUUID& getStepSound() const;
  997. private:
  998. // Global table of sound ids per material, and the ground
  999. const static LLUUID sStepSounds[LL_MCODE_END];
  1000. const static LLUUID sStepSoundOnLand;
  1001. //--------------------------------------------------------------------
  1002. // Foot step state (for generating sounds)
  1003. //--------------------------------------------------------------------
  1004. public:
  1005. LL_INLINE void setFootPlane(const LLVector4& plane) { mFootPlane = plane; }
  1006. public:
  1007. LLVector4 mFootPlane;
  1008. private:
  1009. bool mWasOnGroundLeft;
  1010. bool mWasOnGroundRight;
  1011. /** Sounds
  1012. ** **
  1013. *****************************************************************************/
  1014. /******************************************************************************
  1015. ** **
  1016. ** DIAGNOSTICS
  1017. **/
  1018. //--------------------------------------------------------------------
  1019. // General
  1020. //--------------------------------------------------------------------
  1021. public:
  1022. void getSortedJointNames(S32 joint_type,
  1023. std::vector<std::string>& result) const;
  1024. void dumpArchetypeXML(const std::string& filename);
  1025. static void dumpBakedStatus();
  1026. const std::string getBakedStatusForPrintout() const;
  1027. void dumpAvatarTEs(const std::string& context) const;
  1028. public:
  1029. // Total seconds with >=1 unbaked avatars:
  1030. static F32 sUnbakedTime;
  1031. // Last time stats were updated (to prevent multiple updates per frame):
  1032. static F32 sUnbakedUpdateTime;
  1033. // Total seconds with >=1 grey avatars:
  1034. static F32 sGreyTime;
  1035. // Last time stats were updated (to prevent multiple updates per frame):
  1036. static F32 sGreyUpdateTime;
  1037. protected:
  1038. S32 getUnbakedPixelAreaRank();
  1039. protected:
  1040. bool mHasGrey;
  1041. bool mEnableDefaultMotions;
  1042. private:
  1043. F32 mMinPixelArea;
  1044. F32 mMaxPixelArea;
  1045. F32 mAdjustedPixelArea;
  1046. std::string mDebugText;
  1047. //--------------------------------------------------------------------
  1048. // COF monitoring
  1049. //--------------------------------------------------------------------
  1050. public:
  1051. // COF version of last viewer-initiated appearance update request. For
  1052. // non-self avatars, this will remain at default.
  1053. S32 mLastUpdateRequestCOFVersion;
  1054. // COF version of last appearance message received for this avatar.
  1055. S32 mLastUpdateReceivedCOFVersion;
  1056. /** Diagnostics
  1057. ** **
  1058. *****************************************************************************/
  1059. };
  1060. class LLVOAvatarUI final : public LLVOAvatar
  1061. {
  1062. protected:
  1063. LOG_CLASS(LLVOAvatarUI);
  1064. public:
  1065. LLVOAvatarUI(const LLUUID& id, LLViewerRegion* regionp);
  1066. void initInstance() override;
  1067. LL_INLINE bool isUIAvatar() const override { return true; }
  1068. LL_INLINE bool isVisuallyMuted() override { return false; }
  1069. };
  1070. // Baked textures prioty
  1071. constexpr F32 SELF_ADDITIONAL_PRI = 0.75f;
  1072. constexpr F32 ADDITIONAL_PRI = 0.5f;
  1073. constexpr F32 MAX_HOVER_Z = 2.f;
  1074. constexpr F32 MIN_HOVER_Z = -2.f;
  1075. #endif // LL_VO_AVATAR_H