![]() |
DI-Guy SDK Documentation
13.6
|
Represents a scriptable api wrapping the DIS/HLA network connection. More...
#include <diguyExerciseInterface.h>
Public Member Functions | |
Exercise Control Functions | |
Unless otherwise noted all functions in this class are callable from:
| |
| void | send_xc_set_tin_tod (unsigned short site, unsigned short host, float ttod) |
| This function sends an xc_set_tin_tod PDU. More... | |
| void | send_xc_load_scenario (unsigned short site, unsigned short host, const char *filename, const char *refname) |
| This function sends an xc_load_scenario PDU. More... | |
| void | send_xc_save_scenario (unsigned short site, unsigned short host, const char *filename, const int use_user_name) |
| This function sends an xc_save_scenario PDU. More... | |
| void | send_xc_reset_scenario (unsigned short site, unsigned short host) |
| This function sends an xc_reset_scenario PDU. More... | |
| void | send_xc_merge_scenario (unsigned short site, unsigned short host, float ttod, float refx, float refy, float refz, float tx, float ty, float tz, float rz, float rx, float ry, const char *filename, const char *suffix) |
| This function sends an xc_merge_scenario PDU. More... | |
| void | send_xc_trigger_script (unsigned short site, unsigned short host, const char *script_name) |
| This function sends an xc_trigger_script PDU. More... | |
| void | send_xc_control (unsigned short site, unsigned short host, const char *command) |
| This function sends an xc_control PDU. More... | |
| void | send_xc_time_now (float tod, float smooth_period) |
| This function sends an xc_time_now PDU. More... | |
| void | send_xc_eval_script (unsigned short site, unsigned short host, const char *text) |
| This function sends an xc_eval_script PDU. More... | |
| void | send_xc_enter_slave_mode (unsigned short site, unsigned short host) |
| This function sends an xc_enter_slave PDU. More... | |
| void | send_xc_exit_slave_mode (unsigned short site, unsigned short host) |
| This function sends an xc_exit_slave PDU. More... | |
AI Messaging Functions | |
| int | send_message_to_character (diguyCharacter *character, diguyCharacter *sender, const char *message_type, const char *message, const char *message_params=NULL) |
| This function sends a custom AI message PDU. More... | |
| int | send_message_to_group (const char *group_name, diguyCharacter *sender, const char *message_type, const char *message, const char *message_params=NULL) |
| This function sends a custom AI message PDU. More... | |
| int | broadcast_message (diguyCharacter *sender, float radius, const char *message_type, const char *message, const char *message_params=NULL) |
| This function sends a custom AI message PDU. More... | |
| int | broadcast_message_to_group (diguyCharacter *sender, const char *group_name, float radius, const char *message_type, const char *message, const char *message_params=NULL) |
| This function sends a custom AI message PDU. More... | |
| const char * | get_net_id (diguyCharacter *character) |
| Returns: "sitenum_hostnum_idnum" as a string. More... | |
| const char * | get_federate_type () |
| Returns: HLA federate type string, or "NA" if using DIS. More... | |
Experimental Conversion Functions | |
| int | convert_mgrs_to_local (const char *MGRS_str, float *x, float *y, float *z) |
| Given an a string containing MGRS coordinates, return a set of local coordinates. The latitude and longitude of the scenario (or elements within it) must have been set in either the exercise interface or encoded in the geometry of the scenario. More... | |
| const char * | convert_local_to_mgrs (float x, float y, float z) |
| Does the reverse of convert_mgrs_to_local() More... | |
| float | convert_local_to_lat (float x, float y, float z) |
| double | convert_local_to_lat_double (double x, double y, double z) |
| float | convert_local_to_long (float x, float y, float z) |
| double | convert_local_to_long_double (double x, double y, double z) |
| const char * | convert_local_to_lat_long_string (float x, float y, float z) |
| int | convert_lat_long_to_local (float lat, float lon, float *x, float *y, float *z) |
| int | convert_lat_long_to_local_double (double lat, double lon, float *x, float *y, float *z) |
Private Functions | |
The functions and variables past this point are for internal use only. No external access to them is expected or necessary. | |
| class | bdiExerciseInterface |
| bdiExerciseInterface * | m_bdiExerciseInterface |
| A pointer to internal data. More... | |
| bdiExerciseInterface * | get_scripted_object () |
| diguyExerciseInterface (bdiExerciseInterface *ei) | |
| A private constructor. More... | |
Represents a scriptable api wrapping the DIS/HLA network connection.
/*
|
private |
A private constructor.
| void diguyExerciseInterface::send_xc_set_tin_tod | ( | unsigned short | site, |
| unsigned short | host, | ||
| float | ttod | ||
| ) |
This function sends an xc_set_tin_tod PDU.
This PDU tells a remote DI-Guy application the simulated time of day at which its scenario is supposed to begin. Doing this provides a conceptual link between scenario time, which nominally starts at zero, and wall-clock time. This makes it possible for a scenario to be run under different simulated lighting conditions.
The remote DI-Guy application essentially does a diguyScenario::set_tin_time_of_day() call.
| site | destination host id (65535 for all sites) |
| host | destination host id (65535 for all hosts) |
| ttod | tin time of day (seconds after midnight) |
| void diguyExerciseInterface::send_xc_load_scenario | ( | unsigned short | site, |
| unsigned short | host, | ||
| const char * | filename, | ||
| const char * | refname | ||
| ) |
This function sends an xc_load_scenario PDU.
This PDU tells a remote DI-Guy application to load a particular scenario file.
The remote DI-Guy application essentially does a diguyScenario::load() call.
| site | destination host id (65535 for all sites) |
| host | destination host id (65535 for all hosts) |
| filename | scenario to load |
| refname | scenario reference name |
| void diguyExerciseInterface::send_xc_save_scenario | ( | unsigned short | site, |
| unsigned short | host, | ||
| const char * | filename, | ||
| const int | use_user_name | ||
| ) |
This function sends an xc_save_scenario PDU.
This PDU tells a remote DI-Guy application to save a particular scenario file.
The remote DI-Guy application essentially does a diguyScenario::save_as() call.
| site | destination host id (65535 for all sites) |
| host | destination host id (65535 for all hosts) |
| filename | scenario to load |
| use_user_name | user name to uniquely identify the file |
| void diguyExerciseInterface::send_xc_reset_scenario | ( | unsigned short | site, |
| unsigned short | host | ||
| ) |
This function sends an xc_reset_scenario PDU.
This PDU tells a remote DI-Guy application to reset the current scenario file.
The remote DI-Guy application essentially does a diguyScenario::reset() call.
| site | destination host id (65535 for all sites) |
| host | destination host id (65535 for all hosts) |
| void diguyExerciseInterface::send_xc_merge_scenario | ( | unsigned short | site, |
| unsigned short | host, | ||
| float | ttod, | ||
| float | refx, | ||
| float | refy, | ||
| float | refz, | ||
| float | tx, | ||
| float | ty, | ||
| float | tz, | ||
| float | rz, | ||
| float | rx, | ||
| float | ry, | ||
| const char * | filename, | ||
| const char * | suffix | ||
| ) |
This function sends an xc_merge_scenario PDU.
This PDU tells a remote DI-Guy application to merge a particular scenario file.
The remote DI-Guy application essentially does a diguyScenario::merge() call.
| site | destination host id (65535 for all sites) |
| host | destination host id (65535 for all hosts) |
| ttod | tin time of day for the merged scenario (seconds after midnight) |
| refx,refy,refz | transformation reference point in merged scenario (point around which translation and rotation will occur) |
| tx,ty,tz | translation of reference point in merged scenario |
| rz,rx,ry | rotation of reference point in merged scenario |
| filename | filename of scenario to merge |
| collision_suffix | suffix to be used in event of name conflicts |
| void diguyExerciseInterface::send_xc_trigger_script | ( | unsigned short | site, |
| unsigned short | host, | ||
| const char * | script_name | ||
| ) |
This function sends an xc_trigger_script PDU.
This PDU tells a remote DI-Guy application to trigger the named script.
The remote DI-Guy application essentially does a diguyScenario::trigger_script() call.
| site | destination host id (65535 for all sites) |
| host | destination host id (65535 for all hosts) |
| script_name | name of the script to be triggered |
| void diguyExerciseInterface::send_xc_control | ( | unsigned short | site, |
| unsigned short | host, | ||
| const char * | command | ||
| ) |
This function sends an xc_control PDU.
This PDU tells a remote DI-Guy application to PLAY, STOP, RESET, etc.
| site | destination host id (65535 for all sites) |
| host | destination host id (65535 for all hosts) |
| command | command string. Valid values are "RESET", "RUN", "STOP", "FF", "REWIND" |
| void diguyExerciseInterface::send_xc_time_now | ( | float | tod, |
| float | smooth_period | ||
| ) |
This function sends an xc_time_now PDU.
This PDU tells all remote DI-Guy applications what the simulated time of day is right now. There is no way to target this message at particular DI-Guy hosts. It is received and processed by all DI-Guy applications in the DIS exercise.
| tod | time of day: number of seconds since midnight, where 0.0 <= tod < 86400.0 |
| smooth_period | how many real seconds should be taken to get into sync |
Scenarios can proceed from one day to the next, up to a length of 24 hours. When midnight comes, tod should be specified AS ZERO, and should increase from there. Values less than zero or greater than or equal to 86400.0 will NOT be sent over the network. In the case nothing will be sent.
| void diguyExerciseInterface::send_xc_eval_script | ( | unsigned short | site, |
| unsigned short | host, | ||
| const char * | text | ||
| ) |
This function sends an xc_eval_script PDU.
This PDU tells a remote DI-Guy application to evaluate a literal piece of script text.
| site | destination host id (65535 for all sites) |
| host | destination host id (65535 for all hosts) |
| text | text of the script to be executed |
| void diguyExerciseInterface::send_xc_enter_slave_mode | ( | unsigned short | site, |
| unsigned short | host | ||
| ) |
This function sends an xc_enter_slave PDU.
This PDU tells a remote DI-Guy application to start slaving it's camera to incoming camera/time packets.
| site | destination host id (65535 for all sites) |
| host | destination host id (65535 for all hosts) |
| void diguyExerciseInterface::send_xc_exit_slave_mode | ( | unsigned short | site, |
| unsigned short | host | ||
| ) |
This function sends an xc_exit_slave PDU.
This PDU tells a remote DI-Guy application to stop slaving it's camera to incoming camera/time packets.
| site | destination host id (65535 for all sites) |
| host | destination host id (65535 for all hosts) |
| int diguyExerciseInterface::send_message_to_character | ( | diguyCharacter * | character, |
| diguyCharacter * | sender, | ||
| const char * | message_type, | ||
| const char * | message, | ||
| const char * | message_params = NULL |
||
| ) |
This function sends a custom AI message PDU.
This PDU is mapped into a diguyCharacter::agent_accept_message() function call on the receiving side.
| character | pointer to the remote diguyCharacter |
| sender | pointer to local diguyCharacter |
| message_type | type of message is being sent |
| message | message string |
| message_params | optional parameter string |
Use diguyExerciseInterface::get_net_id() to get the name of the character that the remote machine will see the sender as.
| int diguyExerciseInterface::send_message_to_group | ( | const char * | group_name, |
| diguyCharacter * | sender, | ||
| const char * | message_type, | ||
| const char * | message, | ||
| const char * | message_params = NULL |
||
| ) |
This function sends a custom AI message PDU.
This PDU is mapped into a diguyCharacterGroup::send_message_to_all_members() on all clients.
| group_name | name of the diguyCharacterGroup to target |
| sender | pointer to local diguyCharacter |
| message_type | what type of message is being sent |
| message | the message string |
| message_params | optional parameter string |
Use diguyExerciseInterface::get_net_id() to get the name of the character that the remote machine will see the sender as.
| int diguyExerciseInterface::broadcast_message | ( | diguyCharacter * | sender, |
| float | radius, | ||
| const char * | message_type, | ||
| const char * | message, | ||
| const char * | message_params = NULL |
||
| ) |
This function sends a custom AI message PDU.
This PDU is mapped into a diguyCharacter::agent_broadcast_message() on all clients.
| sender | pointer to the diguyCharacter that is broadcasting the message |
| radius | how far to broadcast the message |
| message_type | what type of message is being sent |
| message | the message string |
| message_params | optional parameter string |
| int diguyExerciseInterface::broadcast_message_to_group | ( | diguyCharacter * | sender, |
| const char * | group_name, | ||
| float | radius, | ||
| const char * | message_type, | ||
| const char * | message, | ||
| const char * | message_params = NULL |
||
| ) |
This function sends a custom AI message PDU.
This PDU is mapped into a diguyCharacter::agent_broadcast_message_to_group() on all clients.
| sender | pointer to the diguyCharacter that is broadcasting the message |
| group_name | the group that receive the message |
| radius | how far to broadcast the message |
| message_type | what type of message is being sent |
| message | the message string |
| message_params | optional parameter string |
| const char* diguyExerciseInterface::get_net_id | ( | diguyCharacter * | character | ) |
Returns: "sitenum_hostnum_idnum" as a string.
Useful for knowing the name that this entity will have on remote machines. This string should be copied.
| const char* diguyExerciseInterface::get_federate_type | ( | ) |
Returns: HLA federate type string, or "NA" if using DIS.
| int diguyExerciseInterface::convert_mgrs_to_local | ( | const char * | MGRS_str, |
| float * | x, | ||
| float * | y, | ||
| float * | z | ||
| ) |
Given an a string containing MGRS coordinates, return a set of local coordinates. The latitude and longitude of the scenario (or elements within it) must have been set in either the exercise interface or encoded in the geometry of the scenario.
| const char* diguyExerciseInterface::convert_local_to_mgrs | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
Does the reverse of convert_mgrs_to_local()
| float diguyExerciseInterface::convert_local_to_lat | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
| double diguyExerciseInterface::convert_local_to_lat_double | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
| float diguyExerciseInterface::convert_local_to_long | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
| double diguyExerciseInterface::convert_local_to_long_double | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
| const char* diguyExerciseInterface::convert_local_to_lat_long_string | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
| int diguyExerciseInterface::convert_lat_long_to_local | ( | float | lat, |
| float | lon, | ||
| float * | x, | ||
| float * | y, | ||
| float * | z | ||
| ) |
| int diguyExerciseInterface::convert_lat_long_to_local_double | ( | double | lat, |
| double | lon, | ||
| float * | x, | ||
| float * | y, | ||
| float * | z | ||
| ) |
|
inline |
|
friend |
|
private |
A pointer to internal data.