summaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-01-21 12:25:29 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-01-23 11:02:20 +0100
commit5b1df48c6c62e2ddc6492d4c210b3281f87b4031 (patch)
treedd4452683a1cbe61a215096cc788368965528da3 /core/math
parent35c37ce4ce5d1559ae4548ebb2c0c7286cb90a3d (diff)
Convert en_GB spelling to en_US with codespell
Diffstat (limited to 'core/math')
-rw-r--r--core/math/a_star.cpp26
-rw-r--r--core/math/a_star.h2
-rw-r--r--core/math/a_star_grid_2d.cpp2
-rw-r--r--core/math/bvh_abb.h2
-rw-r--r--core/math/bvh_split.inc8
-rw-r--r--core/math/color.cpp2
6 files changed, 21 insertions, 21 deletions
diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp
index 9bfe46727b..646bdea758 100644
--- a/core/math/a_star.cpp
+++ b/core/math/a_star.cpp
@@ -106,11 +106,11 @@ void AStar3D::remove_point(int64_t p_id) {
bool p_exists = points.lookup(p_id, p);
ERR_FAIL_COND_MSG(!p_exists, vformat("Can't remove point. Point with id: %d doesn't exist.", p_id));
- for (OAHashMap<int64_t, Point *>::Iterator it = p->neighbours.iter(); it.valid; it = p->neighbours.next_iter(it)) {
+ for (OAHashMap<int64_t, Point *>::Iterator it = p->neighbors.iter(); it.valid; it = p->neighbors.next_iter(it)) {
Segment s(p_id, (*it.key));
segments.erase(s);
- (*it.value)->neighbours.remove(p->id);
+ (*it.value)->neighbors.remove(p->id);
(*it.value)->unlinked_neighbours.remove(p->id);
}
@@ -118,7 +118,7 @@ void AStar3D::remove_point(int64_t p_id) {
Segment s(p_id, (*it.key));
segments.erase(s);
- (*it.value)->neighbours.remove(p->id);
+ (*it.value)->neighbors.remove(p->id);
(*it.value)->unlinked_neighbours.remove(p->id);
}
@@ -138,10 +138,10 @@ void AStar3D::connect_points(int64_t p_id, int64_t p_with_id, bool bidirectional
bool to_exists = points.lookup(p_with_id, b);
ERR_FAIL_COND_MSG(!to_exists, vformat("Can't connect points. Point with id: %d doesn't exist.", p_with_id));
- a->neighbours.set(b->id, b);
+ a->neighbors.set(b->id, b);
if (bidirectional) {
- b->neighbours.set(a->id, a);
+ b->neighbors.set(a->id, a);
} else {
b->unlinked_neighbours.set(a->id, a);
}
@@ -155,7 +155,7 @@ void AStar3D::connect_points(int64_t p_id, int64_t p_with_id, bool bidirectional
if (element) {
s.direction |= element->direction;
if (s.direction == Segment::BIDIRECTIONAL) {
- // Both are neighbours of each other now
+ // Both are neighbors of each other now
a->unlinked_neighbours.remove(b->id);
b->unlinked_neighbours.remove(a->id);
}
@@ -183,9 +183,9 @@ void AStar3D::disconnect_points(int64_t p_id, int64_t p_with_id, bool bidirectio
// Erase the directions to be removed
s.direction = (element->direction & ~remove_direction);
- a->neighbours.remove(b->id);
+ a->neighbors.remove(b->id);
if (bidirectional) {
- b->neighbours.remove(a->id);
+ b->neighbors.remove(a->id);
if (element->direction != Segment::BIDIRECTIONAL) {
a->unlinked_neighbours.remove(b->id);
b->unlinked_neighbours.remove(a->id);
@@ -226,7 +226,7 @@ Vector<int64_t> AStar3D::get_point_connections(int64_t p_id) {
Vector<int64_t> point_list;
- for (OAHashMap<int64_t, Point *>::Iterator it = p->neighbours.iter(); it.valid; it = p->neighbours.next_iter(it)) {
+ for (OAHashMap<int64_t, Point *>::Iterator it = p->neighbors.iter(); it.valid; it = p->neighbors.next_iter(it)) {
point_list.push_back((*it.key));
}
@@ -346,8 +346,8 @@ bool AStar3D::_solve(Point *begin_point, Point *end_point) {
open_list.remove_at(open_list.size() - 1);
p->closed_pass = pass; // Mark the point as closed
- for (OAHashMap<int64_t, Point *>::Iterator it = p->neighbours.iter(); it.valid; it = p->neighbours.next_iter(it)) {
- Point *e = *(it.value); // The neighbour point
+ for (OAHashMap<int64_t, Point *>::Iterator it = p->neighbors.iter(); it.valid; it = p->neighbors.next_iter(it)) {
+ Point *e = *(it.value); // The neighbor point
if (!e->enabled || e->closed_pass == pass) {
continue;
@@ -813,8 +813,8 @@ bool AStar2D::_solve(AStar3D::Point *begin_point, AStar3D::Point *end_point) {
open_list.remove_at(open_list.size() - 1);
p->closed_pass = astar.pass; // Mark the point as closed.
- for (OAHashMap<int64_t, AStar3D::Point *>::Iterator it = p->neighbours.iter(); it.valid; it = p->neighbours.next_iter(it)) {
- AStar3D::Point *e = *(it.value); // The neighbour point.
+ for (OAHashMap<int64_t, AStar3D::Point *>::Iterator it = p->neighbors.iter(); it.valid; it = p->neighbors.next_iter(it)) {
+ AStar3D::Point *e = *(it.value); // The neighbor point.
if (!e->enabled || e->closed_pass == astar.pass) {
continue;
diff --git a/core/math/a_star.h b/core/math/a_star.h
index a475e4f2fc..fc4bb09f03 100644
--- a/core/math/a_star.h
+++ b/core/math/a_star.h
@@ -52,7 +52,7 @@ class AStar3D : public RefCounted {
real_t weight_scale = 0;
bool enabled = false;
- OAHashMap<int64_t, Point *> neighbours = 4u;
+ OAHashMap<int64_t, Point *> neighbors = 4u;
OAHashMap<int64_t, Point *> unlinked_neighbours = 4u;
// Used for pathfinding.
diff --git a/core/math/a_star_grid_2d.cpp b/core/math/a_star_grid_2d.cpp
index 30d50073d7..677e609763 100644
--- a/core/math/a_star_grid_2d.cpp
+++ b/core/math/a_star_grid_2d.cpp
@@ -401,7 +401,7 @@ bool AStarGrid2D::_solve(Point *p_begin_point, Point *p_end_point) {
List<Point *> nbors;
_get_nbors(p, nbors);
for (List<Point *>::Element *E = nbors.front(); E; E = E->next()) {
- Point *e = E->get(); // The neighbour point.
+ Point *e = E->get(); // The neighbor point.
real_t weight_scale = 1.0;
if (jumping_enabled) {
diff --git a/core/math/bvh_abb.h b/core/math/bvh_abb.h
index 32b011bd3b..fb0207e0bd 100644
--- a/core/math/bvh_abb.h
+++ b/core/math/bvh_abb.h
@@ -87,7 +87,7 @@ struct BVH_ABB {
return -neg_max - min;
}
- POINT calculate_centre() const {
+ POINT calculate_center() const {
return POINT((calculate_size() * 0.5) + min);
}
diff --git a/core/math/bvh_split.inc b/core/math/bvh_split.inc
index 180bbfb511..875abedb70 100644
--- a/core/math/bvh_split.inc
+++ b/core/math/bvh_split.inc
@@ -25,7 +25,7 @@ void _split_leaf_sort_groups_simple(int &num_a, int &num_b, uint16_t *group_a, u
return;
}
- POINT centre = full_bound.calculate_centre();
+ POINT center = full_bound.calculate_center();
POINT size = full_bound.calculate_size();
int order[POINT::AXIS_COUNT];
@@ -43,7 +43,7 @@ void _split_leaf_sort_groups_simple(int &num_a, int &num_b, uint16_t *group_a, u
for (int a = 0; a < num_a; a++) {
uint32_t ind = group_a[a];
- if (temp_bounds[ind].min.coord[split_axis] > centre.coord[split_axis]) {
+ if (temp_bounds[ind].min.coord[split_axis] > center.coord[split_axis]) {
// add to b
group_b[num_b++] = ind;
@@ -75,7 +75,7 @@ void _split_leaf_sort_groups_simple(int &num_a, int &num_b, uint16_t *group_a, u
for (int a = 0; a < num_a; a++) {
uint32_t ind = group_a[a];
- if (temp_bounds[ind].min.coord[split_axis] > centre.coord[split_axis]) {
+ if (temp_bounds[ind].min.coord[split_axis] > center.coord[split_axis]) {
count++;
}
}
@@ -100,7 +100,7 @@ void _split_leaf_sort_groups_simple(int &num_a, int &num_b, uint16_t *group_a, u
for (int a = 0; a < num_a; a++) {
uint32_t ind = group_a[a];
- if (temp_bounds[ind].min.coord[split_axis] > centre.coord[split_axis]) {
+ if (temp_bounds[ind].min.coord[split_axis] > center.coord[split_axis]) {
// add to b
group_b[num_b++] = ind;
diff --git a/core/math/color.cpp b/core/math/color.cpp
index 5bae8d25d6..3e5fa7b402 100644
--- a/core/math/color.cpp
+++ b/core/math/color.cpp
@@ -194,7 +194,7 @@ void Color::set_hsv(float p_h, float p_s, float p_v, float p_alpha) {
a = p_alpha;
if (p_s == 0.0f) {
- // Achromatic (grey)
+ // Achromatic (gray)
r = g = b = p_v;
return;
}