summaryrefslogtreecommitdiff
path: root/indra/llcommon/llagentconstants.h
blob: 66b4b564bfafcf19c4e78dcb29bdc88658f591fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/** 
 * @file llagentconstants.h
 * @author James Cook, Andrew Meadows, Richard Nelson
 * @brief Shared constants through the system for agents.
 *
 * Copyright (c) 2006-$CurrentYear$, Linden Research, Inc.
 * $License$
 */

#ifndef LL_LLAGENTCONSTANTS_H
#define LL_LLAGENTCONSTANTS_H

const U32 CONTROL_AT_POS_INDEX				= 0;
const U32 CONTROL_AT_NEG_INDEX				= 1;
const U32 CONTROL_LEFT_POS_INDEX			= 2;
const U32 CONTROL_LEFT_NEG_INDEX			= 3;
const U32 CONTROL_UP_POS_INDEX				= 4;
const U32 CONTROL_UP_NEG_INDEX				= 5;
const U32 CONTROL_PITCH_POS_INDEX			= 6;
const U32 CONTROL_PITCH_NEG_INDEX			= 7;
const U32 CONTROL_YAW_POS_INDEX				= 8;
const U32 CONTROL_YAW_NEG_INDEX				= 9;
const U32 CONTROL_FAST_AT_INDEX				= 10;
const U32 CONTROL_FAST_LEFT_INDEX			= 11;
const U32 CONTROL_FAST_UP_INDEX				= 12;
const U32 CONTROL_FLY_INDEX					= 13;
const U32 CONTROL_STOP_INDEX				= 14;
const U32 CONTROL_FINISH_ANIM_INDEX			= 15;
const U32 CONTROL_STAND_UP_INDEX			= 16;
const U32 CONTROL_SIT_ON_GROUND_INDEX		= 17;
const U32 CONTROL_MOUSELOOK_INDEX			= 18;
const U32 CONTROL_NUDGE_AT_POS_INDEX		= 19;
const U32 CONTROL_NUDGE_AT_NEG_INDEX		= 20;
const U32 CONTROL_NUDGE_LEFT_POS_INDEX		= 21;
const U32 CONTROL_NUDGE_LEFT_NEG_INDEX		= 22;
const U32 CONTROL_NUDGE_UP_POS_INDEX		= 23;
const U32 CONTROL_NUDGE_UP_NEG_INDEX		= 24;
const U32 CONTROL_TURN_LEFT_INDEX			= 25;
const U32 CONTROL_TURN_RIGHT_INDEX			= 26;
const U32 CONTROL_AWAY_INDEX				= 27;
const U32 CONTROL_LBUTTON_DOWN_INDEX		= 28;
const U32 CONTROL_LBUTTON_UP_INDEX			= 29;
const U32 CONTROL_ML_LBUTTON_DOWN_INDEX		= 30;
const U32 CONTROL_ML_LBUTTON_UP_INDEX		= 31;
const U32 TOTAL_CONTROLS					= 32;

const U32 AGENT_CONTROL_AT_POS              = 0x1 << CONTROL_AT_POS_INDEX;
const U32 AGENT_CONTROL_AT_NEG              = 0x1 << CONTROL_AT_NEG_INDEX;
const U32 AGENT_CONTROL_LEFT_POS            = 0x1 << CONTROL_LEFT_POS_INDEX;
const U32 AGENT_CONTROL_LEFT_NEG            = 0x1 << CONTROL_LEFT_NEG_INDEX;
const U32 AGENT_CONTROL_UP_POS              = 0x1 << CONTROL_UP_POS_INDEX;
const U32 AGENT_CONTROL_UP_NEG              = 0x1 << CONTROL_UP_NEG_INDEX;
const U32 AGENT_CONTROL_PITCH_POS           = 0x1 << CONTROL_PITCH_POS_INDEX;
const U32 AGENT_CONTROL_PITCH_NEG           = 0x1 << CONTROL_PITCH_NEG_INDEX;
const U32 AGENT_CONTROL_YAW_POS             = 0x1 << CONTROL_YAW_POS_INDEX;
const U32 AGENT_CONTROL_YAW_NEG             = 0x1 << CONTROL_YAW_NEG_INDEX;

const U32 AGENT_CONTROL_FAST_AT             = 0x1 << CONTROL_FAST_AT_INDEX;
const U32 AGENT_CONTROL_FAST_LEFT           = 0x1 << CONTROL_FAST_LEFT_INDEX;
const U32 AGENT_CONTROL_FAST_UP             = 0x1 << CONTROL_FAST_UP_INDEX;

const U32 AGENT_CONTROL_FLY					= 0x1 << CONTROL_FLY_INDEX;
const U32 AGENT_CONTROL_STOP				= 0x1 << CONTROL_STOP_INDEX;
const U32 AGENT_CONTROL_FINISH_ANIM			= 0x1 << CONTROL_FINISH_ANIM_INDEX;
const U32 AGENT_CONTROL_STAND_UP			= 0x1 << CONTROL_STAND_UP_INDEX;
const U32 AGENT_CONTROL_SIT_ON_GROUND		= 0x1 << CONTROL_SIT_ON_GROUND_INDEX;
const U32 AGENT_CONTROL_MOUSELOOK			= 0x1 << CONTROL_MOUSELOOK_INDEX;

