MCPcopy Create free account
hub / github.com/crownengine/crown / remove

Function remove

src/world/render_world.cpp:106–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 }
105
106 static void remove(CullingSet &set, CullableType::Enum type, u32 object_id)
107 {
108 u32 ind = find_object(set, type, object_id);
109 if (ind == UINT32_MAX)
110 return;
111
112 u32 last = array::size(set.id) - 1;
113
114 set.id[ind] = set.id[last];
115 set.type[ind] = set.type[last];
116 set.visible[ind] = set.visible[last];
117 set.sphere_w[ind] = set.sphere_w[last];
118
119 array::pop_back(set.id);
120 array::pop_back(set.type);
121 array::pop_back(set.visible);
122 array::pop_back(set.sphere_w);
123 }
124
125 // Fix culling set indices when an instance at index inst is destroyed and the last instance is
126 // moved into its slot.

Callers 15

camera_destroyMethod · 0.70
destroy_guiMethod · 0.70
destroy_levelMethod · 0.70
destroyFunction · 0.70
collider_destroyMethod · 0.70
actor_destroyMethod · 0.70
mover_destroyMethod · 0.70
joint_destroyMethod · 0.70
destroyMethod · 0.70
destroyMethod · 0.70
offlineMethod · 0.70
fixupFunction · 0.70

Calls 2

find_objectFunction · 0.85
sizeFunction · 0.50

Tested by 2

test_hash_mapFunction · 0.40
test_hash_setFunction · 0.40