Skip to content

Commit

Permalink
Merge pull request #44901 from lawnjelly/bvh3
Browse files Browse the repository at this point in the history
Dynamic BVH for rendering and godot physics [3.2]
  • Loading branch information
akien-mga authored Jan 12, 2021
2 parents 0a8cc0a + 690e07b commit d92f4c7
Show file tree
Hide file tree
Showing 23 changed files with 3,647 additions and 38 deletions.
13 changes: 13 additions & 0 deletions core/local_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ class LocalVector {
}
}

// Removes the item copying the last value into the position of the one to
// remove. It's generally faster than `remove`.
void remove_unordered(U p_index) {
ERR_FAIL_INDEX(p_index, count);
count--;
if (count > p_index) {
data[p_index] = data[count];
}
if (!__has_trivial_destructor(T) && !force_trivial) {
data[count].~T();
}
}

void erase(const T &p_val) {
int64_t idx = find(p_val);
if (idx >= 0) {
Expand Down
Loading

0 comments on commit d92f4c7

Please sign in to comment.