const U32 AGENT_CONTROL_NUDGE_AT_POS        = 0x1 << CONTROL_NUDGE_AT_POS_INDEX;
const U32 AGENT_CONTROL_NUDGE_AT_NEG        = 0x1 << CONTROL_NUDGE_AT_NEG_INDEX;
const U32 AGENT_CONTROL_NUDGE_LEFT_POS      = 0x1 << CONTROL_NUDGE_LEFT_POS_INDEX;
const U32 AGENT_CONTROL_NUDGE_LEFT_NEG      = 0x1 << CONTROL_NUDGE_LEFT_NEG_INDEX;
const U32 AGENT_CONTROL_NUDGE_UP_POS        = 0x1 << CONTROL_NUDGE_UP_POS_INDEX;
const U32 AGENT_CONTROL_NUDGE_UP_NEG        = 0x1 << CONTROL_NUDGE_UP_NEG_INDEX;
const U32 AGENT_CONTROL_TURN_LEFT	        = 0x1 << CONTROL_TURN_LEFT_INDEX;
const U32 AGENT_CONTROL_TURN_RIGHT	        = 0x1 << CONTROL_TURN_RIGHT_INDEX;

const U32 AGENT_CONTROL_AWAY				= 0x1 << CONTROL_AWAY_INDEX;

const U32 AGENT_CONTROL_LBUTTON_DOWN		= 0x1 << CONTROL_LBUTTON_DOWN_INDEX;
const U32 AGENT_CONTROL_LBUTTON_UP			= 0x1 << CONTROL_LBUTTON_UP_INDEX;
const U32 AGENT_CONTROL_ML_LBUTTON_DOWN		= 0x1 << CONTROL_ML_LBUTTON_DOWN_INDEX;
const U32 AGENT_CONTROL_ML_LBUTTON_UP		= ((U32)0x1) << CONTROL_ML_LBUTTON_UP_INDEX;

const U32 AGENT_CONTROL_AT 		= AGENT_CONTROL_AT_POS 
								  | AGENT_CONTROL_AT_NEG 
								  | AGENT_CONTROL_NUDGE_AT_POS 
								  | AGENT_CONTROL_NUDGE_AT_NEG;

const U32 AGENT_CONTROL_LEFT 	= AGENT_CONTROL_LEFT_POS 
								  | AGENT_CONTROL_LEFT_NEG 
								  | AGENT_CONTROL_NUDGE_LEFT_POS 
								  | AGENT_CONTROL_NUDGE_LEFT_NEG;

const U32 AGENT_CONTROL_UP 		= AGENT_CONTROL_UP_POS 
								  | AGENT_CONTROL_UP_NEG 
								  | AGENT_CONTROL_NUDGE_UP_POS 
								  | AGENT_CONTROL_NUDGE_UP_NEG;

const U32 AGENT_CONTROL_HORIZONTAL = AGENT_CONTROL_AT 
									 | AGENT_CONTROL_LEFT;

const U32 AGENT_CONTROL_NOT_USED_BY_LSL = AGENT_CONTROL_FLY 
										  | AGENT_CONTROL_STOP 
										  | AGENT_CONTROL_FINISH_ANIM 
										  | AGENT_CONTROL_STAND_UP 
										  | AGENT_CONTROL_SIT_ON_GROUND 
										  | AGENT_CONTROL_MOUSELOOK 
										  | AGENT_CONTROL_AWAY;

const U32 AGENT_CONTROL_MOVEMENT = AGENT_CONTROL_AT 
								   | AGENT_CONTROL_LEFT 
								   | AGENT_CONTROL_UP;

const U32 AGENT_CONTROL_ROTATION = AGENT_CONTROL_PITCH_POS 
								   | AGENT_CONTROL_PITCH_NEG 
								   | AGENT_CONTROL_YAW_POS 
								   | AGENT_CONTROL_YAW_NEG;

const U32 AGENT_CONTROL_NUDGE = AGENT_CONTROL_NUDGE_AT_POS
								| AGENT_CONTROL_NUDGE_AT_NEG
								| AGENT_CONTROL_NUDGE_LEFT_POS
								| AGENT_CONTROL_NUDGE_LEFT_NEG;


// move these up so that we can hide them in "State" for object updates 
// (for now)
const U32 AGENT_ATTACH_OFFSET				= 4;
const U32 AGENT_ATTACH_MASK					= 0xf << AGENT_ATTACH_OFFSET;
const U32 AGENT_ATTACH_CLEAR				= 0x00;

// RN: this method swaps the upper and lower nibbles to maintain backward 
// compatibility with old objects that only used the upper nibble
#define ATTACHMENT_ID_FROM_STATE(state) ((S32)((((U8)state & AGENT_ATTACH_MASK) >> 4) | (((U8)state & ~AGENT_ATTACH_MASK) << 4)))

// test state for use in testing grabbing the camera
const U32 AGENT_CAMERA_OBJECT				= 0x1 << 3;

const F32 MAX_ATTACHMENT_DIST = 3.5f; // meters?

#endif