/**************************************************************************/ /* dynamic_bvh.cpp */ /**************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /**************************************************************************/ /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ #include "dynamic_bvh.h" void DynamicBVH::_delete_node(Node *p_node) { … } void DynamicBVH::_recurse_delete_node(Node *p_node) { … } DynamicBVH::Node *DynamicBVH::_create_node(Node *p_parent, void *p_data) { … } DynamicBVH::Node *DynamicBVH::_create_node_with_volume(Node *p_parent, const Volume &p_volume, void *p_data) { … } void DynamicBVH::_insert_leaf(Node *p_root, Node *p_leaf) { … } DynamicBVH::Node *DynamicBVH::_remove_leaf(Node *leaf) { … } void DynamicBVH::_fetch_leaves(Node *p_root, LocalVector<Node *> &r_leaves, int p_depth) { … } // Partitions leaves such that leaves[0, n) are on the // left of axis, and leaves[n, count) are on the right // of axis. returns N. int DynamicBVH::_split(Node **leaves, int p_count, const Vector3 &p_org, const Vector3 &p_axis) { … } DynamicBVH::Volume DynamicBVH::_bounds(Node **leaves, int p_count) { … } void DynamicBVH::_bottom_up(Node **leaves, int p_count) { … } DynamicBVH::Node *DynamicBVH::_top_down(Node **leaves, int p_count, int p_bu_threshold) { … } DynamicBVH::Node *DynamicBVH::_node_sort(Node *n, Node *&r) { … } void DynamicBVH::clear() { … } void DynamicBVH::optimize_bottom_up() { … } void DynamicBVH::optimize_top_down(int bu_threshold) { … } void DynamicBVH::optimize_incremental(int passes) { … } DynamicBVH::ID DynamicBVH::insert(const AABB &p_box, void *p_userdata) { … } void DynamicBVH::_update(Node *leaf, int lookahead) { … } bool DynamicBVH::update(const ID &p_id, const AABB &p_box) { … } void DynamicBVH::remove(const ID &p_id) { … } void DynamicBVH::_extract_leaves(Node *p_node, List<ID> *r_elements) { … } void DynamicBVH::set_index(uint32_t p_index) { … } uint32_t DynamicBVH::get_index() const { … } void DynamicBVH::get_elements(List<ID> *r_elements) { … } int DynamicBVH::get_leaf_count() const { … } int DynamicBVH::get_max_depth() const { … } DynamicBVH::~DynamicBVH() { … }