27 #include <angelscript.h>
29 using namespace AngelScript;
36 result = engine->RegisterEnum(
"TruckState");
ROR_ASSERT(result>=0);
37 result = engine->RegisterEnumValue(
"TruckState",
"TS_SIMULATED",
static_cast<int>(ActorState::LOCAL_SIMULATED));
ROR_ASSERT(result>=0);
38 result = engine->RegisterEnumValue(
"TruckState",
"TS_SLEEPING",
static_cast<int>(ActorState::LOCAL_SLEEPING));
ROR_ASSERT(result>=0);
39 result = engine->RegisterEnumValue(
"TruckState",
"TS_NETWORKED",
static_cast<int>(ActorState::NETWORKED_OK));
ROR_ASSERT(result>=0);
42 result = engine->RegisterEnum(
"truckTypes");
ROR_ASSERT(result>=0);
44 result = engine->RegisterEnumValue(
"truckTypes",
"TT_TRUCK",
TRUCK);
ROR_ASSERT(result>=0);
45 result = engine->RegisterEnumValue(
"truckTypes",
"TT_AIRPLANE",
AIRPLANE);
ROR_ASSERT(result>=0);
46 result = engine->RegisterEnumValue(
"truckTypes",
"TT_BOAT",
BOAT);
ROR_ASSERT(result>=0);
47 result = engine->RegisterEnumValue(
"truckTypes",
"TT_MACHINE",
MACHINE);
ROR_ASSERT(result>=0);
48 result = engine->RegisterEnumValue(
"truckTypes",
"TT_AI",
AI);
ROR_ASSERT(result>=0);
51 result = engine->RegisterEnum(
"FlareType");
ROR_ASSERT(result >= 0);
52 result = engine->RegisterEnumValue(
"FlareType",
"FLARE_TYPE_NONE", (
int)FlareType::NONE);
ROR_ASSERT(result >= 0);
53 result = engine->RegisterEnumValue(
"FlareType",
"FLARE_TYPE_HEADLIGHT", (
int)FlareType::HEADLIGHT);
ROR_ASSERT(result >= 0);
54 result = engine->RegisterEnumValue(
"FlareType",
"FLARE_TYPE_HIGH_BEAM", (
int)FlareType::HIGH_BEAM);
ROR_ASSERT(result >= 0);
55 result = engine->RegisterEnumValue(
"FlareType",
"FLARE_TYPE_FOG_LIGHT", (
int)FlareType::FOG_LIGHT);
ROR_ASSERT(result >= 0);
56 result = engine->RegisterEnumValue(
"FlareType",
"FLARE_TYPE_TAIL_LIGHT", (
int)FlareType::TAIL_LIGHT);
ROR_ASSERT(result >= 0);
57 result = engine->RegisterEnumValue(
"FlareType",
"FLARE_TYPE_BRAKE_LIGHT", (
int)FlareType::BRAKE_LIGHT);
ROR_ASSERT(result >= 0);
58 result = engine->RegisterEnumValue(
"FlareType",
"FLARE_TYPE_REVERSE_LIGHT", (
int)FlareType::REVERSE_LIGHT);
ROR_ASSERT(result >= 0);
59 result = engine->RegisterEnumValue(
"FlareType",
"FLARE_TYPE_SIDELIGHT", (
int)FlareType::SIDELIGHT);
ROR_ASSERT(result >= 0);
60 result = engine->RegisterEnumValue(
"FlareType",
"FLARE_TYPE_BLINKER_LEFT", (
int)FlareType::BLINKER_LEFT);
ROR_ASSERT(result >= 0);
61 result = engine->RegisterEnumValue(
"FlareType",
"FLARE_TYPE_BLINKER_RIGHT", (
int)FlareType::BLINKER_RIGHT);
ROR_ASSERT(result >= 0);
62 result = engine->RegisterEnumValue(
"FlareType",
"FLARE_TYPE_USER", (
int)FlareType::USER);
ROR_ASSERT(result >= 0);
63 result = engine->RegisterEnumValue(
"FlareType",
"FLARE_TYPE_DASHBOARD", (
int)FlareType::DASHBOARD);
ROR_ASSERT(result >= 0);
66 result = engine->RegisterEnum(
"BlinkType");
ROR_ASSERT(result >= 0);
67 result = engine->RegisterEnumValue(
"BlinkType",
"BLINK_NONE", (
int)
BLINK_NONE);
ROR_ASSERT(result >= 0);
68 result = engine->RegisterEnumValue(
"BlinkType",
"BLINK_LEFT", (
int)
BLINK_LEFT);
ROR_ASSERT(result >= 0);
69 result = engine->RegisterEnumValue(
"BlinkType",
"BLINK_RIGHT", (
int)
BLINK_RIGHT);
ROR_ASSERT(result >= 0);
70 result = engine->RegisterEnumValue(
"BlinkType",
"BLINK_WARN", (
int)
BLINK_WARN);
ROR_ASSERT(result >= 0);
73 result = engine->RegisterEnum(
"ActorModifyRequestType");
ROR_ASSERT(result >= 0);
74 result = engine->RegisterEnumValue(
"ActorModifyRequestType",
"ACTOR_MODIFY_REQUEST_INVALID", (
int)ActorModifyRequest::Type::INVALID);
ROR_ASSERT(result >= 0);
75 result = engine->RegisterEnumValue(
"ActorModifyRequestType",
"ACTOR_MODIFY_REQUEST_RELOAD", (
int)ActorModifyRequest::Type::RELOAD);
ROR_ASSERT(result >= 0);
76 result = engine->RegisterEnumValue(
"ActorModifyRequestType",
"ACTOR_MODIFY_REQUEST_RESET_ON_INIT_POS", (
int)ActorModifyRequest::Type::RESET_ON_INIT_POS);
ROR_ASSERT(result >= 0);
77 result = engine->RegisterEnumValue(
"ActorModifyRequestType",
"ACTOR_MODIFY_REQUEST_RESET_ON_SPOT", (
int)ActorModifyRequest::Type::RESET_ON_SPOT);
ROR_ASSERT(result >= 0);
78 result = engine->RegisterEnumValue(
"ActorModifyRequestType",
"ACTOR_MODIFY_REQUEST_SOFT_RESET", (
int)ActorModifyRequest::Type::SOFT_RESET);
ROR_ASSERT(result >= 0);
79 result = engine->RegisterEnumValue(
"ActorModifyRequestType",
"ACTOR_MODIFY_REQUEST_RESTORE_SAVED", (
int)ActorModifyRequest::Type::RESTORE_SAVED);
ROR_ASSERT(result >= 0);
80 result = engine->RegisterEnumValue(
"ActorModifyRequestType",
"ACTOR_MODIFY_REQUEST_WAKE_UP", (
int)ActorModifyRequest::Type::WAKE_UP);
ROR_ASSERT(result >= 0);
83 Actor::RegisterRefCountingObject(engine,
"BeamClass");
84 ActorPtr::RegisterRefCountingObjectPtr(engine,
"BeamClassPtr",
"BeamClass");
87 result = engine->RegisterObjectMethod(
"BeamClass",
"TruckState getTruckState()", asMETHOD(Actor,getTruckState), asCALL_THISCALL);
ROR_ASSERT(result>=0);
88 result = engine->RegisterObjectMethod(
"BeamClass",
"vector3 getPosition()", asMETHOD(Actor,getPosition), asCALL_THISCALL);
ROR_ASSERT(result>=0);
89 result = engine->RegisterObjectMethod(
"BeamClass",
"vector3 getVehiclePosition()", asMETHOD(Actor,getPosition), asCALL_THISCALL);
ROR_ASSERT(result>=0);
90 result = engine->RegisterObjectMethod(
"BeamClass",
"float getRotation()", asMETHOD(Actor,getRotation), asCALL_THISCALL);
ROR_ASSERT(result>=0);
91 result = engine->RegisterObjectMethod(
"BeamClass",
"float getHeadingDirectionAngle()", asMETHOD(Actor,getRotation), asCALL_THISCALL);
ROR_ASSERT(result>=0);
92 result = engine->RegisterObjectMethod(
"BeamClass",
"quaternion getOrientation()", asMETHOD(Actor,getOrientation), asCALL_THISCALL);
ROR_ASSERT(result>=0);
93 result = engine->RegisterObjectMethod(
"BeamClass",
"float getSpeed()", asMETHOD(Actor,getSpeed), asCALL_THISCALL);
ROR_ASSERT(result>=0);
94 result = engine->RegisterObjectMethod(
"BeamClass",
"vector3 getGForces()", asMETHOD(Actor,getGForces), asCALL_THISCALL);
ROR_ASSERT(result>=0);
95 result = engine->RegisterObjectMethod(
"BeamClass",
"float getTotalMass(bool)", asMETHOD(Actor,getTotalMass), asCALL_THISCALL);
ROR_ASSERT(result>=0);
96 result = engine->RegisterObjectMethod(
"BeamClass",
"int getNodeCount()", asMETHOD(Actor,getNodeCount), asCALL_THISCALL);
ROR_ASSERT(result>=0);
97 result = engine->RegisterObjectMethod(
"BeamClass",
"vector3 getNodePosition(int)", asMETHOD(Actor,getNodePosition), asCALL_THISCALL);
ROR_ASSERT(result>=0);
98 result = engine->RegisterObjectMethod(
"BeamClass",
"bool isNodeWheelRim(int)", asMETHOD(Actor,isNodeWheelRim), asCALL_THISCALL);
ROR_ASSERT(result>=0);
99 result = engine->RegisterObjectMethod(
"BeamClass",
"bool isNodeWheelTire(int)", asMETHOD(Actor,isNodeWheelTire), asCALL_THISCALL);
ROR_ASSERT(result>=0);
100 result = engine->RegisterObjectMethod(
"BeamClass",
"int getWheelNodeCount()", asMETHOD(Actor,getWheelNodeCount), asCALL_THISCALL);
ROR_ASSERT(result>=0);
101 result = engine->RegisterObjectMethod(
"BeamClass",
"float getWheelSpeed()", asMETHOD(Actor,getWheelSpeed), asCALL_THISCALL);
ROR_ASSERT(result>=0);
102 result = engine->RegisterObjectMethod(
"BeamClass",
"void reset(bool)", asMETHOD(Actor,reset), asCALL_THISCALL);
ROR_ASSERT(result>=0);
103 result = engine->RegisterObjectMethod(
"BeamClass",
"int getShockCount()", AngelScript::asMETHOD(Actor,getShockCount), AngelScript::asCALL_THISCALL);
ROR_ASSERT(result>=0);
104 result = engine->RegisterObjectMethod(
"BeamClass",
"float getShockSpringRate(int)", AngelScript::asMETHOD(Actor,getShockSpringRate), AngelScript::asCALL_THISCALL);
ROR_ASSERT(result>=0);
105 result = engine->RegisterObjectMethod(
"BeamClass",
"float getShockDamping(int)", AngelScript::asMETHOD(Actor,getShockDamping), AngelScript::asCALL_THISCALL);
ROR_ASSERT(result>=0);
106 result = engine->RegisterObjectMethod(
"BeamClass",
"float getShockVelocity(int)", AngelScript::asMETHOD(Actor,getShockVelocity), AngelScript::asCALL_THISCALL);
ROR_ASSERT(result>=0);
107 result = engine->RegisterObjectMethod(
"BeamClass",
"int getShockNode1(int)", AngelScript::asMETHOD(Actor, getShockNode1), AngelScript::asCALL_THISCALL);
ROR_ASSERT(result >= 0);
108 result = engine->RegisterObjectMethod(
"BeamClass",
"int getShockNode2(int)", AngelScript::asMETHOD(Actor, getShockNode2), AngelScript::asCALL_THISCALL);
ROR_ASSERT(result >= 0);
111 result = engine->RegisterObjectMethod(
"BeamClass",
"void scaleTruck(float)", asMETHOD(Actor,scaleTruck), asCALL_THISCALL);
ROR_ASSERT(result>=0);
112 result = engine->RegisterObjectMethod(
"BeamClass",
"void setMass(float)", asMETHOD(Actor,setMass), asCALL_THISCALL);
ROR_ASSERT(result>=0);
115 result = engine->RegisterObjectMethod(
"BeamClass",
"void parkingbrakeToggle()", asMETHOD(Actor,parkingbrakeToggle), asCALL_THISCALL);
ROR_ASSERT(result>=0);
116 result = engine->RegisterObjectMethod(
"BeamClass",
"void tractioncontrolToggle()", asMETHOD(Actor,tractioncontrolToggle), asCALL_THISCALL);
ROR_ASSERT(result>=0);
117 result = engine->RegisterObjectMethod(
"BeamClass",
"void antilockbrakeToggle()", asMETHOD(Actor,antilockbrakeToggle), asCALL_THISCALL);
ROR_ASSERT(result>=0);
118 result = engine->RegisterObjectMethod(
"BeamClass",
"void toggleCustomParticles()", asMETHOD(Actor,toggleCustomParticles), asCALL_THISCALL);
ROR_ASSERT(result>=0);
119 result = engine->RegisterObjectMethod(
"BeamClass",
"bool getCustomParticleMode()", asMETHOD(Actor,getCustomParticleMode), asCALL_THISCALL);
ROR_ASSERT(result>=0);
120 result = engine->RegisterObjectMethod(
"BeamClass",
"bool isLocked()", asMETHOD(Actor,isLocked), asCALL_THISCALL);
ROR_ASSERT(result>=0);
123 result = engine->RegisterObjectMethod(
"BeamClass",
"VehicleAIClassPtr @getVehicleAI()", asMETHOD(Actor,getVehicleAI), asCALL_THISCALL);
ROR_ASSERT(result>=0);
124 result = engine->RegisterObjectMethod(
"BeamClass",
"Ogre::MaterialPtr getManagedMaterialInstance(const string &in)", asMETHOD(Actor,getManagedMaterialInstance), asCALL_THISCALL);
ROR_ASSERT(result>=0);
125 result = engine->RegisterObjectMethod(
"BeamClass",
"array<string>@ getManagedMaterialNames()", asFUNCTIONPR([](Actor*
self) -> CScriptArray*{
129 result = engine->RegisterObjectMethod(
"BeamClass",
"int getBlinkType()", asMETHOD(Actor, getBlinkType), asCALL_THISCALL);
ROR_ASSERT(result >= 0);
130 result = engine->RegisterObjectMethod(
"BeamClass",
"void setBlinkType(int)", asMETHOD(Actor, setBlinkType), asCALL_THISCALL);
ROR_ASSERT(result >= 0);
131 result = engine->RegisterObjectMethod(
"BeamClass",
"bool getCustomLightVisible(int)", asMETHOD(Actor, getCustomLightVisible), asCALL_THISCALL);
ROR_ASSERT(result >= 0);
132 result = engine->RegisterObjectMethod(
"BeamClass",
"void setCustomLightVisible(int, bool)", asMETHOD(Actor, setCustomLightVisible), asCALL_THISCALL);
ROR_ASSERT(result >= 0);
133 result = engine->RegisterObjectMethod(
"BeamClass",
"bool getBeaconMode()", asMETHOD(Actor, getBeaconMode), asCALL_THISCALL);
ROR_ASSERT(result >= 0);
134 result = engine->RegisterObjectMethod(
"BeamClass",
"void beaconsToggle()", asMETHOD(Actor, beaconsToggle), asCALL_THISCALL);
ROR_ASSERT(result >= 0);
135 result = engine->RegisterObjectMethod(
"BeamClass",
"bool getBrakeLightVisible()", asMETHOD(Actor, getBrakeLightVisible), asCALL_THISCALL);
ROR_ASSERT(result >= 0);
136 result = engine->RegisterObjectMethod(
"BeamClass",
"bool getReverseLightVisible()", asMETHOD(Actor, getReverseLightVisible), asCALL_THISCALL);
ROR_ASSERT(result >= 0);
137 result = engine->RegisterObjectMethod(
"BeamClass",
"int countCustomLights(int)", asMETHOD(Actor, countCustomLights), asCALL_THISCALL);
ROR_ASSERT(result >= 0);
138 result = engine->RegisterObjectMethod(
"BeamClass",
"int countFlaresByType(FlareType)", asMETHOD(Actor, countFlaresByType), asCALL_THISCALL);
ROR_ASSERT(result >= 0);
141 result = engine->RegisterObjectMethod(
"BeamClass",
"string getTruckName()", asMETHOD(Actor,getTruckName), asCALL_THISCALL);
ROR_ASSERT(result>=0);
142 result = engine->RegisterObjectMethod(
"BeamClass",
"string getTruckFileName()", asMETHOD(Actor,getTruckFileName), asCALL_THISCALL);
ROR_ASSERT(result>=0);
143 result = engine->RegisterObjectMethod(
"BeamClass",
"string getTruckFileResourceGroup()", asMETHOD(Actor, getTruckFileResourceGroup), asCALL_THISCALL);
ROR_ASSERT(result >= 0);
144 result = engine->RegisterObjectMethod(
"BeamClass",
"int getTruckType()", asMETHOD(Actor,getTruckType), asCALL_THISCALL);
ROR_ASSERT(result>=0);
145 result = engine->RegisterObjectMethod(
"BeamClass",
"string getSectionConfig()", asMETHOD(Actor, getSectionConfig), asCALL_THISCALL);
ROR_ASSERT(result >= 0);
146 result = engine->RegisterObjectMethod(
"BeamClass",
"int getInstanceId()", asMETHOD(Actor, getInstanceId), asCALL_THISCALL);
ROR_ASSERT(result >= 0);