summaryrefslogtreecommitdiff
path: root/modules/gridmap
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2020-10-17 01:08:21 -0400
committerAaron Franke <arnfranke@yahoo.com>2021-06-03 07:30:01 -0400
commitde3f6699a5192153e9882a62b58b9ca6cd82ee2d (patch)
tree7cee99845cc6bf2db8a48f7776efb046c7990a67 /modules/gridmap
parentb80494e6331bdfbfd3c754aa225fa2a5105fb917 (diff)
Rename Transform to Transform3D in core
Diffstat (limited to 'modules/gridmap')
-rw-r--r--modules/gridmap/grid_map.cpp21
-rw-r--r--modules/gridmap/grid_map.h6
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp18
-rw-r--r--modules/gridmap/grid_map_editor_plugin.h6
4 files changed, 25 insertions, 26 deletions
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index eaceaac33c..45af59622f 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -446,7 +446,7 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
* and set said multimesh bounding box to one containing all cells which have this item
*/
- Map<int, List<Pair<Transform, IndexKey>>> multimesh_items;
+ Map<int, List<Pair<Transform3D, IndexKey>>> multimesh_items;
for (Set<IndexKey>::Element *E = g.cells.front(); E; E = E->next()) {
ERR_CONTINUE(!cell_map.has(E->get()));
@@ -459,7 +459,7 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
Vector3 cellpos = Vector3(E->get().x, E->get().y, E->get().z);
Vector3 ofs = _get_offset();
- Transform xform;
+ Transform3D xform;
xform.basis.set_orthogonal_index(c.rot);
xform.set_origin(cellpos * cell_size + ofs);
@@ -467,10 +467,10 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
if (baked_meshes.size() == 0) {
if (mesh_library->get_item_mesh(c.item).is_valid()) {
if (!multimesh_items.has(c.item)) {
- multimesh_items[c.item] = List<Pair<Transform, IndexKey>>();
+ multimesh_items[c.item] = List<Pair<Transform3D, IndexKey>>();
}
- Pair<Transform, IndexKey> p;
+ Pair<Transform3D, IndexKey> p;
p.first = xform;
p.second = E->get();
multimesh_items[c.item].push_back(p);
@@ -511,7 +511,7 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
//update multimeshes, only if not baked
if (baked_meshes.size() == 0) {
- for (Map<int, List<Pair<Transform, IndexKey>>>::Element *E = multimesh_items.front(); E; E = E->next()) {
+ for (Map<int, List<Pair<Transform3D, IndexKey>>>::Element *E = multimesh_items.front(); E; E = E->next()) {
Octant::MultimeshInstance mmi;
RID mm = RS::get_singleton()->multimesh_create();
@@ -519,7 +519,7 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
RS::get_singleton()->multimesh_set_mesh(mm, mesh_library->get_item_mesh(E->key())->get_rid());
int idx = 0;
- for (List<Pair<Transform, IndexKey>>::Element *F = E->get().front(); F; F = F->next()) {
+ for (List<Pair<Transform3D, IndexKey>>::Element *F = E->get().front(); F; F = F->next()) {
RS::get_singleton()->multimesh_instance_set_transform(mm, idx, F->get().first);
#ifdef TOOLS_ENABLED
@@ -672,7 +672,7 @@ void GridMap::_notification(int p_what) {
} break;
case NOTIFICATION_TRANSFORM_CHANGED: {
- Transform new_xform = get_global_transform();
+ Transform3D new_xform = get_global_transform();
if (new_xform == last_transform) {
break;
}
@@ -686,7 +686,6 @@ void GridMap::_notification(int p_what) {
for (int i = 0; i < baked_meshes.size(); i++) {
RS::get_singleton()->instance_set_transform(baked_meshes[i].instance, get_global_transform());
}
-
} break;
case NOTIFICATION_EXIT_WORLD: {
for (Map<OctantKey, Octant *>::Element *E = octant_map.front(); E; E = E->next()) {
@@ -934,7 +933,7 @@ Array GridMap::get_meshes() {
Vector3 cellpos = Vector3(ik.x, ik.y, ik.z);
- Transform xform;
+ Transform3D xform;
xform.basis.set_orthogonal_index(E->get().rot);
@@ -988,7 +987,7 @@ void GridMap::make_baked_meshes(bool p_gen_lightmap_uv, float p_lightmap_uv_texe
Vector3 cellpos = Vector3(key.x, key.y, key.z);
Vector3 ofs = _get_offset();
- Transform xform;
+ Transform3D xform;
xform.basis.set_orthogonal_index(E->get().rot);
xform.set_origin(cellpos * cell_size + ofs);
@@ -1057,7 +1056,7 @@ Array GridMap::get_bake_meshes() {
Array arr;
for (int i = 0; i < baked_meshes.size(); i++) {
arr.push_back(baked_meshes[i].mesh);
- arr.push_back(Transform());
+ arr.push_back(Transform3D());
}
return arr;
diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h
index 4c04d492f7..8cd82e1f4c 100644
--- a/modules/gridmap/grid_map.h
+++ b/modules/gridmap/grid_map.h
@@ -89,7 +89,7 @@ class GridMap : public Node3D {
struct Octant {
struct NavMesh {
RID region;
- Transform xform;
+ Transform3D xform;
};
struct MultimeshInstance {
@@ -97,7 +97,7 @@ class GridMap : public Node3D {
RID multimesh;
struct Item {
int index = 0;
- Transform transform;
+ Transform3D transform;
IndexKey key;
};
@@ -137,7 +137,7 @@ class GridMap : public Node3D {
bool bake_navigation = false;
uint32_t navigation_layers = 1;
- Transform last_transform;
+ Transform3D last_transform;
bool _in_tree = false;
Vector3 cell_size = Vector3(2, 2, 2);
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index 813b4b9689..a47ed6652d 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -255,7 +255,7 @@ void GridMapEditor::_menu_option(int p_option) {
}
void GridMapEditor::_update_cursor_transform() {
- cursor_transform = Transform();
+ cursor_transform = Transform3D();
cursor_transform.origin = cursor_origin;
cursor_transform.basis.set_orthogonal_index(cursor_rot);
cursor_transform.basis *= node->get_cell_scale();
@@ -268,7 +268,7 @@ void GridMapEditor::_update_cursor_transform() {
}
void GridMapEditor::_update_selection_transform() {
- Transform xf_zero;
+ Transform3D xf_zero;
xf_zero.basis.set_zero();
if (!selection.active) {
@@ -279,7 +279,7 @@ void GridMapEditor::_update_selection_transform() {
return;
}
- Transform xf;
+ Transform3D xf;
xf.scale((Vector3(1, 1, 1) + (selection.end - selection.begin)) * node->get_cell_size());
xf.origin = selection.begin * node->get_cell_size();
@@ -297,7 +297,7 @@ void GridMapEditor::_update_selection_transform() {
scale *= node->get_cell_size();
position *= node->get_cell_size();
- Transform xf2;
+ Transform3D xf2;
xf2.basis.scale(scale);
xf2.origin = position;
@@ -362,7 +362,7 @@ bool GridMapEditor::do_input_action(Camera3D *p_camera, const Point2 &p_point, b
Camera3D *camera = p_camera;
Vector3 from = camera->project_ray_origin(p_point);
Vector3 normal = camera->project_ray_normal(p_point);
- Transform local_xform = node->get_global_transform().affine_inverse();
+ Transform3D local_xform = node->get_global_transform().affine_inverse();
Vector<Plane> planes = camera->get_frustum();
from = local_xform.xform(from);
normal = local_xform.basis.xform(normal).normalized();
@@ -540,7 +540,7 @@ void GridMapEditor::_set_clipboard_data() {
void GridMapEditor::_update_paste_indicator() {
if (input_action != INPUT_PASTE) {
- Transform xf;
+ Transform3D xf;
xf.basis.set_zero();
RenderingServer::get_singleton()->instance_set_transform(paste_instance, xf);
return;
@@ -548,7 +548,7 @@ void GridMapEditor::_update_paste_indicator() {
Vector3 center = 0.5 * Vector3(real_t(node->get_center_x()), real_t(node->get_center_y()), real_t(node->get_center_z()));
Vector3 scale = (Vector3(1, 1, 1) + (paste_indicator.end - paste_indicator.begin)) * node->get_cell_size();
- Transform xf;
+ Transform3D xf;
xf.scale(scale);
xf.origin = (paste_indicator.begin + (paste_indicator.current - paste_indicator.click) + center) * node->get_cell_size();
Basis rot;
@@ -561,7 +561,7 @@ void GridMapEditor::_update_paste_indicator() {
for (List<ClipboardItem>::Element *E = clipboard_items.front(); E; E = E->next()) {
ClipboardItem &item = E->get();
- xf = Transform();
+ xf = Transform3D();
xf.origin = (paste_indicator.begin + (paste_indicator.current - paste_indicator.click) + center) * node->get_cell_size();
xf.basis = rot * xf.basis;
xf.translate(item.grid_offset * node->get_cell_size());
@@ -1068,7 +1068,7 @@ void GridMapEditor::_notification(int p_what) {
return;
}
- Transform xf = node->get_global_transform();
+ Transform3D xf = node->get_global_transform();
if (xf != grid_xform) {
for (int i = 0; i < 3; i++) {
diff --git a/modules/gridmap/grid_map_editor_plugin.h b/modules/gridmap/grid_map_editor_plugin.h
index 6c7f0bedf6..0e29c88d26 100644
--- a/modules/gridmap/grid_map_editor_plugin.h
+++ b/modules/gridmap/grid_map_editor_plugin.h
@@ -95,8 +95,8 @@ class GridMapEditor : public VBoxContainer {
ClipMode clip_mode = CLIP_DISABLED;
bool lock_view = false;
- Transform grid_xform;
- Transform edit_grid_xform;
+ Transform3D grid_xform;
+ Transform3D edit_grid_xform;
Vector3::Axis edit_axis;
int edit_floor[3];
Vector3 grid_ofs;
@@ -146,7 +146,7 @@ class GridMapEditor : public VBoxContainer {
PasteIndicator paste_indicator;
bool cursor_visible = false;
- Transform cursor_transform;
+ Transform3D cursor_transform;
Vector3 cursor_origin;