Sorry, Only one main thruster. I think it is somehow how the touchdown points are set, though
I think it is somehow how the touchdown points are set, though
Yes. I did that. But doesn't that also tell you where forward is?
On the Spec Not sure how much RCS is and fuel amount?
I will. The top of the mesh is facing +Z
Sounds like it should be... pointy end up.
double MAX_MAIN_THRUST = 232242 * 4;
SetEmptyMass(85270);
SetCW(0.3, 0.3, 0.6, 0.9);
SetWingAspect(0.1);
SetWingEffectiveness(0.1);
SetCrossSections(_V(636.52,633.36,68.53 ));
SetRotDrag(_V(0.1, 0.1, 0.1));
if (GetFlightModel() >= 1) {
SetPitchMomentScale(1e-4);
SetBankMomentScale(1e-4);
}
SetPMI(_V(356.25, 355.96,9.0));
Specific impulse 363 seconds (3.56 km/s) (sea level), 452 seconds (4.43 km/s) (vacuum)
what should isp be?
const double ISP = 3560;
double MAX_MAIN_FUEL = 10000;
double MAX_RCS_THRUST = 110.25;
double MAX_MAIN_THRUST = 232242 * 4;
double MAX_MAIN_FUEL = 114660;
double MAX_RCS_THRUST = 110.25;
double MAX_MAIN_THRUST = 573870 * 4;
You should really implement Thrust Vector Control rather than rely on fake RCS thrusters. Only upper stages use RCS as they're expected provide coast attitude control post-engine cut-off.
I believe Ares 1X uses it: [ame="http://www.orbithangar.com/searchid.php?ID=4290"]Ares I-X Ultra 1.00[/ame]How?
th_main[0]= CreateThruster(_V(-2, -3.5, -37), _V(0, 0, 1), MAX_MAIN_THRUST, ph_main, ISP);
th_main[1] = CreateThruster(_V(-2, 3.5, -37), _V(0, 0, 1), MAX_MAIN_THRUST, ph_main, ISP);
th_main[2] = CreateThruster(_V(2, -3.5, -37), _V(0, 0, 1), MAX_MAIN_THRUST, ph_main, ISP);
th_main[3] = CreateThruster(_V(2, 3.5, -37), _V(0, 0, 1), MAX_MAIN_THRUST, ph_main, ISP);
thg_main = CreateThrusterGroup(th_main, 4, THGROUP_MAIN);
// ==============================================================
// ORBITER MODULE: SLS
// Part of the ORBITER SDK
// Copyright (C) 2002-2004 Martin Schweiger
// All rights reserved
//
// SLS.cpp
// Control module for SLS vessel class
//
// ==============================================================
#define ORBITER_MODULE
#include "orbitersdk.h"
#include "SLS.h"
#include "OrbiterSoundSDK40.h"
VISHANDLE MainExternalMeshVisual = 0;
// 1. vertical lift component (wings and body)
void SLS::clbkPostCreation(void)
{
SLSID = InitializeOrbiterSound();
}
int SLS::InitializeOrbiterSound()
{
int ID = ConnectToOrbiterSoundDLL(GetHandle());
// Set default directory (easier and faster and clearer: win win !)
SetMyDefaultWaveDirectory("Sound\\_CustomVesselsSounds\\SLS");
SoundOptionOnOff(ID, PLAYMAINTHRUST, TRUE);
SoundOptionOnOff(ID, PLAYHOVERTHRUST, TRUE);
SoundOptionOnOff(ID, PLAYATTITUDETHRUST, TRUE);
SoundOptionOnOff(ID, PLAYCOUNTDOWNWHENTAKEOFF, FALSE);
SoundOptionOnOff(ID, PLAYCABINAIRCONDITIONING, FALSE);
SoundOptionOnOff(ID, PLAYCABINRANDOMAMBIANCE, TRUE);
SoundOptionOnOff(ID, PLAYRADIOATC, FALSE);
SoundOptionOnOff(ID, DISPLAYTIMER, FALSE);
return ID;
}
// Constructor
SLS::SLS(OBJHANDLE hObj, int fmodel)
: VESSEL2(hObj, fmodel)
{
DefineAnimations();
}
void SLS::clbkSetClassCaps(FILEHANDLE cfg)
{
int i;
// physical specs
SetSize(45);
SetEmptyMass(85270);
SetCW(0.3, 0.3, 0.6, 0.9);
SetWingAspect(0.1);
SetWingEffectiveness(0.1);
SetCrossSections(_V(636.52,633.36,68.53 ));
SetRotDrag(_V(0.1, 0.1, 0.1));
if (GetFlightModel() >= 1) {
SetPitchMomentScale(1e-4);
SetBankMomentScale(1e-4);
}
SetPMI(_V(356.25, 355.96,9.0));
SetTrimScale(0.05);
SetCameraOffset(_V(0, 41, 0));
SetTouchdownPoints(_V(0,5, -50.5), _V(4.4, -5, -50.5), _V(-4.4,-5, -50.5));;
EnableTransponder(true);
B1 = CreateAttachment(false, _V(-4.2, 0, -10), _V(0, 1, 0), _V(0, 0, 1), "B1", false);
B2 = CreateAttachment(false, _V(4.2, 0, -10), _V(0, 1, 0), _V(0, 0, 1), "B2", false);
F1 = CreateAttachment(false, _V(-4.2, 0,22.3), _V(0, 1, 0), _V(0, 0, 1), "F1", false);
F2 = CreateAttachment(false, _V(4.2, 0, 22.3), _V(0, 1, 0), _V(0, 0, 1), "F2", false);
CARGO = CreateAttachment(false, _V(0, 0, 22.), _V(0, 1, 0), _V(0, 0, 1), "CARGO", false);
SetMeshVisibilityMode(AddMesh(oapiLoadMeshGlobal("SLSBLOCK1A")), MESHVIS_ALWAYS); //Main ship mesh
ph_main = CreatePropellantResource(MAX_MAIN_FUEL);
th_main[0]= CreateThruster(_V(-2, -3.5, -37), _V(0, 0, 1), MAX_MAIN_THRUST, ph_main, ISP);
th_main[1] = CreateThruster(_V(-2, 3.5, -37), _V(0, 0, 1), MAX_MAIN_THRUST, ph_main, ISP);
th_main[2] = CreateThruster(_V(2, -3.5, -37), _V(0, 0, 1), MAX_MAIN_THRUST, ph_main, ISP);
th_main[3] = CreateThruster(_V(2, 3.5, -37), _V(0, 0, 1), MAX_MAIN_THRUST, ph_main, ISP);
thg_main = CreateThrusterGroup(th_main, 4, THGROUP_MAIN);
AddExhaust(th_main[0], 15, .5, _V(-1.998015, -3.527, -39.596416), _V(0, 0, -1));
AddExhaust(th_main[1], 15, .5, _V(-1.998015, 3.527, -39.596416), _V(0, 0, -1));
AddExhaust(th_main[2], 15, .5, _V(1.998015, -3.527, -39.596416), _V(0, 0, -1));
AddExhaust(th_main[3], 15, .5, _V(1.998015, 3.527, -39.596416), _V(0, 0, -1));
SURFHANDLE tex_main = oapiRegisterExhaustTexture("Exhaust_atsme");
for (i = 0; i < 4; i++) AddExhaust(th_main[i], 30.0, 2.0, tex_main);
THRUSTER_HANDLE th_att_rot[4], th_att_lin[4];
th_att_rot[0] = th_att_lin[0] = CreateThruster(_V(0, 0, 8), _V(0, 1, 0), MAX_RCS_THRUST, ph_main, ISP);
th_att_rot[1] = th_att_lin[3] = CreateThruster(_V(0, 0, -8), _V(0, -1, 0), MAX_RCS_THRUST, ph_main, ISP);
th_att_rot[2] = th_att_lin[2] = CreateThruster(_V(0, 0, 8), _V(0, -1, 0), MAX_RCS_THRUST, ph_main, ISP);
th_att_rot[3] = th_att_lin[1] = CreateThruster(_V(0, 0, -8), _V(0, 1, 0), MAX_RCS_THRUST, ph_main, ISP);
CreateThrusterGroup(th_att_rot, 2, THGROUP_ATT_PITCHUP);
CreateThrusterGroup(th_att_rot + 2, 2, THGROUP_ATT_PITCHDOWN);
CreateThrusterGroup(th_att_lin, 2, THGROUP_ATT_UP);
CreateThrusterGroup(th_att_lin + 2, 2, THGROUP_ATT_DOWN);
th_att_rot[0] = th_att_lin[0] = CreateThruster(_V(0, 0, 6), _V(-1, 0, 0), MAX_RCS_THRUST, ph_main, ISP);
th_att_rot[1] = th_att_lin[3] = CreateThruster(_V(0, 0, -6), _V(1, 0, 0), MAX_RCS_THRUST, ph_main, ISP);
th_att_rot[2] = th_att_lin[2] = CreateThruster(_V(0, 0, 6), _V(1, 0, 0), MAX_RCS_THRUST, ph_main, ISP);
th_att_rot[3] = th_att_lin[1] = CreateThruster(_V(0, 0, -6), _V(-1, 0, 0), MAX_RCS_THRUST, ph_main, ISP);
CreateThrusterGroup(th_att_rot, 2, THGROUP_ATT_YAWLEFT);
CreateThrusterGroup(th_att_rot + 2, 2, THGROUP_ATT_YAWRIGHT);
CreateThrusterGroup(th_att_lin, 2, THGROUP_ATT_LEFT);
CreateThrusterGroup(th_att_lin + 2, 2, THGROUP_ATT_RIGHT);
th_att_rot[0] = CreateThruster(_V(6, 0, 0), _V(0, 1, 0), MAX_RCS_THRUST, ph_main, ISP);
th_att_rot[1] = CreateThruster(_V(-6, 0, 0), _V(0, -1, 0), MAX_RCS_THRUST, ph_main, ISP);
th_att_rot[2] = CreateThruster(_V(-6, 0, 0), _V(0, 1, 0), MAX_RCS_THRUST, ph_main, ISP);
th_att_rot[3] = CreateThruster(_V(6, 0, 0), _V(0, -1, 0), MAX_RCS_THRUST, ph_main, ISP);
CreateThrusterGroup(th_att_rot, 2, THGROUP_ATT_BANKLEFT);
CreateThrusterGroup(th_att_rot + 2, 2, THGROUP_ATT_BANKRIGHT);
th_att_lin[0] = CreateThruster(_V(0, 0, -7), _V(0, 0, 1), 2 * MAX_RCS_THRUST, ph_main, ISP);
th_att_lin[1] = CreateThruster(_V(0, 0, 7), _V(0, 0, -1), 2 * MAX_RCS_THRUST, ph_main, ISP);
CreateThrusterGroup(th_att_lin, 1, THGROUP_ATT_FORWARD);
CreateThrusterGroup(th_att_lin + 1, 1, THGROUP_ATT_BACK);
}
void SLS::clbkPostStep(double simt, double simdt, double mjd)
{
}
DLLCLBK VESSEL *ovcInit(OBJHANDLE hvessel, int flightmodel)
{
return new SLS(hvessel, flightmodel);
}
DLLCLBK void ovcExit(VESSEL *vessel)
{
if (vessel) delete (SLS*)vessel;
}
void SLS::DefineAnimations(void)
{
}
// --------------------------------------------------------------
// Keyboard interface handler (buffered key events)
// --------------------------------------------------------------
int SLS::clbkConsumeBufferedKey(DWORD key, bool down, char *kstate)
{
// only process keydown events
if (!down)
return 0;
if (key == OAPI_KEY_G)
{
DetachChild(F1,- 4);// deattach stage
DetachChild(F2, 4);// deattach stage
}
if (key == OAPI_KEY_J)
{
DetachChild(CARGO, 1);// deattach stage
}
return 0;
}
// ====================================================================
// clbkVisualCreated used to display UMMU initialisation message
// because oapiDebugString() doesn't work in clbkSetClassCap
// ====================================================================
void SLS::clbkVisualCreated(VISHANDLE vis, int refcount)
{
MainExternalMeshVisual = GetMesh(vis, 0);
}
// ==============================================================
// Visual destroyed
// ==============================================================
void SLS::clbkVisualDestroyed(VISHANDLE vis, int refcount)
{
MainExternalMeshVisual = 0;
}
void SLS::clbkSaveState(FILEHANDLE scn)
{
// char cbuf[256];
// ORBITER, default vessel parameters
SaveDefaultState(scn);
}
void SLS::clbkLoadStateEx(FILEHANDLE scn, void *status)
{
char *line;
while (oapiReadScenario_nextline(scn, line))
{
ParseScenarioLineEx(line, status);
}
}
// ==============================================================
// Some vessel parameters
// ==============================================================
const double ISP = 3560;
double MAX_MAIN_FUEL = 114660;
double MAX_RCS_THRUST = 110.25;
double MAX_MAIN_THRUST = 573870;
// Interface for derived vessel class:
// ==========================================================
class SLS : public VESSEL2 {
public:
SLS(OBJHANDLE hObj, int fmodel);
void clbkPostCreation(void);
void clbkSetClassCaps(FILEHANDLE cfg);
int clbkConsumeBufferedKey(DWORD key, bool down, char *kstate);
void clbkVisualCreated(VISHANDLE vis, int refcount);
void DefineAnimations(void);
void clbkVisualDestroyed(VISHANDLE vis, int refcount);
void clbkPostStep(double simtt, double simdt, double mjd);
void clbkLoadStateEx(FILEHANDLE scn, void *status);
void clbkSaveState(FILEHANDLE scn);
int InitializeOrbiterSound();
THRUSTER_HANDLE th_main[4], thg_main;
PROPELLANT_HANDLE ph_main;
ATTACHMENTHANDLE B1, B2,F1,F2,CARGO;
int SLSID;
};
I believe Ares 1X uses it: Ares I-X Ultra 1.00
Any idea why the main vessel climbs and dive back?
https://dl.dropboxusercontent.com/u/71242599/slsspec.jpg
I looked at the Ares code