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

rvo2: Sync with upstream commit bfc0486

bfc048670a
This commit is contained in:
Rémi Verschelde
2022-05-18 14:53:52 +02:00
parent 6c78170d8c
commit 86cdf1f2cf
10 changed files with 92 additions and 167 deletions

View File

@@ -8,7 +8,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,7 +27,7 @@
* Chapel Hill, N.C. 27599-3175
* United States of America
*
* <http://gamma.cs.unc.edu/RVO2/>
* <https://gamma.cs.unc.edu/RVO2/>
*/
#include "KdTree.h"
@@ -38,7 +38,7 @@
#include "Definitions.h"
namespace RVO {
const size_t RVO_MAX_LEAF_SIZE = 10;
const size_t RVO3D_MAX_LEAF_SIZE = 10;
KdTree::KdTree() { }
@@ -68,7 +68,7 @@ namespace RVO {
agentTree_[node].minCoord[2] = std::min(agentTree_[node].minCoord[2], agents_[i]->position_.z());
}
if (end - begin > RVO_MAX_LEAF_SIZE) {
if (end - begin > RVO3D_MAX_LEAF_SIZE) {
/* No leaf node. */
size_t coord;
@@ -127,7 +127,7 @@ namespace RVO {
void KdTree::queryAgentTreeRecursive(Agent *agent, float &rangeSq, size_t node) const
{
if (agentTree_[node].end - agentTree_[node].begin <= RVO_MAX_LEAF_SIZE) {
if (agentTree_[node].end - agentTree_[node].begin <= RVO3D_MAX_LEAF_SIZE) {
for (size_t i = agentTree_[node].begin; i < agentTree_[node].end; ++i) {
agent->insertAgentNeighbor(agents_[i], rangeSq);
}