瀏覽代碼

Merge pull request #59896 from akien-mga/dynamicbvh-crash

Rémi Verschelde 3 年之前
父節點
當前提交
3ffe7004dd
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      core/math/dynamic_bvh.h

+ 5 - 2
core/math/dynamic_bvh.h

@@ -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;