Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
ScrewpropAngelscriptGeneric.cpp
Go to the documentation of this file.
1#include "Application.h"
2#include "ScriptEngine.h"
3#include "ScrewProp.h"
4#include "SimData.h"
5#include "../../autowrapper/aswrappedcall.h"
6
7#include <angelscript.h>
8
9using namespace AngelScript;
10
11void RoR::RegisterScrewpropGeneric(asIScriptEngine* engine)
12{
13 int result = 0;
14
15 Screwprop::RegisterRefCountingObjectGeneric(engine, "ScrewpropClass");
16 ScrewpropPtr::RegisterRefCountingObjectPtrGeneric(engine, "ScrewpropClassPtr", "ScrewpropClass");
17
18 // PLEASE maintain same order as in 'physics/water/Screwprop.h' and 'doc/angelscript/Script2Game/ScrewpropClass.h'
19 result = engine->RegisterObjectMethod("ScrewpropClass", "void setThrottle(float)", WRAP_MFN(Screwprop, setThrottle), asCALL_GENERIC); ROR_ASSERT(result >= 0);
20 result = engine->RegisterObjectMethod("ScrewpropClass", "void setRudder(float)", WRAP_MFN(Screwprop, setRudder), asCALL_GENERIC); ROR_ASSERT(result >= 0);
21 result = engine->RegisterObjectMethod("ScrewpropClass", "float getThrottle()", WRAP_MFN(Screwprop, getThrottle), asCALL_GENERIC); ROR_ASSERT(result >= 0);
22 result = engine->RegisterObjectMethod("ScrewpropClass", "float getRudder()", WRAP_MFN(Screwprop, getRudder), asCALL_GENERIC); ROR_ASSERT(result >= 0);
23 result = engine->RegisterObjectMethod("ScrewpropClass", "float getMaxPower()", WRAP_MFN(Screwprop, getMaxPower), asCALL_GENERIC); ROR_ASSERT(result >= 0);
24 result = engine->RegisterObjectMethod("ScrewpropClass", "bool getReverse()", WRAP_MFN(Screwprop, getReverse), asCALL_GENERIC); ROR_ASSERT(result >= 0);
25 result = engine->RegisterObjectMethod("ScrewpropClass", "void toggleReverse()", WRAP_MFN(Screwprop, toggleReverse), asCALL_GENERIC); ROR_ASSERT(result >= 0);
26 result = engine->RegisterObjectMethod("ScrewpropClass", "int getRefNode()", WRAP_MFN(Screwprop, GetRefNode), asCALL_GENERIC); ROR_ASSERT(result >= 0);
27 result = engine->RegisterObjectMethod("ScrewpropClass", "int getBackNode()", WRAP_MFN(Screwprop, GetBackNode), asCALL_GENERIC); ROR_ASSERT(result >= 0);
28 result = engine->RegisterObjectMethod("ScrewpropClass", "int getUpNode()", WRAP_MFN(Screwprop, GetUpNode), asCALL_GENERIC); ROR_ASSERT(result >= 0);
29}
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 RegisterScrewpropGeneric(AngelScript::asIScriptEngine *engine)