Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
AutopilotAngelscriptGeneric.cpp
Go to the documentation of this file.
1#include "Application.h"
2#include "ScriptEngine.h"
3#include "AutoPilot.h"
4#include "SimData.h"
5#include "../../autowrapper/aswrappedcall.h"
6
7#include <angelscript.h>
8
9using namespace AngelScript;
10
11void RoR::RegisterAutopilotGeneric(asIScriptEngine* engine)
12{
13 int result = 0;
14
15 Autopilot::RegisterRefCountingObjectGeneric(engine, "AutopilotClass");
16 AutopilotPtr::RegisterRefCountingObjectPtrGeneric(engine, "AutopilotClassPtr", "AutopilotClass");
17
18 // PLEASE maintain same order as in 'gameplay/AutoPilot.h' and 'doc/angelscript/Script2Game/AutopilotClass.h'
19 result = engine->RegisterObjectMethod("AutopilotClass", "void disconnect()", WRAP_MFN(Autopilot, disconnect), asCALL_GENERIC); ROR_ASSERT(result >= 0);
20 result = engine->RegisterObjectMethod("AutopilotClass", "bool getForceDisabled()", WRAP_MFN(Autopilot, getForceDisabled), asCALL_GENERIC); ROR_ASSERT(result >= 0);
21 result = engine->RegisterObjectMethod("AutopilotClass", "void setForceDisabled(bool)", WRAP_MFN(Autopilot, setForceDisabled), asCALL_GENERIC); ROR_ASSERT(result >= 0);
22 result = engine->RegisterObjectMethod("AutopilotClass", "APHeadingMode toggleHeading(APHeadingMode)", WRAP_MFN(Autopilot, toggleHeading), asCALL_GENERIC); ROR_ASSERT(result >= 0);
23 result = engine->RegisterObjectMethod("AutopilotClass", "APAltitudeMode toggleAltitude(APAltitudeMode)", WRAP_MFN(Autopilot, toggleAlt), asCALL_GENERIC); ROR_ASSERT(result >= 0);
24 result = engine->RegisterObjectMethod("AutopilotClass", "bool toggleIAS()", WRAP_MFN(Autopilot, toggleIAS), asCALL_GENERIC); ROR_ASSERT(result >= 0);
25 result = engine->RegisterObjectMethod("AutopilotClass", "bool toggleGPWS()", WRAP_MFN(Autopilot, toggleGPWS), asCALL_GENERIC); ROR_ASSERT(result >= 0);
26 result = engine->RegisterObjectMethod("AutopilotClass", "int adjustHeading(int)", WRAP_MFN(Autopilot, adjHDG), asCALL_GENERIC); ROR_ASSERT(result >= 0);
27 result = engine->RegisterObjectMethod("AutopilotClass", "int adjustAltitude(int)", WRAP_MFN(Autopilot, adjALT), asCALL_GENERIC); ROR_ASSERT(result >= 0);
28 result = engine->RegisterObjectMethod("AutopilotClass", "int adjustVerticalSpeed(int)", WRAP_MFN(Autopilot, adjVS), asCALL_GENERIC); ROR_ASSERT(result >= 0);
29 result = engine->RegisterObjectMethod("AutopilotClass", "int adjustIAS(int)", WRAP_MFN(Autopilot, adjIAS), asCALL_GENERIC); ROR_ASSERT(result >= 0);
30 result = engine->RegisterObjectMethod("AutopilotClass", "float getVerticalApproachDeviation()", WRAP_MFN(Autopilot, GetVerticalApproachDeviation), asCALL_GENERIC); ROR_ASSERT(result >= 0);
31 result = engine->RegisterObjectMethod("AutopilotClass", "float getHorizontalApproachDeviation()", WRAP_MFN(Autopilot, GetHorizontalApproachDeviation), asCALL_GENERIC); ROR_ASSERT(result >= 0);
32 result = engine->RegisterObjectMethod("AutopilotClass", "bool isILSAvailable()", WRAP_MFN(Autopilot, IsIlsAvailable), asCALL_GENERIC); ROR_ASSERT(result >= 0);
33 result = engine->RegisterObjectMethod("AutopilotClass", "APHeadingMode getHeadingMode()", WRAP_MFN(Autopilot, GetHeadingMode), asCALL_GENERIC); ROR_ASSERT(result >= 0);
34 result = engine->RegisterObjectMethod("AutopilotClass", "int getHeadingValue()", WRAP_MFN(Autopilot, GetHeadingValue), asCALL_GENERIC); ROR_ASSERT(result >= 0);
35 result = engine->RegisterObjectMethod("AutopilotClass", "APAltitudeMode getAltitudeMode()", WRAP_MFN(Autopilot, GetAltMode), asCALL_GENERIC); ROR_ASSERT(result >= 0);
36 result = engine->RegisterObjectMethod("AutopilotClass", "int getAltitudeValue()", WRAP_MFN(Autopilot, GetAltValue), asCALL_GENERIC); ROR_ASSERT(result >= 0);
37 result = engine->RegisterObjectMethod("AutopilotClass", "bool getIASMode()", WRAP_MFN(Autopilot, GetIasMode), asCALL_GENERIC); ROR_ASSERT(result >= 0);
38 result = engine->RegisterObjectMethod("AutopilotClass", "int getIASValue()", WRAP_MFN(Autopilot, GetIasValue), asCALL_GENERIC); ROR_ASSERT(result >= 0);
39 result = engine->RegisterObjectMethod("AutopilotClass", "bool getGPWSMode()", WRAP_MFN(Autopilot, GetGpwsMode), asCALL_GENERIC); ROR_ASSERT(result >= 0);
40 result = engine->RegisterObjectMethod("AutopilotClass", "int getVerticalSpeedValue()", WRAP_MFN(Autopilot, GetVsValue), asCALL_GENERIC); ROR_ASSERT(result >= 0);
41}
Central state/object manager and communications hub.
#define ROR_ASSERT(_EXPR)
Definition Application.h:40
Core data structures for simulation; Everything affected by by either physics, network or user intera...
#define WRAP_MFN(ClassType, name)
void RegisterAutopilotGeneric(AngelScript::asIScriptEngine *engine)