1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
// JD Rocket.cpp : Defines the exported functions for the DLL application.
//
#define ORBITER_MODULE
#include "orbitersdk.h"
#include "OrbiterAPI.h"
#include "orbitersdk.h"
HINSTANCE g_hDLL;
DLLCLBK void InitModule (HINSTANCE hModule)
{
g_hDLL = hModule;
// perform global module initialisation here
}
class AtlasA: public VESSEL2 {
public:
AtlasA (OBJHANDLE hVessel, int flightmodel)
: VESSEL2 (hVessel, flightmodel) {}
void clbkSetClassCaps (FILEHANDLE cfg);
};
class MyVessel: public VESSEL2 {
public:
MyVessel (OBJHANDLE hObj, int fmodel): VESSEL2 (hObj, fmodel) {}
~MyVessel () {}
void clbkLoadStateEx (FILEHANDLE scn, void *status);
void clbkSaveState (FILEHANDLE scn);
private:
double myparam;
};
void MyVessel::clbkLoadStateEx (FILEHANDLE scn, void *status)
{
char *line;
while (oapiReadScenario_nextline (scn, line)) {
if (!_strnicmp (line, "MYPARAM", 7)) {
sscanf (line+7, "%lf", &myparam);
} else {
ParseScenarioLineEx (line, status);
}
}
}
void MyVessel::clbkSaveState (FILEHANDLE scn)
{
VESSEL2::clbkSaveState (scn);
oapiWriteScenario_float (scn, "MYPARAM", myparam);
}
void AtlasA::clbkSetClassCaps (FILEHANDLE cfg)
{
THRUSTER_HANDLE th_main, th_hover, th_rcs[14], th_group[4];
}
//
{
SetSize (22.9);
SetEmptyMass (150000.0);
SetCW (0.3, 0.3, 0.6, 0.9);
SetWingAspect (0.7);
SetWingEffectiveness (2.5);
SetCrossSections (_V(51.34,58.45,6.73));
SetRotDrag (_V(0.6,0.6,0.35));
if (GetFlightModel() >= 1) {
SetPitchMomentScale (1e-4);
}
SetPMI (_V(78.8,79.81,2.08));
SetTrimScale (0.05);
SetCameraOffset (_V(0,0.8,0));
SetTouchdownPoints (_V(0,-1.5,2), _V(-1,-1.5,-1.5), _V(1,-1.5,-1.5));
PARTICLESTREAMSPEC contrail_main = {
0, 5.0, 16, 200, 0.15, 1.0, 5, 3.0, PARTICLESTREAMSPEC::DIFFUSE,
PARTICLESTREAMSPEC::LVL_PSQRT, 0, 2,
PARTICLESTREAMSPEC::ATM_PLOG, 1e-4, 1
};
PARTICLESTREAMSPEC contrail_hover = {
0, 5.0, 8, 200, 0.15, 1.0, 5, 3.0, PARTICLESTREAMSPEC::DIFFUSE,
PARTICLESTREAMSPEC::LVL_PSQRT, 0, 2,
PARTICLESTREAMSPEC::ATM_PLOG, 1e-4, 1
};
PARTICLESTREAMSPEC exhaust_main = {
0, 2.0, 20, 200, 0.05, 0.1, 8, 1.0, PARTICLESTREAMSPEC::EMISSIVE,
PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
PARTICLESTREAMSPEC::ATM_PLOG, 1e-5, 0.1
};
PARTICLESTREAMSPEC exhaust_hover = {
0, 2.0, 10, 200, 0.05, 0.05, 8, 1.0, PARTICLESTREAMSPEC::EMISSIVE,
PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
PARTICLESTREAMSPEC::ATM_PLOG, 1e-5, 0.1
};
AddMesh (oapiLoadMeshGlobal "AtlasA"));
{
DLLCLBK VESSEL *ovcInit (OBJHANDLE hvessel, int flightmodel);
{
return new AtlasA (hvessel, flightmodel);
}
// --------------------------------------------------------------
// Vessel cleanup
// --------------------------------------------------------------
DLLCLBK void ovcExit (VESSEL *vessel)
if (vessel) delete (AtlasA*)vessel;
}
|