1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Fixed unnecessary bvh tree updates when calling set_pairable

Dynamic BVH doesn't update the tree anymore when calling set_pairable
with no parameter change.

Also modified Godot Physics broadphase to create objects directly with
pairable (static) set correctly to make use of this optimization for the
BVH broadphase.

Note: Octree broadphase doesn't use this optimization because it forces
an update on move, so passing the proper AABB and static parameters on
creation would cause the tree to update twice.
This commit is contained in:
PouleyKetchoupp
2021-04-30 11:45:41 -07:00
parent de3168ffa3
commit 0dacc681b6
11 changed files with 30 additions and 24 deletions

View File

@@ -32,7 +32,7 @@
#include "core/list.h"
#include "core/print_string.h"
BroadPhaseSW::ID BroadPhaseBasic::create(CollisionObjectSW *p_object, int p_subindex, const AABB &p_aabb) {
BroadPhaseSW::ID BroadPhaseBasic::create(CollisionObjectSW *p_object, int p_subindex, const AABB &p_aabb, bool p_static) {
ERR_FAIL_COND_V(p_object == nullptr, 0);
current++;