BVH - Fix area-area collision regression
Minimal approach to fixing regression whereby static areas where not detect dynamic areas.
This commit is contained in:
parent
6ca309e058
commit
036bace9e9
2 changed files with 4 additions and 4 deletions
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
BroadPhaseSW::ID BroadPhaseBVH::create(CollisionObjectSW *p_object, int p_subindex, const AABB &p_aabb, bool p_static) {
|
BroadPhaseSW::ID BroadPhaseBVH::create(CollisionObjectSW *p_object, int p_subindex, const AABB &p_aabb, bool p_static) {
|
||||||
uint32_t tree_id = p_static ? TREE_STATIC : TREE_DYNAMIC;
|
uint32_t tree_id = p_static ? TREE_STATIC : TREE_DYNAMIC;
|
||||||
uint32_t tree_collision_mask = p_static ? 0 : (TREE_FLAG_STATIC | TREE_FLAG_DYNAMIC);
|
uint32_t tree_collision_mask = p_static ? TREE_FLAG_DYNAMIC : (TREE_FLAG_STATIC | TREE_FLAG_DYNAMIC);
|
||||||
ID oid = bvh.create(p_object, true, tree_id, tree_collision_mask, p_aabb, p_subindex); // Pair everything, don't care?
|
ID oid = bvh.create(p_object, true, tree_id, tree_collision_mask, p_aabb, p_subindex); // Pair everything, don't care?
|
||||||
return oid + 1;
|
return oid + 1;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ void BroadPhaseBVH::recheck_pairs(ID p_id) {
|
||||||
|
|
||||||
void BroadPhaseBVH::set_static(ID p_id, bool p_static) {
|
void BroadPhaseBVH::set_static(ID p_id, bool p_static) {
|
||||||
uint32_t tree_id = p_static ? TREE_STATIC : TREE_DYNAMIC;
|
uint32_t tree_id = p_static ? TREE_STATIC : TREE_DYNAMIC;
|
||||||
uint32_t tree_collision_mask = p_static ? 0 : (TREE_FLAG_STATIC | TREE_FLAG_DYNAMIC);
|
uint32_t tree_collision_mask = p_static ? TREE_FLAG_DYNAMIC : (TREE_FLAG_STATIC | TREE_FLAG_DYNAMIC);
|
||||||
bvh.set_tree(p_id - 1, tree_id, tree_collision_mask, false);
|
bvh.set_tree(p_id - 1, tree_id, tree_collision_mask, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
BroadPhase2DSW::ID BroadPhase2DBVH::create(CollisionObject2DSW *p_object, int p_subindex, const Rect2 &p_aabb, bool p_static) {
|
BroadPhase2DSW::ID BroadPhase2DBVH::create(CollisionObject2DSW *p_object, int p_subindex, const Rect2 &p_aabb, bool p_static) {
|
||||||
uint32_t tree_id = p_static ? TREE_STATIC : TREE_DYNAMIC;
|
uint32_t tree_id = p_static ? TREE_STATIC : TREE_DYNAMIC;
|
||||||
uint32_t tree_collision_mask = p_static ? 0 : (TREE_FLAG_STATIC | TREE_FLAG_DYNAMIC);
|
uint32_t tree_collision_mask = p_static ? TREE_FLAG_DYNAMIC : (TREE_FLAG_STATIC | TREE_FLAG_DYNAMIC);
|
||||||
ID oid = bvh.create(p_object, true, tree_id, tree_collision_mask, p_aabb, p_subindex); // Pair everything, don't care?
|
ID oid = bvh.create(p_object, true, tree_id, tree_collision_mask, p_aabb, p_subindex); // Pair everything, don't care?
|
||||||
return oid + 1;
|
return oid + 1;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ void BroadPhase2DBVH::recheck_pairs(ID p_id) {
|
||||||
|
|
||||||
void BroadPhase2DBVH::set_static(ID p_id, bool p_static) {
|
void BroadPhase2DBVH::set_static(ID p_id, bool p_static) {
|
||||||
uint32_t tree_id = p_static ? TREE_STATIC : TREE_DYNAMIC;
|
uint32_t tree_id = p_static ? TREE_STATIC : TREE_DYNAMIC;
|
||||||
uint32_t tree_collision_mask = p_static ? 0 : (TREE_FLAG_STATIC | TREE_FLAG_DYNAMIC);
|
uint32_t tree_collision_mask = p_static ? TREE_FLAG_DYNAMIC : (TREE_FLAG_STATIC | TREE_FLAG_DYNAMIC);
|
||||||
bvh.set_tree(p_id - 1, tree_id, tree_collision_mask, false);
|
bvh.set_tree(p_id - 1, tree_id, tree_collision_mask, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue