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

BVH broadphase creates objects with updated AABB to avoid extra checks

When set_static is called on a newly added object, the forced collision
check in BVH set_pairable was using an empty AABB, which caused
unnecessary collision checks at the origin, then a call to move was
checking again at the right position.

These changes ensure broadphase objects are added to the BVH tree with
proper AABB so collision checks are correctly done right away.

Octree & Basic broadphase trees are not affected by these changes.
This commit is contained in:
PouleyKetchoupp
2021-01-19 11:59:58 -07:00
parent 2fa93d8514
commit 10868e76e6
8 changed files with 16 additions and 18 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) {
BroadPhaseSW::ID BroadPhaseBasic::create(CollisionObjectSW *p_object, int p_subindex, const AABB &p_aabb) {
ERR_FAIL_COND_V(p_object == NULL, 0);