Rigs of Rods 2023.09
Soft-body Physics Simulation
Loading...
Searching...
No Matches
TurbojetAngelscript.cpp
Go to the documentation of this file.
1#include "Application.h"
2#include "ScriptEngine.h"
3#include "TurboJet.h"
4#include "SimData.h"
5
6#include <angelscript.h>
7
8using namespace AngelScript;
9
10void RoR::RegisterTurbojet(asIScriptEngine* engine)
11{
12 int result = 0;
13
14 AeroEngine::RegisterRefCountingObject(engine, "TurbojetClass");
15 AeroEnginePtr::RegisterRefCountingObjectPtr(engine, "TurbojetClassPtr", "TurbojetClass");
16
17 // PLEASE maintain same order as in 'physics/air/Turbojet.h' and 'doc/angelscript/Script2Game/TurbojetClass.h'
18 result = engine->RegisterObjectMethod("TurbojetClass", "float getMaxDryThrust()", asMETHOD(Turbojet, getMaxDryThrust), asCALL_THISCALL); ROR_ASSERT(result >= 0);
19 result = engine->RegisterObjectMethod("TurbojetClass", "bool getAfterburner()", asFUNCTIONPR([](Turbojet* self) -> bool {
20 return self->getAfterburner() != 0; }, (Turbojet*), bool), asCALL_CDECL_OBJFIRST); ROR_ASSERT(result >= 0);
21 result = engine->RegisterObjectMethod("TurbojetClass", "float getAfterburnerThrust()", asMETHOD(Turbojet, getAfterburnThrust), asCALL_THISCALL); ROR_ASSERT(result >= 0);
22 result = engine->RegisterObjectMethod("TurbojetClass", "float getExhaustVelocity()", asMETHOD(Turbojet, getExhaustVelocity), asCALL_THISCALL); ROR_ASSERT(result >= 0);
23}
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...
void RegisterTurbojet(AngelScript::asIScriptEngine *engine)