DI-Guy C++ SDK Reference  13.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguy_dis_constants.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2014 VT MAK
4  ** All rights reserved.
5  *********************************************************************/
6 
7 /*********************************************************************
8  **
9  *t DI-Guy API, DIS Constants and Enumerations
10  **
11  ** This file contains constants defined by the DIS
12  ** networking standard. They should be compatible with
13  ** other DIS networking applications that follow the
14  ** DIS standard.
15  */
16 
17 #ifndef __diguy_dis_constants_H
18 #define __diguy_dis_constants_H
19 
20 
21 /****************************************************************************/
22 /*l
23  *b Description:
24  **
25  ** Lifeform state values from an Entity State PDU.
26  **
27  ** Note that the values for sitting, squatting, crouching, and wading
28  ** don't appear to be part of the official DIS standard, but are included
29  ** for compatibility with MaK Technologies, Inc. VR-Link.
30  */
31 enum
32 {
43 
48 };
49 
50 
51 /****************************************************************************/
52 /*l
53  *b Description:
54  **
55  ** Primary weapon position values from an Entity State PDU.
56  */
57 enum
58 {
63 };
64 
65 
66 /****************************************************************************/
67 /*l
68  *b Description:
69  **
70  ** Secondary weapon position values from an Entity State PDU.
71  */
72 enum
73 {
78 };
79 
80 
81 /****************************************************************************/
82 /*l
83  *b Description:
84  **
85  ** Damage appearance values from an Entity State PDU.
86  */
87 enum
88 {
93 };
94 
95 
96 /****************************************************************************/
97 /*l
98  *b Description:
99  **
100  ** Smoke appearance values from an Entity State PDU.
101  */
102 enum
103 {
108 };
110 
111 /****************************************************************************/
112 /*l
113  *b Description:
114  **
115  ** Trailing effect values from an Entity State PDU.
116  */
117 enum
118 {
123 };
124 
125 
126 /****************************************************************************/
127 /*l
128  *b Description:
129  **
130  ** Flames appearance values from an Entity State PDU.
131  */
132 enum
133 {
136 };
137 
138 
139 /****************************************************************************/
140 /*l
141  *b Description:
142  **
143  ** Power plant status values from an Entity State PDU.
144  */
145 enum
146 {
149 };
150 
151 
152 /****************************************************************************/
153 /*l
154  *b Description:
155  **
156  ** This enumeration lists missile trail status values from an Entity
157  ** State PDU.
158  */
159 enum
160 {
163 };
164 
165 
166 /****************************************************************************/
167 /*l
168  *b Description:
169  **
170  ** This enumeration lists the Articulated part info for DI-Guy's gazing.
171  */
172 enum
173 {
174  DIGUY_DIS_FOCUS_TARGET = 10240
175 };
176 
177 
178 /****************************************************************************/
179 /*l
180  ** \enum diguyCustomPDUType
181  **
182  *b Description:
183  **
184  ** This enumeration lists the message IDs for DI-Guy's custom pdus,
185  ** not all are usuable outside of diguyscenario
186  **
187  *i DIGUY_CUSTOM_PDU_ID_SET_CHAR_TYPE
188  **
189  *- - Contents: String
190  *- - Meaning: call diguyCharacter::set_character_type()
191  **
192  *i DIGUY_CUSTOM_PDU_ID_SET_CHAR_APPEARANCE
193  **
194  *- - Contents: String A, String B, String C
195  *- - Meaning: call diguyCharacter::set_appearance() call
196  *- diguyCharacter::set_current_head_appearance() (possibly with "default"),
197  *- optionally call diguyCharacter::set_current_hand_item_appearance()
198  **
199  *i DIGUY_CUSTOM_PDU_ID_SET_CHAR_ACTION
200  **
201  *- - Contents: String A, String B, Float C
202  *- - Meaning: Set the character action to A, the second string is either "p" or ""
203  *- (the empty string). A value of "p" for the second string indicates that the
204  *- action is paused. Characters are typically paused if the sending application
205  *- such as DI-Guy Scenario has been playing and the user hits "pause" on the VCR control.
206  *- float C is optional and represent the speed modifier that force action was called with.
207  **
208  *i DIGUY_CUSTOM_PDU_ID_SET_CHAR_VISIBLE
209  **
210  *- - Contents: Long Boolean
211  **
212  *i DIGUY_CUSTOM_PDU_ID_SET_SCENARIO_FRAME
213  **
214  *- - Contents: Long val
215  *- - Meaning: call diguyScenario::set_frame_desired(val)
216  **
217  *i DIGUY_CUSTOM_PDU_ID_SET_SCENARIO_PLAYBACK_MODE
218  **
219  *- - Contents: Long val
220  *- - Meaning: call diguyScenario::set_playback_mode(val)
221  **
222  *i DIGUY_CUSTOM_PDU_ID_LOAD_SCENARIO_CAMERA
223  **
224  *- - Contents: string
225  *- - Meaning: call diguyScenario::get_scenario_camera()->load_settings(string)
226  **
227  *i DIGUY_CUSTOM_PDU_ID_RESET
228  **
229  *- - Meaning: call diguyScenario::reset()
230  **
231  *i DIGUY_CUSTOM_PDU_ID_HAIL
232  **
233  *i DIGUY_CUSTOM_PDU_ID_LOAD_SCENARIO_FILE
234  **
235  *- - Contents: string
236  *- - Meaning: call diguyScenario::load(string)
237  **
238  *i DIGUY_CUSTOM_PDU_ID_SET_CAMERA_DETAILS
239  **
240  *- Internal Use only
241  **
242  *i DIGUY_CUSTOM_PDU_ID_XC_LOAD_SCENARIO
243  **
244  *- - Contents:
245  ** - NetU16 => Target_site
246  ** - NetU16 => Target_host
247  ** - String => Filename
248  ** - String => Reference name
249  **
250  *i DIGUY_CUSTOM_PDU_ID_XC_LOAD_SCENARIO_COMPLETE
251  **
252  *- - Contents: string
253  *- - Meaning: Indicates scenario has finished loading
254  **
255  *i DIGUY_CUSTOM_PDU_ID_XC_MERGE_SCENARIO
256  **
257  *- - Contents:
258  ** - NetU16 => Target_site
259  ** - NetU16 => Target_host
260  ** - NetFlt32 => Time of Day
261  ** - NetFlt32[3] => Refx, Refy, Refz
262  ** - NetFlt32[3] => x, y, z
263  ** - NetFlt32[3] => w,r,p
264  ** - String => Filename
265  ** - String => Reference name
266  **
267  *i DIGUY_CUSTOM_PDU_ID_XC_MERGE_SCENARIO_COMPLETE
268  **
269  *- - Contents: string
270  *- - Meaning: Indicates scenario has finished loading
271  **
272  *i DIGUY_CUSTOM_PDU_ID_XC_SET_TIN_TOD
273  **
274  *- - Contents:
275  ** - NetU16 => Target_site
276  ** - NetU16 => Target_host
277  ** - NetFlt32 => Time of Day
278  *- - Meaning: call diguyScenario::set_tin_time_of_day()
279  **
280  *i DIGUY_CUSTOM_PDU_ID_XC_TIME_NOW
281  **
282  *- - Contents:
283  ** - NetFlt32 => seconds since midnight
284  ** - NetFlt32 => seconds to smooth
285  *- - Meaning: call diguyScenario::set_sync_info()
286  **
287  *i DIGUY_CUSTOM_PDU_ID_XC_CONTROL
288  **
289  *- - Contents:
290  ** - NetU16 => Target_site
291  ** - NetU16 => Target_host
292  ** - String => Command ("RUN", "STOP", "RESET", "FF", "REWIND")
293  **
294  *i DIGUY_CUSTOM_PDU_ID_XC_TRIGGER_SCRIPT
295  **
296  *- - Contents:
297  ** - NetU16 => Target_site
298  ** - NetU16 => Target_host
299  ** - String Script name
300  **
301  *i DIGUY_CUSTOM_PDU_ID_XC_EVAL_SCRIPT
302  **
303  *- - Contents:
304  ** - NetU16 => Target_site
305  ** - NetU16 => Target_host
306  ** - String => Script text
307  **
308  *i DIGUY_CUSTOM_PDU_ID_XC_SET_FF_SPEED
309  **
310  *- - Contents:
311  ** - NetU16 => Target_site
312  ** - NetU16 => Target_host
313  ** - NetFlt32 => Speed multiple
314  **
315  *i DIGUY_CUSTOM_PDU_ID_XC_TRIGGER_SIGNAL
316  **
317  *- - Contents:
318  ** - NetU16 => Target_site
319  ** - NetU16 => Target_host
320  ** - String => Signal to trigger
321  **
322  *i DIGUY_CUSTOM_PDU_ID_XC_RESET_SCENARIO
323  **
324  *- - Contents:
325  ** - NetU16 => Target_site
326  ** - NetU16 => Target_host
327  **
328  *i DIGUY_CUSTOM_PDU_ID_XC_ENTER_SLAVE_MODE
329  **
330  *- - Contents:
331  ** - NetU16 => Target_site
332  ** - NetU16 => Target_host
333  **
334  *i DIGUY_CUSTOM_PDU_ID_XC_EXIT_SLAVE_MODE
335  **
336  *- - Contents:
337  ** - NetU16 => Target_site
338  ** - NetU16 => Target_host
339  **
340  *i DIGUY_CUSTOM_PDU_ID_VARIABLE_STATE
341  **
342  *- - Contents:
343  ** - NetU16 => Target_site
344  ** - NetU16 => Target_host
345  ** - String => variable
346  ** - String => value
347  **
348  *i DIGUY_CUSTOM_PDU_ID_SAVE_SCENARIO
349  **
350  *- - Contents:
351  ** - NetU16 => Target_site
352  ** - NetU16 => Target_host
353  ** - NetU16 => use_user_name
354  ** - String => file name
355  **
356  *i DIGUY_CUSTOM_PDU_ID_SAVE_SCENARIO_COMPLETE
357  **
358  *- - Contents:
359  ** - String => file name
360  **
361  *i DIGUY_CUSTOM_PDU_ID_AI_SEND_MESSAGE_TO_CHARACTER
362  **
363  *- - Contents:
364  ** - NetU16 => Target_site
365  ** - NetU16 => Target_host
366  ** - NetU16 => target AI network number
367  ** - String => sender
368  ** - String => message_type
369  ** - String => message
370  ** - String => message_params
371  *- - Meaning: call
372  *e diguyCharacter::agent_accept_message(sender,
373  *e message_type,
374  *e message,
375  *e message_params);
376  *- on character with diguyCharacter::get_network_entity_number() == target AI network number
377  **
378  *i DIGUY_CUSTOM_PDU_ID_AI_SEND_MESSAGE_TO_GROUP
379  **
380  *- - Contents:
381  ** - String => group_name
382  ** - String => sender
383  ** - String => message_type
384  ** - String => message
385  ** - String => message_params
386  *- - Meaning: call
387  *e diguyCharacterGroup::send_message_to_all_members(sender,
388  *e message_type,
389  *e message,
390  *e message_params);
391  **
392  *i DIGUY_CUSTOM_PDU_ID_AI_BROADCAST_MESSAGE
393  **
394  *- - Contents:
395  ** - String => sender
396  ** - NetFlt32 => radius
397  ** - String => message_type
398  ** - String => message
399  ** - String => message_params
400  *- - Meaning: call
401  *e diguyCharacter::agent_broadcast_message(sender,
402  *e radius,
403  *e message_type,
404  *e message,
405  *e message_params);
406  ** Where character is the sender of message.
407  **
408  *i DIGUY_CUSTOM_PDU_ID_AI_BROADCAST_MESSAGE_TO_GROUP
409  **
410  *- - Contents:
411  ** - String => sender
412  ** - String => group_name
413  ** - NetFlt32 => radius
414  ** - String => message_type
415  ** - String => message
416  ** - String => message_params
417  *- - Meaning: call
418  *e diguyCharacter::agent_broadcast_message_to_group(group_name,
419  *e radius,
420  *e message_type,
421  *e message,
422  *e message_params);
423  ** Where character is the sender of message.
424  **
425  *i DIGUY_CUSTOM_PDU_ID_BEGIN_APPEARANCE_EFFECT
426  **
427  *- - Contents:
428  ** - String => appearance effect
429  ** - bool => flag if theres extended data
430  *- - Optional extended data:
431  ** - NetFlt32 => override scale
432  ** - NetFlt32[3] => override_offset x, y, z
433  ** - NetFlt32 => override duration
434  *- - Meaning: call
435  *e diguyCharacter::begin_appearance_effect(app_name, link_name, override_scale,
436  *e override_offset_x, override_offset_y, override_offset_z,
437  *e override_duration,
438  ** or
439  *e diguyCharacter::begin_appearance_effect(app_name);
440  **
441  *i DIGUY_CUSTOM_PDU_ID_END_APPEARANCE_EFFECT ( Gradual Stop )
442  **
443  *- - Contents:
444  *- - String => appearance_effect_name
445  ** - String => link_name
446  *- - Meaning: call
447  *e diguyCharacter::end_appearance_effect(appearance_effect_name,link_name)
448  **
449  *i DIGUY_CUSTOM_PDU_ID_STOP_APPEARANCE_EFFECT ( Instant Stop )
450  **
451  *- - Contents:
452  *- - String => appearance_effect_name
453  ** - String => link_name
454  *- - Meaning: call
455  *e diguyCharacter::stop_appearance_effect(appearance_effect_name, link_name)
456  **
457  *i DIGUY_CUSTOM_PDU_ID_SET_SCENE_OBJECT_BIT
458  **
459  *- - Contents:
460  *- - bool => true false
461  *- - Meaning: call
462  *e diguyCharacter::set_is_scene_object(value)
463  **
464  *i DIGUY_CUSTOM_PDU_ID_BROADCAST_EXERCISE_DATETIME
465  **
466  *b internal use only
467  *- - Contents:
468  ** - NetU16 => Target_site
469  ** - NetU16 => Target_host
470  ** - NetU16[7] => year, month, day, hour, minute, second, msec
471  *- - Meaning: call
472  ** bdiScenario::set_network_datetime(network_datetime);
473  **
474  *i DIGUY_CUSTOM_PDU_ID_REQUEST_EXERCISE_DATETIME_BROADCAST
475  **
476  ** Unused
477  **
478  *i DIGUY_CUSTOM_PDU_ID_SET_SHAPE_VARIATION_2
479  **
480  *- - Contents:
481  *- - complicated: a series of NetU16 ( link index ), NetU16 (shape index )
482  *- followed by a slightly compressed chunk of pixel data.
483  *- should probably only happen once per character, DI-Guy 13 adds a force
484  *- update and a version number to this PDU.
485  *-
486  *e int offset = 0;
487  *e short version = 0;
488  *e pdu->pullShort(version, offset);
489  *e
490  *e if(version != DIGUY_CUSTOM_PDU_ID_SET_SHAPE_VARIATION_VERSION){
491  *e return;
492  *e }
493  *e bool force = 0;
494  *e pdu->pullBool(force, offset);
495  *e if(character->get_has_texture_variations() && !force ){
496  *e return;
497  *e }
498  *e character->set_shape_texture_variations_no_effect(1);
499  *e
500  *e short link_index = 0;
501  *e while(pdu->pullShort(link_index, offset) == 0)
502  *e {
503  *e short shape_index = 0;
504  *e pdu->pullShort(shape_index, offset);
505  *e
506  *e bdiLink * link = character->get_link_at_index(link_index);
507  *e if(link)
508  *e {
509  *e bdiShape * shape = link->get_shape(shape_index);
510  *e if(!shape )
511  *e {
512  *e // we're done here character's don't match
513  *e break;
514  *e }
515  *e const unsigned char * data_blob = NULL;
516  *e int bytes_read;
517  *e if(pdu->pullUnsignedData(data_blob, offset, bytes_read) == 0 )
518  *e {
519  *e // note pull the data first ignore if variation is already set.
520  *e if(!shape->get_has_custom_variation() || force)
521  *e {
522  *e // special value to register that rampdata is loaded off network
523  *e shape->set_variation_index(-2);
524 
525  *e unsigned char * data_blob_copy = shape->get_unique_ramp_data();
526  *e int new_data = 0;
527  *e if(!data_blob_copy){
528  *e new_data = 1;
529  *e data_blob_copy = new unsigned char [ shape->get_unique_ramp_data_size()*4 ];
530  *e }
531  *e // fill out the 0th index with nothing (that
532  *e data_blob_copy[0] = 128;
533  *e data_blob_copy[1] = 128;
534  *e data_blob_copy[2] = 128;
535  *e data_blob_copy[3] = 255;
536  *e
537  *e int q;
538  *e for(q = 0; q < bytes_read/3; q++)
539  *e {
540  *e data_blob_copy[(q+1)*4] = data_blob[q*3];
541  *e data_blob_copy[(q+1)*4+1] = data_blob[q*3+1];
542  *e data_blob_copy[(q+1)*4+2] = data_blob[q*3+2];
543  *e data_blob_copy[(q+1)*4+3] = 255;;
544  *e }
545  *e // fill the rest of the buffer with padding
546  *e for( ; q < shape->get_unique_ramp_data_size()-1; q++)
547  *e {
548  *e data_blob_copy[(q+1)*4] = 128;
549  *e data_blob_copy[(q+1)*4+1] = 128;
550  *e data_blob_copy[(q+1)*4+2] = 128;
551  *e data_blob_copy[(q+1)*4+3] = 255;
552  *e }
553  *e if(new_data){
554  *e shape->set_unique_ramp_data(data_blob_copy);
555  *e }
556  *e else{
557  *e shape->update_variation_texture();
558  *e }
559  *e }
560  *e }
561  *e }
562  *e }
563  *e
564  **
565  *i DIGUY_CUSTOM_PDU_ID_EXECUTE_GESTURE
566  **
567  *- - Contents:
568  ** - String => gesture_name
569  ** - Long => reps
570  ** - NetFlt32 => overall_duration
571  ** - NetFlt32 => channel_A_weight
572  *- - Meaning: call
573  ** diguyCharacter::execute_gesture(gesture_name,reps, overall_duration, channel_A_weight);
574  **
575  *i DIGUY_CUSTOM_PDU_ID_CHARACTER_SCALE
576  **
577  *- - Contents:
578  ** - NetFlt32[3] => scale x,y,z
579  *- - Meaning: call
580  *- diguyCharacter::set_scale(x,y,z);
581  **
582  *i DIGUY_CUSTOM_PDU_ID_PLUGIN_RESERVED0
583  *i DIGUY_CUSTOM_PDU_ID_PLUGIN_RESERVED9
584  */
586 {
642 } ;
643 
645 
646 #endif /* __diguy_dis_constants_H */
647 
648 
649 /*********************************************************************
650  ** Copyright (c) 1992-2014 VT MAK
651  ** All rights reserved.
652  *********************************************************************/
653