PageRenderTime 33ms CodeModel.GetById 2ms app.highlight 23ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llcommon/indra_constants.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 414 lines | 264 code | 65 blank | 85 comment | 0 complexity | 24d1178e3db0ee014514cd449ea4337a MD5 | raw file
  1/** 
  2 * @file indra_constants.h
  3 * @brief some useful short term constants for Indra
  4 *
  5 * $LicenseInfo:firstyear=2001&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
 27#ifndef LL_INDRA_CONSTANTS_H
 28#define LL_INDRA_CONSTANTS_H
 29
 30#include "stdtypes.h"
 31
 32class LLUUID;
 33
 34// At 45 Hz collisions seem stable and objects seem
 35// to settle down at a reasonable rate.
 36// JC 3/18/2003
 37
 38// const F32 PHYSICS_TIMESTEP = 1.f / 45.f;
 39// This must be a #define due to anal retentive restrictions on const expressions
 40// CG 2008-06-05
 41#define PHYSICS_TIMESTEP (1.f / 45.f)
 42
 43const F32 COLLISION_TOLERANCE = 0.1f;
 44const F32 HALF_COLLISION_TOLERANCE = 0.05f;
 45
 46// Time constants
 47const U32 HOURS_PER_LINDEN_DAY		= 4;	
 48const U32 DAYS_PER_LINDEN_YEAR		= 11;
 49
 50const U32 SEC_PER_LINDEN_DAY		= HOURS_PER_LINDEN_DAY * 60 * 60;
 51const U32 SEC_PER_LINDEN_YEAR		= DAYS_PER_LINDEN_YEAR * SEC_PER_LINDEN_DAY;
 52
 53static const F32 REGION_WIDTH_METERS = 256.f;
 54static const S32 REGION_WIDTH_UNITS = 256;
 55static const U32 REGION_WIDTH_U32 = 256;
 56
 57const F32 REGION_HEIGHT_METERS = 4096.f;
 58
 59// Bits for simulator performance query flags
 60enum LAND_STAT_FLAGS
 61{
 62	STAT_FILTER_BY_PARCEL	= 0x00000001,
 63	STAT_FILTER_BY_OWNER	= 0x00000002,
 64	STAT_FILTER_BY_OBJECT	= 0x00000004,
 65	STAT_REQUEST_LAST_ENTRY	= 0x80000000,
 66};
 67
 68enum LAND_STAT_REPORT_TYPE
 69{
 70	STAT_REPORT_TOP_SCRIPTS = 0,
 71	STAT_REPORT_TOP_COLLIDERS
 72};
 73
 74const U32 STAT_FILTER_MASK	= 0x1FFFFFFF;
 75
 76// Region absolute limits
 77static const S32		REGION_AGENT_COUNT_MIN = 1;
 78static const S32		REGION_AGENT_COUNT_MAX = 200;			// Must fit in U8 for the moment (RegionInfo msg)
 79static const S32		REGION_PRIM_COUNT_MIN = 0;
 80static const S32		REGION_PRIM_COUNT_MAX = 40000;
 81static const F32		REGION_PRIM_BONUS_MIN = 1.0;
 82static const F32		REGION_PRIM_BONUS_MAX = 10.0;
 83
 84// Default maximum number of tasks/prims per region.
 85const U32 DEFAULT_MAX_REGION_WIDE_PRIM_COUNT = 15000;
 86
 87const 	F32 	MIN_AGENT_DEPTH			= 0.30f;
 88const 	F32 	DEFAULT_AGENT_DEPTH 	= 0.45f;
 89const 	F32 	MAX_AGENT_DEPTH			= 0.60f;
 90
 91const 	F32 	MIN_AGENT_WIDTH 		= 0.40f;
 92const 	F32 	DEFAULT_AGENT_WIDTH 	= 0.60f;
 93const 	F32 	MAX_AGENT_WIDTH 		= 0.80f;
 94
 95const 	F32 	MIN_AGENT_HEIGHT		= 1.1f;
 96const 	F32 	DEFAULT_AGENT_HEIGHT	= 1.9f;
 97const 	F32 	MAX_AGENT_HEIGHT		= 2.45f;
 98
 99// For linked sets
100const S32 MAX_CHILDREN_PER_TASK = 255;
101const S32 MAX_CHILDREN_PER_PHYSICAL_TASK = 32;
102
103const S32 MAX_JOINTS_PER_OBJECT = 1;	// limiting to 1 until Havok 2.x
104
105const	char* const	DEFAULT_DMZ_SPACE_SERVER	= "192.168.0.140";
106const	char* const	DEFAULT_DMZ_USER_SERVER		= "192.168.0.140";
107const	char* const	DEFAULT_DMZ_DATA_SERVER		= "192.168.0.140";
108const	char* const	DEFAULT_DMZ_ASSET_SERVER	= "http://asset.dmz.lindenlab.com:80";
109
110const	char* const	DEFAULT_AGNI_SPACE_SERVER	= "63.211.139.100";
111const	char* const	DEFAULT_AGNI_USER_SERVER	= "63.211.139.100";
112const	char* const	DEFAULT_AGNI_DATA_SERVER	= "63.211.139.100";
113const	char* const	DEFAULT_AGNI_ASSET_SERVER	= "http://asset.agni.lindenlab.com:80";
114
115// Information about what ports are for what services is in the wiki Name Space Ports page
116// https://wiki.lindenlab.com/wiki/Name_Space_Ports
117const	char* const DEFAULT_LOCAL_ASSET_SERVER	= "http://localhost:12041/asset/tmp";
118const	char* const	LOCAL_ASSET_URL_FORMAT		= "http://%s:12041/asset";
119
120const	U32		DEFAULT_LAUNCHER_PORT			= 12029;
121//const	U32		DEFAULT_BIGBOARD_PORT			= 12030; // Deprecated
122//const	U32		DEFAULT_QUERYSIM_PORT			= 12031; // Deprecated
123const	U32		DEFAULT_DATA_SERVER_PORT		= 12032;
124const	U32		DEFAULT_SPACE_SERVER_PORT		= 12033;
125const	U32		DEFAULT_VIEWER_PORT				= 12034;
126const	U32		DEFAULT_SIMULATOR_PORT			= 12035;
127const	U32		DEFAULT_USER_SERVER_PORT		= 12036;
128const	U32		DEFAULT_RPC_SERVER_PORT			= 12037;
129const	U32		DEFAULT_LOG_DATA_SERVER_PORT	= 12039;
130const	U32		DEFAULT_BACKBONE_PORT			= 12040;
131const   U32		DEFAULT_LOCAL_ASSET_PORT		= 12041;
132//const   U32		DEFAULT_BACKBONE_CAP_PORT		= 12042; // Deprecated
133const   U32		DEFAULT_CAP_PROXY_PORT			= 12043;
134const   U32		DEFAULT_INV_DATA_SERVER_PORT	= 12044;
135const	U32		DEFAULT_CGI_SERVICES_PORT		= 12045;
136
137// Mapserver uses ports 12124 - 12139 to allow multiple mapservers to run
138// on a single host for map tile generation. JC
139const	U32		DEFAULT_MAPSERVER_PORT			= 12124;
140
141// For automatic port discovery when running multiple viewers on one host
142const	U32		PORT_DISCOVERY_RANGE_MIN		= 13000;
143const	U32		PORT_DISCOVERY_RANGE_MAX		= PORT_DISCOVERY_RANGE_MIN + 50;
144
145const	char	LAND_LAYER_CODE					= 'L';
146const	char	WATER_LAYER_CODE				= 'W';
147const	char	WIND_LAYER_CODE					= '7';
148const	char	CLOUD_LAYER_CODE				= '8';
149
150// keys
151// Bit masks for various keyboard modifier keys.
152const MASK MASK_NONE =			0x0000;
153const MASK MASK_CONTROL =		0x0001;		// Mapped to cmd on Macs
154const MASK MASK_ALT =			0x0002;
155const MASK MASK_SHIFT =			0x0004;
156const MASK MASK_NORMALKEYS =    0x0007;     // A real mask - only get the bits for normal modifier keys
157const MASK MASK_MAC_CONTROL =	0x0008;		// Un-mapped Ctrl key on Macs, not used on Windows
158const MASK MASK_MODIFIERS =		MASK_CONTROL|MASK_ALT|MASK_SHIFT|MASK_MAC_CONTROL;
159
160// Special keys go into >128
161const KEY KEY_SPECIAL = 0x80;	// special keys start here
162const KEY KEY_RETURN =	0x81;
163const KEY KEY_LEFT =	0x82;
164const KEY KEY_RIGHT =	0x83;
165const KEY KEY_UP =		0x84;
166const KEY KEY_DOWN =	0x85;
167const KEY KEY_ESCAPE =	0x86;
168const KEY KEY_BACKSPACE =0x87;
169const KEY KEY_DELETE =	0x88;
170const KEY KEY_SHIFT =	0x89;
171const KEY KEY_CONTROL =	0x8A;
172const KEY KEY_ALT =		0x8B;
173const KEY KEY_HOME =	0x8C;
174const KEY KEY_END =		0x8D;
175const KEY KEY_PAGE_UP = 0x8E;
176const KEY KEY_PAGE_DOWN = 0x8F;
177const KEY KEY_HYPHEN = 0x90;
178const KEY KEY_EQUALS = 0x91;
179const KEY KEY_INSERT = 0x92;
180const KEY KEY_CAPSLOCK = 0x93;
181const KEY KEY_TAB =		0x94;
182const KEY KEY_ADD = 	0x95;
183const KEY KEY_SUBTRACT =0x96;
184const KEY KEY_MULTIPLY =0x97;
185const KEY KEY_DIVIDE =	0x98;
186const KEY KEY_F1		= 0xA1;
187const KEY KEY_F2		= 0xA2;
188const KEY KEY_F3		= 0xA3;
189const KEY KEY_F4		= 0xA4;
190const KEY KEY_F5		= 0xA5;
191const KEY KEY_F6		= 0xA6;
192const KEY KEY_F7		= 0xA7;
193const KEY KEY_F8		= 0xA8;
194const KEY KEY_F9		= 0xA9;
195const KEY KEY_F10		= 0xAA;
196const KEY KEY_F11		= 0xAB;
197const KEY KEY_F12		= 0xAC;
198
199const KEY KEY_PAD_UP		= 0xC0;
200const KEY KEY_PAD_DOWN		= 0xC1;
201const KEY KEY_PAD_LEFT		= 0xC2;
202const KEY KEY_PAD_RIGHT		= 0xC3;
203const KEY KEY_PAD_HOME		= 0xC4;
204const KEY KEY_PAD_END		= 0xC5;
205const KEY KEY_PAD_PGUP		= 0xC6;
206const KEY KEY_PAD_PGDN		= 0xC7;
207const KEY KEY_PAD_CENTER	= 0xC8; // the 5 in the middle
208const KEY KEY_PAD_INS		= 0xC9;
209const KEY KEY_PAD_DEL		= 0xCA;
210const KEY KEY_PAD_RETURN	= 0xCB;
211const KEY KEY_PAD_ADD		= 0xCC; // not used
212const KEY KEY_PAD_SUBTRACT	= 0xCD; // not used
213const KEY KEY_PAD_MULTIPLY  = 0xCE; // not used
214const KEY KEY_PAD_DIVIDE	= 0xCF; // not used
215
216const KEY KEY_BUTTON0	= 0xD0;
217const KEY KEY_BUTTON1	= 0xD1;
218const KEY KEY_BUTTON2	= 0xD2;
219const KEY KEY_BUTTON3	= 0xD3;
220const KEY KEY_BUTTON4	= 0xD4;
221const KEY KEY_BUTTON5	= 0xD5;
222const KEY KEY_BUTTON6	= 0xD6;
223const KEY KEY_BUTTON7	= 0xD7;
224const KEY KEY_BUTTON8	= 0xD8;
225const KEY KEY_BUTTON9	= 0xD9;
226const KEY KEY_BUTTON10	= 0xDA;
227const KEY KEY_BUTTON11	= 0xDB;
228const KEY KEY_BUTTON12	= 0xDC;
229const KEY KEY_BUTTON13	= 0xDD;
230const KEY KEY_BUTTON14	= 0xDE;
231const KEY KEY_BUTTON15	= 0xDF;
232
233const KEY KEY_NONE =	0xFF; // not sent from keyboard.  For internal use only.
234
235const S32 KEY_COUNT = 256;
236
237
238const F32 DEFAULT_WATER_HEIGHT 	= 20.0f;
239
240// Maturity ratings for simulators
241const U8 SIM_ACCESS_MIN 	= 0;		// Treated as 'unknown', usually ends up being SIM_ACCESS_PG
242const U8 SIM_ACCESS_PG		= 13;
243const U8 SIM_ACCESS_MATURE	= 21;
244const U8 SIM_ACCESS_ADULT	= 42;		// Seriously Adult Only
245const U8 SIM_ACCESS_DOWN	= 254;
246const U8 SIM_ACCESS_MAX 	= SIM_ACCESS_ADULT;
247
248// attachment constants
249const S32 MAX_AGENT_ATTACHMENTS = 38;
250const U8  ATTACHMENT_ADD = 0x80;
251
252// god levels
253const U8 GOD_MAINTENANCE = 250;
254const U8 GOD_FULL = 200;
255const U8 GOD_LIAISON = 150;
256const U8 GOD_CUSTOMER_SERVICE = 100;
257const U8 GOD_LIKE = 1;
258const U8 GOD_NOT = 0;
259
260// "agent id" for things that should be done to ALL agents
261LL_COMMON_API extern const LLUUID LL_UUID_ALL_AGENTS;
262
263// inventory library owner
264LL_COMMON_API extern const LLUUID ALEXANDRIA_LINDEN_ID;
265
266LL_COMMON_API extern const LLUUID GOVERNOR_LINDEN_ID;
267LL_COMMON_API extern const LLUUID REALESTATE_LINDEN_ID;
268// Maintenance's group id.
269LL_COMMON_API extern const LLUUID MAINTENANCE_GROUP_ID;
270
271// Flags for kick message
272const U32 KICK_FLAGS_DEFAULT	= 0x0;
273const U32 KICK_FLAGS_FREEZE		= 1 << 0;
274const U32 KICK_FLAGS_UNFREEZE	= 1 << 1;
275
276const U8 UPD_NONE      		= 0x00;
277const U8 UPD_POSITION  		= 0x01;
278const U8 UPD_ROTATION  		= 0x02;
279const U8 UPD_SCALE     		= 0x04;
280const U8 UPD_LINKED_SETS 	= 0x08;
281const U8 UPD_UNIFORM 		= 0x10;	// used with UPD_SCALE
282
283// Agent Update Flags (U8)
284const U8 AU_FLAGS_NONE      		= 0x00;
285const U8 AU_FLAGS_HIDETITLE      	= 0x01;
286const U8 AU_FLAGS_CLIENT_AUTOPILOT	= 0x02;
287
288// start location constants
289const U32 START_LOCATION_ID_LAST 		= 0;
290const U32 START_LOCATION_ID_HOME 		= 1;
291const U32 START_LOCATION_ID_DIRECT	 	= 2;	// for direct teleport
292const U32 START_LOCATION_ID_PARCEL	 	= 3;	// for teleports to a parcel
293const U32 START_LOCATION_ID_TELEHUB 	= 4;	// for teleports to a spawnpoint
294const U32 START_LOCATION_ID_URL			= 5;
295const U32 START_LOCATION_ID_COUNT 		= 6;
296
297// group constants
298const U32 GROUP_MIN_SIZE = 2;
299
300// gMaxAgentGroups is now sent by login.cgi, which
301// looks it up from globals.xml.
302//
303// For now we need an old default value however,
304// so the viewer can be deployed ahead of login.cgi.
305//
306const S32 DEFAULT_MAX_AGENT_GROUPS = 25;
307
308// radius within which a chat message is fully audible
309const F32 CHAT_WHISPER_RADIUS = 10.f;
310const F32 CHAT_NORMAL_RADIUS = 20.f;
311const F32 CHAT_SHOUT_RADIUS = 100.f;
312const F32 CHAT_MAX_RADIUS = CHAT_SHOUT_RADIUS;
313const F32 CHAT_MAX_RADIUS_BY_TWO = CHAT_MAX_RADIUS / 2.f;
314
315// squared editions of the above for distance checks
316const F32 CHAT_WHISPER_RADIUS_SQUARED = CHAT_WHISPER_RADIUS * CHAT_WHISPER_RADIUS;
317const F32 CHAT_NORMAL_RADIUS_SQUARED = CHAT_NORMAL_RADIUS * CHAT_NORMAL_RADIUS;
318const F32 CHAT_SHOUT_RADIUS_SQUARED = CHAT_SHOUT_RADIUS * CHAT_SHOUT_RADIUS;
319const F32 CHAT_MAX_RADIUS_SQUARED = CHAT_SHOUT_RADIUS_SQUARED;
320const F32 CHAT_MAX_RADIUS_BY_TWO_SQUARED = CHAT_MAX_RADIUS_BY_TWO * CHAT_MAX_RADIUS_BY_TWO;
321
322
323// this times above gives barely audible radius
324const F32 CHAT_BARELY_AUDIBLE_FACTOR = 2.0f;
325
326// distance in front of speaking agent the sphere is centered
327const F32 CHAT_WHISPER_OFFSET = 5.f;
328const F32 CHAT_NORMAL_OFFSET = 10.f;
329const F32 CHAT_SHOUT_OFFSET = 50.f;
330
331// first clean starts at 3 AM
332const S32 SANDBOX_FIRST_CLEAN_HOUR = 3;
333// clean every <n> hours
334const S32 SANDBOX_CLEAN_FREQ = 12;
335
336const F32 WIND_SCALE_HACK		= 2.0f;	// hack to make wind speeds more realistic
337
338enum ETerrainBrushType
339{
340	// the valid brush numbers cannot be reordered, because they 
341	// are used in the binary LSL format as arguments to llModifyLand()
342	E_LANDBRUSH_LEVEL	= 0,
343	E_LANDBRUSH_RAISE	= 1,
344	E_LANDBRUSH_LOWER	= 2,
345	E_LANDBRUSH_SMOOTH 	= 3,
346	E_LANDBRUSH_NOISE	= 4,
347	E_LANDBRUSH_REVERT 	= 5,
348	E_LANDBRUSH_INVALID = 6
349};
350
351// media commands
352const U32 PARCEL_MEDIA_COMMAND_STOP  = 0;
353const U32 PARCEL_MEDIA_COMMAND_PAUSE = 1;
354const U32 PARCEL_MEDIA_COMMAND_PLAY  = 2;
355const U32 PARCEL_MEDIA_COMMAND_LOOP  = 3;
356const U32 PARCEL_MEDIA_COMMAND_TEXTURE = 4;
357const U32 PARCEL_MEDIA_COMMAND_URL = 5;
358const U32 PARCEL_MEDIA_COMMAND_TIME = 6;
359const U32 PARCEL_MEDIA_COMMAND_AGENT = 7;
360const U32 PARCEL_MEDIA_COMMAND_UNLOAD = 8;
361const U32 PARCEL_MEDIA_COMMAND_AUTO_ALIGN = 9;
362const U32 PARCEL_MEDIA_COMMAND_TYPE = 10;
363const U32 PARCEL_MEDIA_COMMAND_SIZE = 11;
364const U32 PARCEL_MEDIA_COMMAND_DESC = 12;
365const U32 PARCEL_MEDIA_COMMAND_LOOP_SET = 13;
366
367// map item types
368const U32 MAP_ITEM_TELEHUB = 0x01;
369const U32 MAP_ITEM_PG_EVENT = 0x02;
370const U32 MAP_ITEM_MATURE_EVENT = 0x03;
371//const U32 MAP_ITEM_POPULAR = 0x04;		// No longer supported, 2009-03-02 KLW
372//const U32 MAP_ITEM_AGENT_COUNT = 0x05;
373const U32 MAP_ITEM_AGENT_LOCATIONS = 0x06;
374const U32 MAP_ITEM_LAND_FOR_SALE = 0x07;
375const U32 MAP_ITEM_CLASSIFIED = 0x08;
376const U32 MAP_ITEM_ADULT_EVENT = 0x09;
377const U32 MAP_ITEM_LAND_FOR_SALE_ADULT = 0x0a;
378
379// Region map layer numbers
380const S32 MAP_SIM_OBJECTS = 0;	
381const S32 MAP_SIM_TERRAIN = 1;
382const S32 MAP_SIM_LAND_FOR_SALE = 2;			// Transparent alpha overlay of land for sale
383const S32 MAP_SIM_IMAGE_TYPES = 3;				// Number of map layers
384const S32 MAP_SIM_INFO_MASK  		= 0x00FFFFFF;		// Agent access may be stuffed into upper byte
385const S32 MAP_SIM_LAYER_MASK 		= 0x0000FFFF;		// Layer info is in lower 16 bits
386const S32 MAP_SIM_RETURN_NULL_SIMS 	= 0x00010000;
387const S32 MAP_SIM_PRELUDE 			= 0x00020000;
388
389// Crash reporter behavior
390const S32 CRASH_BEHAVIOR_ASK = 0;
391const S32 CRASH_BEHAVIOR_ALWAYS_SEND = 1;
392const S32 CRASH_BEHAVIOR_NEVER_SEND = 2;
393
394// Export/Import return values
395const S32 EXPORT_SUCCESS = 0;
396const S32 EXPORT_ERROR_PERMISSIONS = -1;
397const S32 EXPORT_ERROR_UNKNOWN = -2;
398
399// This is how long the sim will try to teleport you before giving up.
400const F32 TELEPORT_EXPIRY = 15.0f;
401// Additional time (in seconds) to wait per attachment
402const F32 TELEPORT_EXPIRY_PER_ATTACHMENT = 3.f;
403
404// The maximum size of an object extra parameters binary (packed) block
405#define MAX_OBJECT_PARAMS_SIZE 1024
406
407const S32 CHAT_CHANNEL_DEBUG = S32_MAX;
408
409// PLEASE don't add constants here.  Every dev will have to do
410// a complete rebuild.  Try to find another shared header file,
411// like llregionflags.h, lllslconstants.h, llagentconstants.h,
412// or create a new one.  JC
413
414#endif