📄 hostdata.h
字号:
/******************************************************************************* hostdata.h -- ** Data interface when network communications are desired*******************************************************************************/#ifndef HOSTDATA_H#define HOSTDATA_H#include <gv_cam.h>#include <gv_chn.h>#include <gv_obj.h>#include <dnet.h>#include <tparse.h>#include "skt.h"#include "train.h"#define HOSTDATA_NAME_BUFLEN 1024#define APP_EVENT_SPOTLIGHT_STATE (TCEVENT_OPCODE_USER_EVENT_START+0)#define APP_EVENT_SPOTLIGHT_CONE_STATE (TCEVENT_OPCODE_USER_EVENT_START+1)#define APP_EVENT_SPOTLIGHT_FALLOFF (TCEVENT_OPCODE_USER_EVENT_START+2)#define APP_EVENT_SPOTLIGHT_ATTENUATION (TCEVENT_OPCODE_USER_EVENT_START+3)#define APP_EVENT_SEASON_CHANGE (TCEVENT_OPCODE_USER_EVENT_START+4)#ifdef __cplusplusextern "C" {#endif#define BASE 0 /* Base platform *//* Data sent every frame from master process to slave processes. Be sure to maintain alignment of doubles at 8-byte boundaries. */struct dnet_host_data_s { Dnet_gen_data dhd_dgd ; /* Common to all dnet code */ /* --------- Continous data from host (sent every frame) -------------- */ int fixed_size; /* offset of vnamebuf for consistency */ /* checking between master / slave */ int frame; /* Current host (master) frame # */ G_State ownstate; /* Ownship graphics state */ int reserved_00; /* Keep byte alignment for doubles */ double simtime; /* Current simulation time */ double dt; /* Current integration delta time */ G_Position_d ownpos; /* Ownship vehicle position */ G_Rotation_d ownrot; /* Ownship vehicle rotation angles */ G_Position_d campos; /* World position of camera */ G_Rotation_d camrot; /* World rotation of camera */ G_Position_d vpos[NUM_VEHICLES]; /* Vehicle position */ G_Rotation_d vrot[NUM_VEHICLES]; /* Vehicle rotation angles */ G_State vstate[NUM_VEHICLES]; /* Vehicle state (G_ON, G_OFF) */ G_Vector3 sun_direction; /* Sun direction vector */ /* --------- Discrete data from host (only when something changes) ---- */ int discrete_count; /* Each time something below is changed, incremented so each process can update accordingly */ Tevent event; /* Send the event data */ G_Name vname[NUM_VEHICLES]; /* Instance names */} ;/* Globals */extern Dnet_host_data host_data;extern int host_data_length;extern GV_Obi vobi[NUM_VEHICLES]; /* Object instances for vehicles *//* Function prototypes: */void event_discrete_change( void ); /* Application specific stuff */int host_slave_get( GV_Obi ownship, GV_Camera ownship_camera ); int host_master_put( GV_Obi ownship, GV_Camera ownship_camera );int host_master_init( GV_Obi ownship, GV_Camera ownship_camera );int host_discrete( void );#ifdef __cplusplus}#endif#endif /* HOSTDATA_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -