PageRenderTime 31ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llcommon/llagentconstants.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 159 lines | 106 code | 22 blank | 31 comment | 0 complexity | 3cd7e9837d22f47aebe74a38023abc46 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llagentconstants.h
  3. * @author James Cook, Andrew Meadows, Richard Nelson
  4. * @brief Shared constants through the system for agents.
  5. *
  6. * $LicenseInfo:firstyear=2006&license=viewerlgpl$
  7. * Second Life Viewer Source Code
  8. * Copyright (C) 2010, Linden Research, Inc.
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation;
  13. * version 2.1 of the License only.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  25. * $/LicenseInfo$
  26. */
  27. #ifndef LL_LLAGENTCONSTANTS_H
  28. #define LL_LLAGENTCONSTANTS_H
  29. const U32 CONTROL_AT_POS_INDEX = 0;
  30. const U32 CONTROL_AT_NEG_INDEX = 1;
  31. const U32 CONTROL_LEFT_POS_INDEX = 2;
  32. const U32 CONTROL_LEFT_NEG_INDEX = 3;
  33. const U32 CONTROL_UP_POS_INDEX = 4;
  34. const U32 CONTROL_UP_NEG_INDEX = 5;
  35. const U32 CONTROL_PITCH_POS_INDEX = 6;
  36. const U32 CONTROL_PITCH_NEG_INDEX = 7;
  37. const U32 CONTROL_YAW_POS_INDEX = 8;
  38. const U32 CONTROL_YAW_NEG_INDEX = 9;
  39. const U32 CONTROL_FAST_AT_INDEX = 10;
  40. const U32 CONTROL_FAST_LEFT_INDEX = 11;
  41. const U32 CONTROL_FAST_UP_INDEX = 12;
  42. const U32 CONTROL_FLY_INDEX = 13;
  43. const U32 CONTROL_STOP_INDEX = 14;
  44. const U32 CONTROL_FINISH_ANIM_INDEX = 15;
  45. const U32 CONTROL_STAND_UP_INDEX = 16;
  46. const U32 CONTROL_SIT_ON_GROUND_INDEX = 17;
  47. const U32 CONTROL_MOUSELOOK_INDEX = 18;
  48. const U32 CONTROL_NUDGE_AT_POS_INDEX = 19;
  49. const U32 CONTROL_NUDGE_AT_NEG_INDEX = 20;
  50. const U32 CONTROL_NUDGE_LEFT_POS_INDEX = 21;
  51. const U32 CONTROL_NUDGE_LEFT_NEG_INDEX = 22;
  52. const U32 CONTROL_NUDGE_UP_POS_INDEX = 23;
  53. const U32 CONTROL_NUDGE_UP_NEG_INDEX = 24;
  54. const U32 CONTROL_TURN_LEFT_INDEX = 25;
  55. const U32 CONTROL_TURN_RIGHT_INDEX = 26;
  56. const U32 CONTROL_AWAY_INDEX = 27;
  57. const U32 CONTROL_LBUTTON_DOWN_INDEX = 28;
  58. const U32 CONTROL_LBUTTON_UP_INDEX = 29;
  59. const U32 CONTROL_ML_LBUTTON_DOWN_INDEX = 30;
  60. const U32 CONTROL_ML_LBUTTON_UP_INDEX = 31;
  61. const U32 TOTAL_CONTROLS = 32;
  62. const U32 AGENT_CONTROL_AT_POS = 0x1 << CONTROL_AT_POS_INDEX; // 0x00000001
  63. const U32 AGENT_CONTROL_AT_NEG = 0x1 << CONTROL_AT_NEG_INDEX; // 0x00000002
  64. const U32 AGENT_CONTROL_LEFT_POS = 0x1 << CONTROL_LEFT_POS_INDEX; // 0x00000004
  65. const U32 AGENT_CONTROL_LEFT_NEG = 0x1 << CONTROL_LEFT_NEG_INDEX; // 0x00000008
  66. const U32 AGENT_CONTROL_UP_POS = 0x1 << CONTROL_UP_POS_INDEX; // 0x00000010
  67. const U32 AGENT_CONTROL_UP_NEG = 0x1 << CONTROL_UP_NEG_INDEX; // 0x00000020
  68. const U32 AGENT_CONTROL_PITCH_POS = 0x1 << CONTROL_PITCH_POS_INDEX; // 0x00000040
  69. const U32 AGENT_CONTROL_PITCH_NEG = 0x1 << CONTROL_PITCH_NEG_INDEX; // 0x00000080
  70. const U32 AGENT_CONTROL_YAW_POS = 0x1 << CONTROL_YAW_POS_INDEX; // 0x00000100
  71. const U32 AGENT_CONTROL_YAW_NEG = 0x1 << CONTROL_YAW_NEG_INDEX; // 0x00000200
  72. const U32 AGENT_CONTROL_FAST_AT = 0x1 << CONTROL_FAST_AT_INDEX; // 0x00000400
  73. const U32 AGENT_CONTROL_FAST_LEFT = 0x1 << CONTROL_FAST_LEFT_INDEX; // 0x00000800
  74. const U32 AGENT_CONTROL_FAST_UP = 0x1 << CONTROL_FAST_UP_INDEX; // 0x00001000
  75. const U32 AGENT_CONTROL_FLY = 0x1 << CONTROL_FLY_INDEX; // 0x00002000
  76. const U32 AGENT_CONTROL_STOP = 0x1 << CONTROL_STOP_INDEX; // 0x00004000
  77. const U32 AGENT_CONTROL_FINISH_ANIM = 0x1 << CONTROL_FINISH_ANIM_INDEX; // 0x00008000
  78. const U32 AGENT_CONTROL_STAND_UP = 0x1 << CONTROL_STAND_UP_INDEX; // 0x00010000
  79. const U32 AGENT_CONTROL_SIT_ON_GROUND = 0x1 << CONTROL_SIT_ON_GROUND_INDEX; // 0x00020000
  80. const U32 AGENT_CONTROL_MOUSELOOK = 0x1 << CONTROL_MOUSELOOK_INDEX; // 0x00040000
  81. const U32 AGENT_CONTROL_NUDGE_AT_POS = 0x1 << CONTROL_NUDGE_AT_POS_INDEX; // 0x00080000
  82. const U32 AGENT_CONTROL_NUDGE_AT_NEG = 0x1 << CONTROL_NUDGE_AT_NEG_INDEX; // 0x00100000
  83. const U32 AGENT_CONTROL_NUDGE_LEFT_POS = 0x1 << CONTROL_NUDGE_LEFT_POS_INDEX; // 0x00200000
  84. const U32 AGENT_CONTROL_NUDGE_LEFT_NEG = 0x1 << CONTROL_NUDGE_LEFT_NEG_INDEX; // 0x00400000
  85. const U32 AGENT_CONTROL_NUDGE_UP_POS = 0x1 << CONTROL_NUDGE_UP_POS_INDEX; // 0x00800000
  86. const U32 AGENT_CONTROL_NUDGE_UP_NEG = 0x1 << CONTROL_NUDGE_UP_NEG_INDEX; // 0x01000000
  87. const U32 AGENT_CONTROL_TURN_LEFT = 0x1 << CONTROL_TURN_LEFT_INDEX; // 0x02000000
  88. const U32 AGENT_CONTROL_TURN_RIGHT = 0x1 << CONTROL_TURN_RIGHT_INDEX; // 0x04000000
  89. const U32 AGENT_CONTROL_AWAY = 0x1 << CONTROL_AWAY_INDEX; // 0x08000000
  90. const U32 AGENT_CONTROL_LBUTTON_DOWN = 0x1 << CONTROL_LBUTTON_DOWN_INDEX; // 0x10000000
  91. const U32 AGENT_CONTROL_LBUTTON_UP = 0x1 << CONTROL_LBUTTON_UP_INDEX; // 0x20000000
  92. const U32 AGENT_CONTROL_ML_LBUTTON_DOWN = 0x1 << CONTROL_ML_LBUTTON_DOWN_INDEX; // 0x40000000
  93. const U32 AGENT_CONTROL_ML_LBUTTON_UP = ((U32)0x1) << CONTROL_ML_LBUTTON_UP_INDEX; // 0x80000000
  94. const U32 AGENT_CONTROL_AT = AGENT_CONTROL_AT_POS
  95. | AGENT_CONTROL_AT_NEG
  96. | AGENT_CONTROL_NUDGE_AT_POS
  97. | AGENT_CONTROL_NUDGE_AT_NEG;
  98. const U32 AGENT_CONTROL_LEFT = AGENT_CONTROL_LEFT_POS
  99. | AGENT_CONTROL_LEFT_NEG
  100. | AGENT_CONTROL_NUDGE_LEFT_POS
  101. | AGENT_CONTROL_NUDGE_LEFT_NEG;
  102. const U32 AGENT_CONTROL_UP = AGENT_CONTROL_UP_POS
  103. | AGENT_CONTROL_UP_NEG
  104. | AGENT_CONTROL_NUDGE_UP_POS
  105. | AGENT_CONTROL_NUDGE_UP_NEG;
  106. const U32 AGENT_CONTROL_HORIZONTAL = AGENT_CONTROL_AT
  107. | AGENT_CONTROL_LEFT;
  108. const U32 AGENT_CONTROL_NOT_USED_BY_LSL = AGENT_CONTROL_FLY
  109. | AGENT_CONTROL_STOP
  110. | AGENT_CONTROL_FINISH_ANIM
  111. | AGENT_CONTROL_STAND_UP
  112. | AGENT_CONTROL_SIT_ON_GROUND
  113. | AGENT_CONTROL_MOUSELOOK
  114. | AGENT_CONTROL_AWAY;
  115. const U32 AGENT_CONTROL_MOVEMENT = AGENT_CONTROL_AT
  116. | AGENT_CONTROL_LEFT
  117. | AGENT_CONTROL_UP;
  118. const U32 AGENT_CONTROL_ROTATION = AGENT_CONTROL_PITCH_POS
  119. | AGENT_CONTROL_PITCH_NEG
  120. | AGENT_CONTROL_YAW_POS
  121. | AGENT_CONTROL_YAW_NEG;
  122. const U32 AGENT_CONTROL_NUDGE = AGENT_CONTROL_NUDGE_AT_POS
  123. | AGENT_CONTROL_NUDGE_AT_NEG
  124. | AGENT_CONTROL_NUDGE_LEFT_POS
  125. | AGENT_CONTROL_NUDGE_LEFT_NEG;
  126. // move these up so that we can hide them in "State" for object updates
  127. // (for now)
  128. const U32 AGENT_ATTACH_OFFSET = 4;
  129. const U32 AGENT_ATTACH_MASK = 0xf << AGENT_ATTACH_OFFSET;
  130. const U32 AGENT_ATTACH_CLEAR = 0x00;
  131. // RN: this method swaps the upper and lower nibbles to maintain backward
  132. // compatibility with old objects that only used the upper nibble
  133. #define ATTACHMENT_ID_FROM_STATE(state) ((S32)((((U8)state & AGENT_ATTACH_MASK) >> 4) | (((U8)state & ~AGENT_ATTACH_MASK) << 4)))
  134. // test state for use in testing grabbing the camera
  135. const U32 AGENT_CAMERA_OBJECT = 0x1 << 3;
  136. const F32 MAX_ATTACHMENT_DIST = 3.5f; // meters?
  137. #endif