mirror of
https://github.com/godotengine/godot
synced 2024-09-05 05:18:29 +00:00
Fix DynamicBVH crash after #59867
I made a wrong assumption that initialization the other pointer in the union would properly initialize the `childs` array.
This commit is contained in:
parent
af2c8fbcb6
commit
099b024a2b
|
@ -183,7 +183,7 @@ private:
|
|||
Node *parent = nullptr;
|
||||
union {
|
||||
Node *childs[2];
|
||||
void *data = nullptr;
|
||||
void *data;
|
||||
};
|
||||
|
||||
_FORCE_INLINE_ bool is_leaf() const { return childs[1] == nullptr; }
|
||||
|
@ -215,7 +215,10 @@ private:
|
|||
return axis.dot(volume.get_center() - org) <= 0;
|
||||
}
|
||||
|
||||
Node() {}
|
||||
Node() {
|
||||
childs[0] = nullptr;
|
||||
childs[1] = nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
PagedAllocator<Node> node_allocator;
|
||||
|
|
Loading…
Reference in a new issue