资源描述:
《vega视景仿真课本实例》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#include#include#include#include#include#include#include#include#include#include//#include"math.h"//#include#defineORIGINX2500.0f#defineORIGINY2500.0f#defineZSTART500.0
2、f#defineRADIUS1000.0f#defineH_RATE0.25f#defineZ_RATE3.5f#defineMISSILE1_PATH"./missile1.path"//保存路径文件名#defineMISSILE1_NAV"./missile1.nav"//保存导航文件名#defineMISSILE2_PATH"./missile2.path"#defineMISSILE2_NAV"./missile2.nav"#defineHELITOE2C_PATH"./helitoe2c.path"#defineHEL
3、ITOE2C_NAV"./helitoe2c.nav"staticvoidDrawInfoCallBack(vgCommon*chan,void*udata);staticvoidstateHandler(void);staticvoidcomputeVVec(float*vv,vgPosition*pos);staticintrandomNum(intnumber);//获取随机整数值staticfloate2c_radius=1000.0f;//预警机巡航半径staticintstate=0;//仿真运行状态staticin
4、tm1launchable=0;//导弹1是否可发射staticintm2launchable=0;//导弹2是否可发射staticinte2cDownable=0;//E2C是否可失事staticintm1used=0;//导弹1是否已发射staticintm2used=0;//导弹2是否已发射staticfloatstartTime=0;//计时起始时间staticfloattimeNow=0;//计时间隔时间staticfloatdeltaFrameTime=0.0167f;//帧渲染间隔时间voidmain(void){
5、staticvgObserver*obs;staticvgChannel*chan;staticvgScene*scene;staticvgObject*m1,*m2;staticvgPlayer*tank,*heli,*missile1,*missile2;staticvgPlayer*e2c,*tank_crater,*e2c_crater;staticvgIsector*fortank,*formissile1,*formissile2;staticvgIsector*fore2c,*forheli,*forcrater;
6、staticvgPosition*pos,*e2c_pos,*heli_pos,*missile_pos,*target_pos;staticvgFx*h_blade1,*h_blade2;staticvgFx*e_blade1,*e_blade2,*e_trail1,*e_trail2;staticvgFx*e_airhit,*e_engsmoke,*e_engburn,*e_flash;staticvgFx*e_fire,*e_smoke,*e_explode,*e_debris;staticvgFx*m1_flame,*m
7、1_trail,*m2_flame,*m2_trail;staticvgFx*t_flash,*t_explode1,*t_debris1,*t_smoke;staticvgFx*t_flame,*t_explode2,*t_debris2,*t_fire;staticvgPath*tank_path,*tankupdown_path,*heli_path;staticvgSplineNavigator*tank_nav,*tankupdown_nav,*heli_nav;staticvgPath*missile1_path,*
8、missile2_path,*helitoe2c_path;staticvgSplineNavigator*missile1_nav,*missile2_nav,*helitoe2c_nav;staticVelocityMarkervm;staticfloatx