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

Function GetCharactersInSphere

Source/Scripting/angelscript/asfuncs.cpp:3155–3165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3153
3154#include "Scripting/angelscript/add_on/scriptarray/scriptarray.h"
3155void GetCharactersInSphere(vec3 origin, float radius, CScriptArray* array) {
3156 ContactInfoCallback cb;
3157 the_scenegraph->abstract_bullet_world_->GetSphereCollisions(origin, radius, cb);
3158 for (int i = 0; i < cb.contact_info.size(); ++i) {
3159 BulletObject* bo = cb.contact_info[i].object;
3160 if (bo && bo->owner_object && the_scenegraph->IsObjectSane(bo->owner_object) && bo->owner_object->GetType() == _movement_object) {
3161 int val = ((MovementObject*)bo->owner_object)->GetID();
3162 array->InsertLast(&val);
3163 }
3164 }
3165}
3166
3167void GetCharacters(CScriptArray* array) {
3168 for (auto& movement_object : the_scenegraph->movement_objects_) {

Callers

nothing calls this directly

Calls 6

GetSphereCollisionsMethod · 0.80
IsObjectSaneMethod · 0.80
sizeMethod · 0.45
GetTypeMethod · 0.45
GetIDMethod · 0.45
InsertLastMethod · 0.45

Tested by

no test coverage detected