MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / Initialize

Method Initialize

Source/Objects/movementobject.cpp:3935–4140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3933}
3934
3935bool MovementObject::Initialize() {
3936 SDL_assert(update_list_entry == -1);
3937 update_list_entry = scenegraph_->LinkUpdateObject(this);
3938
3939 PROFILER_ENTER(g_profiler_ctx, "Preparing movementobject angelscript context");
3940 ASData as_data;
3941 as_data.scenegraph = scenegraph_;
3942 as_data.gui = scenegraph_->map_editor->gui;
3943 ASContext* ctx = new ASContext("movement_object", as_data);
3944 as_context.reset(ctx);
3945 AttachUIQueries(ctx);
3946 AttachMovementObjectCamera(ctx, this);
3947 AttachScreenWidth(ctx);
3948 AttachPhysics(ctx);
3949 AttachTextCanvasTextureToASContext(ctx);
3950 ScriptParams::RegisterScriptType(ctx);
3951 AttachLevel(ctx);
3952 AttachInterlevelData(ctx);
3953 AttachNavMesh(ctx);
3954 AttachMessages(ctx);
3955 AttachTokenIterator(ctx);
3956 AttachAttackScriptGetter(as_context.get());
3957 sp.RegisterScriptInstance(ctx);
3958 AttachStringConvert(ctx);
3959 AttachOnline(ctx);
3960
3961 as_collisions.reset(new ASCollisions(scenegraph_));
3962 as_collisions->AttachToContext(ctx);
3963
3964 DefineRiggedObjectTypePublic(ctx);
3965
3966 DefineMovementObjectTypePublic(ctx);
3967 as_context->GetEngine()->RegisterInterface("C_ACCEL");
3968 as_context->RegisterObjectMethod("MovementObject", "void AddToAttackHistory(const string &in attack_path)", asMETHOD(MovementObject, AddToAttackHistory), asCALL_THISCALL);
3969 as_context->RegisterObjectMethod("MovementObject", "float CheckAttackHistory(const string &in attack_path)", asMETHOD(MovementObject, CheckAttackHistory), asCALL_THISCALL);
3970 as_context->RegisterObjectMethod("MovementObject", "void ClearAttackHistory()", asMETHOD(MovementObject, ClearAttackHistory), asCALL_THISCALL);
3971 as_context->RegisterObjectMethod("MovementObject", "int WasHit(string type, string attack_path, vec3 dir, vec3 pos, int attacker_id, float attack_damage_mult, float attack_knockback_mult)", asMETHOD(MovementObject, ASWasHit), asCALL_THISCALL);
3972 as_context->RegisterObjectMethod("MovementObject", "void WasBlocked()", asMETHOD(MovementObject, ASWasBlocked), asCALL_THISCALL);
3973 as_context->RegisterObjectMethod("MovementObject", "float GetTempHealth()", asMETHOD(MovementObject, GetTempHealth), asCALL_THISCALL);
3974 as_context->RegisterObjectMethod("MovementObject", "void Ragdoll()", asMETHOD(MovementObject, Ragdoll), asCALL_THISCALL);
3975 as_context->RegisterObjectMethod("MovementObject", "void ApplyForce(vec3 force)", asMETHOD(MovementObject, ApplyForce), asCALL_THISCALL);
3976 as_context->RegisterObjectMethod("MovementObject", "vec3 GetFacing()", asMETHOD(MovementObject, GetFacing), asCALL_THISCALL);
3977 as_context->RegisterObjectMethod("MovementObject", "void UnRagdoll()", asMETHOD(MovementObject, UnRagdoll), asCALL_THISCALL);
3978 as_context->RegisterObjectMethod("MovementObject", "void SetAnimation(string anim_path)", asMETHODPR(MovementObject, SetAnimation, (std::string), void), asCALL_THISCALL);
3979 as_context->RegisterObjectMethod("MovementObject", "void SetAnimAndCharAnim(string anim_path, float transition_speed, int8 flags, string char_anim)", asMETHOD(MovementObject, SetAnimAndCharAnim), asCALL_THISCALL);
3980 as_context->RegisterObjectMethod("MovementObject", "void SwapAnimation(string anim_path)", asMETHODPR(MovementObject, SwapAnimation, (std::string), void), asCALL_THISCALL);
3981 as_context->RegisterObjectMethod("MovementObject", "void SetAnimation(string anim_path, float transition_speed)", asMETHODPR(MovementObject, SetAnimation, (std::string, float), void), asCALL_THISCALL);
3982 as_context->RegisterObjectMethod("MovementObject", "void SetAnimation(string anim_path, float transition_speed, int8 flags)", asMETHODPR(MovementObject, SetAnimation, (std::string, float, char), void), asCALL_THISCALL);
3983 as_context->RegisterObjectMethod("MovementObject", "void OverrideCharAnim(const string &in char_anim, const string &in anim_path)", asMETHOD(MovementObject, OverrideCharAnim), asCALL_THISCALL);
3984 as_context->RegisterObjectMethod("MovementObject", "void SetCharAnimation(string char_anim, float transition_speed, int8 flags)", asMETHODPR(MovementObject, ASSetCharAnimation, (std::string, float, char), void), asCALL_THISCALL);
3985 as_context->RegisterObjectMethod("MovementObject", "void SetCharAnimation(string char_anim, float transition_speed)", asMETHODPR(MovementObject, ASSetCharAnimation, (std::string, float), void), asCALL_THISCALL);
3986 as_context->RegisterObjectMethod("MovementObject", "void SetCharAnimation(string char_anim)", asMETHODPR(MovementObject, ASSetCharAnimation, (std::string), void), asCALL_THISCALL);
3987 as_context->RegisterObjectMethod("MovementObject", "void MaterialEvent(string event, vec3 position)", asMETHOD(MovementObject, HandleMovementObjectMaterialEventDefault), asCALL_THISCALL);
3988 as_context->RegisterObjectMethod("MovementObject", "void MaterialEvent(string event, vec3 position, float audio_gain)", asMETHOD(MovementObject, HandleMovementObjectMaterialEvent), asCALL_THISCALL);
3989 as_context->RegisterObjectMethod("MovementObject", "void PlaySoundGroupAttached(string path, vec3 position)", asMETHOD(MovementObject, ASPlaySoundGroupAttached), asCALL_THISCALL);
3990 as_context->RegisterObjectMethod("MovementObject", "void PlaySoundAttached(string path, vec3 position)", asMETHOD(MovementObject, ASPlaySoundAttached), asCALL_THISCALL);
3991 as_context->RegisterObjectMethod("MovementObject", "void PlaySoundGroupVoice(string voice_key, float delay)", asMETHOD(MovementObject, PlaySoundGroupVoice), asCALL_THISCALL);
3992 as_context->RegisterObjectMethod("MovementObject", "void ForceSoundGroupVoice(string voice_key, float delay)", asMETHOD(MovementObject, ForceSoundGroupVoice), asCALL_THISCALL);

Callers 1

CreateRiggedObjectMethod · 0.45

Calls 15

AttachUIQueriesFunction · 0.85
AttachScreenWidthFunction · 0.85
AttachPhysicsFunction · 0.85
AttachLevelFunction · 0.85
AttachInterlevelDataFunction · 0.85
AttachNavMeshFunction · 0.85
AttachMessagesFunction · 0.85
AttachTokenIteratorFunction · 0.85
AttachAttackScriptGetterFunction · 0.85
AttachStringConvertFunction · 0.85

Tested by

no test coverage detected