| 3250 | } |
| 3251 | |
| 3252 | void AttachScenegraph(ASContext* context, SceneGraph* scenegraph) { |
| 3253 | the_scenegraph = scenegraph; |
| 3254 | |
| 3255 | context->RegisterGlobalFunction("int GetNumCharacters()", |
| 3256 | asFUNCTION(ASGetNumCharacters), asCALL_CDECL); |
| 3257 | context->RegisterGlobalFunction("int GetNumHotspots()", |
| 3258 | asFUNCTION(ASGetNumHotspots), asCALL_CDECL); |
| 3259 | context->RegisterGlobalFunction("int GetNumItems()", |
| 3260 | asFUNCTION(ASGetNumItems), asCALL_CDECL); |
| 3261 | context->RegisterGlobalFunction("void GetCharactersInSphere(vec3 position, float radius, array<int>@ id_array)", |
| 3262 | asFUNCTION(GetCharactersInSphere), asCALL_CDECL); |
| 3263 | context->RegisterGlobalFunction("void GetCharacters(array<int>@ id_array)", |
| 3264 | asFUNCTION(GetCharacters), asCALL_CDECL); |
| 3265 | context->RegisterGlobalFunction("void GetCharactersInHull(string model_path, mat4, array<int>@ id_array)", |
| 3266 | asFUNCTION(GetCharactersInHull), asCALL_CDECL); |
| 3267 | context->RegisterGlobalFunction("void GetObjectsInHull(string model_path, mat4, array<int>@ id_array)", |
| 3268 | asFUNCTION(GetObjectsInHull), asCALL_CDECL); |
| 3269 | context->RegisterGlobalFunction("void ResetLevel()", |
| 3270 | asFUNCTION(ResetLevel), asCALL_CDECL); |
| 3271 | context->RegisterGlobalFunction("bool DoesItemFitInItem(int item_id, int holster_item_id)", |
| 3272 | asFUNCTION(ASDoesItemFitInItem), asCALL_CDECL); |
| 3273 | context->RegisterGlobalFunction("float GetFriction(const vec3 &in position)", |
| 3274 | asFUNCTION(ASGetFriction), asCALL_CDECL); |
| 3275 | context->RegisterGlobalFunction("void CreateCustomHull(const string &in key, const array<vec3> &vertices)", |
| 3276 | asFUNCTION(CreateCustomHull), asCALL_CDECL); |
| 3277 | |
| 3278 | context->RegisterObjectType("Object", 0, asOBJ_REF | asOBJ_NOCOUNT); |
| 3279 | |
| 3280 | DefineRiggedObjectTypePublic(context); |
| 3281 | if (!context->TypeExists("MovementObject")) { |
| 3282 | DefineMovementObjectTypePublic(context); |
| 3283 | context->DocsCloseBrace(); |
| 3284 | } |
| 3285 | DefineItemObjectTypePublic(context); |
| 3286 | DefineEnvObjectTypePublic(context); |
| 3287 | DefineHotspotTypePublic(context); |
| 3288 | |
| 3289 | AttachObject(context); |
| 3290 | |
| 3291 | context->RegisterGlobalFunction("MovementObject@ ReadCharacter(int index)", asFUNCTION(ASReadCharacter), asCALL_CDECL, "e.g. first character in scene"); |
| 3292 | context->RegisterGlobalFunction("MovementObject@ ReadCharacterID(int id)", asFUNCTION(ASReadCharacterID), asCALL_CDECL, "e.g. character with object ID 39"); |
| 3293 | context->RegisterGlobalFunction("Hotspot@ ReadHotspot(int index)", asFUNCTION(ASReadHotspot), asCALL_CDECL); |
| 3294 | context->RegisterGlobalFunction("ItemObject@ ReadItem(int index)", asFUNCTION(ASReadItem), asCALL_CDECL); |
| 3295 | context->RegisterGlobalFunction("ItemObject@ ReadItemID(int id)", asFUNCTION(ASReadItemID), asCALL_CDECL); |
| 3296 | context->RegisterGlobalFunction("EnvObject@ ReadEnvObjectID(int id)", asFUNCTION(ASReadEnvObjectID), asCALL_CDECL); |
| 3297 | context->RegisterGlobalFunction("bool ObjectExists(int id)", asFUNCTION(ASObjectExists), asCALL_CDECL); |
| 3298 | context->RegisterGlobalFunction("bool MovementObjectExists(int id)", asFUNCTION(ASMovementObjectExists), asCALL_CDECL); |
| 3299 | context->RegisterGlobalFunction("bool IsGroupDerived(int id)", asFUNCTION(ASIsGroupDerived), asCALL_CDECL); |
| 3300 | context->RegisterGlobalFunction("void SetPaused(bool paused)", asFUNCTION(ASSetPaused), asCALL_CDECL); |
| 3301 | context->RegisterGlobalFunction("int FindFirstCharacterInGroup(int id)", asFUNCTION(ASFindFirstCharacterInGroup), asCALL_CDECL); |
| 3302 | } |
| 3303 | |
| 3304 | #include "Game/level.h" |
| 3305 |
no test coverage detected