llagentconstants.h
上传用户:king477883
上传日期:2021-03-01
资源大小:9553k
文件大小:8k
源码类别:

游戏引擎

开发平台:

C++ Builder

  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=viewergpl$
  7.  * 
  8.  * Copyright (c) 2006-2010, 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_LLAGENTCONSTANTS_H
  34. #define LL_LLAGENTCONSTANTS_H
  35. const U32 CONTROL_AT_POS_INDEX = 0;
  36. const U32 CONTROL_AT_NEG_INDEX = 1;
  37. const U32 CONTROL_LEFT_POS_INDEX = 2;
  38. const U32 CONTROL_LEFT_NEG_INDEX = 3;
  39. const U32 CONTROL_UP_POS_INDEX = 4;
  40. const U32 CONTROL_UP_NEG_INDEX = 5;
  41. const U32 CONTROL_PITCH_POS_INDEX = 6;
  42. const U32 CONTROL_PITCH_NEG_INDEX = 7;
  43. const U32 CONTROL_YAW_POS_INDEX = 8;
  44. const U32 CONTROL_YAW_NEG_INDEX = 9;
  45. const U32 CONTROL_FAST_AT_INDEX = 10;
  46. const U32 CONTROL_FAST_LEFT_INDEX = 11;
  47. const U32 CONTROL_FAST_UP_INDEX = 12;
  48. const U32 CONTROL_FLY_INDEX = 13;
  49. const U32 CONTROL_STOP_INDEX = 14;
  50. const U32 CONTROL_FINISH_ANIM_INDEX = 15;
  51. const U32 CONTROL_STAND_UP_INDEX = 16;
  52. const U32 CONTROL_SIT_ON_GROUND_INDEX = 17;
  53. const U32 CONTROL_MOUSELOOK_INDEX = 18;
  54. const U32 CONTROL_NUDGE_AT_POS_INDEX = 19;
  55. const U32 CONTROL_NUDGE_AT_NEG_INDEX = 20;
  56. const U32 CONTROL_NUDGE_LEFT_POS_INDEX = 21;
  57. const U32 CONTROL_NUDGE_LEFT_NEG_INDEX = 22;
  58. const U32 CONTROL_NUDGE_UP_POS_INDEX = 23;
  59. const U32 CONTROL_NUDGE_UP_NEG_INDEX = 24;
  60. const U32 CONTROL_TURN_LEFT_INDEX = 25;
  61. const U32 CONTROL_TURN_RIGHT_INDEX = 26;
  62. const U32 CONTROL_AWAY_INDEX = 27;
  63. const U32 CONTROL_LBUTTON_DOWN_INDEX = 28;
  64. const U32 CONTROL_LBUTTON_UP_INDEX = 29;
  65. const U32 CONTROL_ML_LBUTTON_DOWN_INDEX = 30;
  66. const U32 CONTROL_ML_LBUTTON_UP_INDEX = 31;
  67. const U32 TOTAL_CONTROLS = 32;
  68. const U32 AGENT_CONTROL_AT_POS              = 0x1 << CONTROL_AT_POS_INDEX; // 0x00000001
  69. const U32 AGENT_CONTROL_AT_NEG              = 0x1 << CONTROL_AT_NEG_INDEX; // 0x00000002
  70. const U32 AGENT_CONTROL_LEFT_POS            = 0x1 << CONTROL_LEFT_POS_INDEX; // 0x00000004
  71. const U32 AGENT_CONTROL_LEFT_NEG            = 0x1 << CONTROL_LEFT_NEG_INDEX; // 0x00000008
  72. const U32 AGENT_CONTROL_UP_POS              = 0x1 << CONTROL_UP_POS_INDEX; // 0x00000010
  73. const U32 AGENT_CONTROL_UP_NEG              = 0x1 << CONTROL_UP_NEG_INDEX; // 0x00000020
  74. const U32 AGENT_CONTROL_PITCH_POS           = 0x1 << CONTROL_PITCH_POS_INDEX; // 0x00000040
  75. const U32 AGENT_CONTROL_PITCH_NEG           = 0x1 << CONTROL_PITCH_NEG_INDEX; // 0x00000080
  76. const U32 AGENT_CONTROL_YAW_POS             = 0x1 << CONTROL_YAW_POS_INDEX; // 0x00000100
  77. const U32 AGENT_CONTROL_YAW_NEG             = 0x1 << CONTROL_YAW_NEG_INDEX; // 0x00000200
  78. const U32 AGENT_CONTROL_FAST_AT             = 0x1 << CONTROL_FAST_AT_INDEX; // 0x00000400
  79. const U32 AGENT_CONTROL_FAST_LEFT           = 0x1 << CONTROL_FAST_LEFT_INDEX; // 0x00000800
  80. const U32 AGENT_CONTROL_FAST_UP             = 0x1 << CONTROL_FAST_UP_INDEX; // 0x00001000
  81. const U32 AGENT_CONTROL_FLY = 0x1 << CONTROL_FLY_INDEX; // 0x00002000
  82. const U32 AGENT_CONTROL_STOP = 0x1 << CONTROL_STOP_INDEX; // 0x00004000
  83. const U32 AGENT_CONTROL_FINISH_ANIM = 0x1 << CONTROL_FINISH_ANIM_INDEX; // 0x00008000
  84. const U32 AGENT_CONTROL_STAND_UP = 0x1 << CONTROL_STAND_UP_INDEX; // 0x00010000
  85. const U32 AGENT_CONTROL_SIT_ON_GROUND = 0x1 << CONTROL_SIT_ON_GROUND_INDEX; // 0x00020000
  86. const U32 AGENT_CONTROL_MOUSELOOK = 0x1 << CONTROL_MOUSELOOK_INDEX; // 0x00040000
  87. const U32 AGENT_CONTROL_NUDGE_AT_POS        = 0x1 << CONTROL_NUDGE_AT_POS_INDEX; // 0x00080000
  88. const U32 AGENT_CONTROL_NUDGE_AT_NEG        = 0x1 << CONTROL_NUDGE_AT_NEG_INDEX; // 0x00100000
  89. const U32 AGENT_CONTROL_NUDGE_LEFT_POS      = 0x1 << CONTROL_NUDGE_LEFT_POS_INDEX; // 0x00200000
  90. const U32 AGENT_CONTROL_NUDGE_LEFT_NEG      = 0x1 << CONTROL_NUDGE_LEFT_NEG_INDEX; // 0x00400000
  91. const U32 AGENT_CONTROL_NUDGE_UP_POS        = 0x1 << CONTROL_NUDGE_UP_POS_INDEX; // 0x00800000
  92. const U32 AGENT_CONTROL_NUDGE_UP_NEG        = 0x1 << CONTROL_NUDGE_UP_NEG_INDEX; // 0x01000000
  93. const U32 AGENT_CONTROL_TURN_LEFT         = 0x1 << CONTROL_TURN_LEFT_INDEX; // 0x02000000
  94. const U32 AGENT_CONTROL_TURN_RIGHT         = 0x1 << CONTROL_TURN_RIGHT_INDEX; // 0x04000000
  95. const U32 AGENT_CONTROL_AWAY = 0x1 << CONTROL_AWAY_INDEX; // 0x08000000
  96. const U32 AGENT_CONTROL_LBUTTON_DOWN = 0x1 << CONTROL_LBUTTON_DOWN_INDEX; // 0x10000000
  97. const U32 AGENT_CONTROL_LBUTTON_UP = 0x1 << CONTROL_LBUTTON_UP_INDEX; // 0x20000000
  98. const U32 AGENT_CONTROL_ML_LBUTTON_DOWN = 0x1 << CONTROL_ML_LBUTTON_DOWN_INDEX; // 0x40000000
  99. const U32 AGENT_CONTROL_ML_LBUTTON_UP = ((U32)0x1) << CONTROL_ML_LBUTTON_UP_INDEX; // 0x80000000
  100. const U32 AGENT_CONTROL_AT  = AGENT_CONTROL_AT_POS 
  101.   | AGENT_CONTROL_AT_NEG 
  102.   | AGENT_CONTROL_NUDGE_AT_POS 
  103.   | AGENT_CONTROL_NUDGE_AT_NEG;
  104. const U32 AGENT_CONTROL_LEFT  = AGENT_CONTROL_LEFT_POS 
  105.   | AGENT_CONTROL_LEFT_NEG 
  106.   | AGENT_CONTROL_NUDGE_LEFT_POS 
  107.   | AGENT_CONTROL_NUDGE_LEFT_NEG;
  108. const U32 AGENT_CONTROL_UP  = AGENT_CONTROL_UP_POS 
  109.   | AGENT_CONTROL_UP_NEG 
  110.   | AGENT_CONTROL_NUDGE_UP_POS 
  111.   | AGENT_CONTROL_NUDGE_UP_NEG;
  112. const U32 AGENT_CONTROL_HORIZONTAL = AGENT_CONTROL_AT 
  113.  | AGENT_CONTROL_LEFT;
  114. const U32 AGENT_CONTROL_NOT_USED_BY_LSL = AGENT_CONTROL_FLY 
  115.   | AGENT_CONTROL_STOP 
  116.   | AGENT_CONTROL_FINISH_ANIM 
  117.   | AGENT_CONTROL_STAND_UP 
  118.   | AGENT_CONTROL_SIT_ON_GROUND 
  119.   | AGENT_CONTROL_MOUSELOOK 
  120.   | AGENT_CONTROL_AWAY;
  121. const U32 AGENT_CONTROL_MOVEMENT = AGENT_CONTROL_AT 
  122.    | AGENT_CONTROL_LEFT 
  123.    | AGENT_CONTROL_UP;
  124. const U32 AGENT_CONTROL_ROTATION = AGENT_CONTROL_PITCH_POS 
  125.    | AGENT_CONTROL_PITCH_NEG 
  126.    | AGENT_CONTROL_YAW_POS 
  127.    | AGENT_CONTROL_YAW_NEG;
  128. const U32 AGENT_CONTROL_NUDGE = AGENT_CONTROL_NUDGE_AT_POS
  129. | AGENT_CONTROL_NUDGE_AT_NEG
  130. | AGENT_CONTROL_NUDGE_LEFT_POS
  131. | AGENT_CONTROL_NUDGE_LEFT_NEG;
  132. // move these up so that we can hide them in "State" for object updates 
  133. // (for now)
  134. const U32 AGENT_ATTACH_OFFSET = 4;
  135. const U32 AGENT_ATTACH_MASK = 0xf << AGENT_ATTACH_OFFSET;
  136. const U32 AGENT_ATTACH_CLEAR = 0x00;
  137. // RN: this method swaps the upper and lower nibbles to maintain backward 
  138. // compatibility with old objects that only used the upper nibble
  139. #define ATTACHMENT_ID_FROM_STATE(state) ((S32)((((U8)state & AGENT_ATTACH_MASK) >> 4) | (((U8)state & ~AGENT_ATTACH_MASK) << 4)))
  140. // test state for use in testing grabbing the camera
  141. const U32 AGENT_CAMERA_OBJECT = 0x1 << 3;
  142. const F32 MAX_ATTACHMENT_DIST = 3.5f; // meters?
  143. #endif