API Question Thruster problems

astrosammy

Dash!
Addon Developer
Donator
Joined
Apr 27, 2008
Messages
2,124
Reaction score
0
Points
36
Location
ICAO ID: EDFB
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:

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);
}
 
No surprise why. You have less thrust than the gravity force, and orbiter has the bug that it ignores touchdown points when you have some amount of acceleration.

Thrust force: 3E5 = 30 kN
Gravity: (2e7 kg + 1000 kg ) * 9.81 m/s²= 1971.810 kN
 
What a stupid mistake...
Thank you, it's working now! But there's still the problem with the touchdown points.
 
Back
Top