I just ran into a problem while creating the module for my ship.
When I ignite the main engine, it has no thrust, and the touchdown points seem to be deleted, causing the ship to sink. Here's the code:
When I ignite the main engine, it has no thrust, and the touchdown points seem to be deleted, causing the ship to sink. Here's the code:
Code:
#define STRICT
#define ORBITER_MODULE
#include <orbitersdk.h>
const double SHIP1_FUELMASS = 1000.0;
const double SHIP1_MAXMAINTH = 3e5;
const double SHIP1_ISP = 5e4;
class Ship1: public VESSEL2 {
public:
Ship1 (OBJHANDLE hObj, int fmodel): VESSEL2 (hObj, fmodel) {}
~Ship1 () {}
void clbkSetClassCaps (FILEHANDLE cfg);
};
DLLCLBK VESSEL *ovcInit (OBJHANDLE hvessel, int flightmodel)
{
return new Ship1 (hvessel, flightmodel);
}
DLLCLBK void ovcExit (VESSEL *vessel)
{
if (vessel) delete (Ship1*)vessel;
}
void Ship1::clbkSetClassCaps (FILEHANDLE cfg)
{
AddMesh (oapiLoadMeshGlobal ("Ship1"));
SetEmptyMass (2e7);
SetSize (54.0);
SetTouchdownPoints (_V(0,7.2,25),_V(-6,7.2,-25), _V(6,7.2,-25));
THRUSTER_HANDLE th_main;
PROPELLANT_HANDLE hpr = CreatePropellantResource (SHIP1_FUELMASS);
th_main = CreateThruster (_V(0,7.2,-25), _V(0,0,1), SHIP1_MAXMAINTH, hpr, SHIP1_ISP);
CreateThrusterGroup (&th_main, 1, THGROUP_MAIN);
}