MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / update_grid

Method update_grid

modules/gridmap/editor/grid_map_editor_plugin.cpp:1064–1080  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1062}
1063
1064void GridMapEditor::update_grid() {
1065 grid_xform.origin.x -= 1; /// @todo Force update in hackish way.
1066
1067 grid_ofs[edit_axis] = edit_floor[edit_axis] * node->get_cell_size()[edit_axis];
1068
1069 // If there's a valid tile cursor, offset the grid, otherwise move it back to the node.
1070 edit_grid_xform.origin = cursor_instance.is_valid() ? grid_ofs : Vector3();
1071 edit_grid_xform.basis = Basis();
1072
1073 for (int i = 0; i < 3; i++) {
1074 RenderingServer::get_singleton()->instance_set_visible(grid_instance[i], i == edit_axis);
1075 }
1076
1077 updating = true;
1078 floor->set_value(edit_floor[edit_axis]);
1079 updating = false;
1080}
1081
1082void GridMapEditor::_draw_grids(const Vector3 &cell_size) {
1083 Vector3 edited_floor = node->get_meta("_editor_floor_", Vector3());

Callers

nothing calls this directly

Calls 6

instance_set_visibleMethod · 0.80
Vector3Class · 0.50
BasisClass · 0.50
get_cell_sizeMethod · 0.45
is_validMethod · 0.45
set_valueMethod · 0.45

Tested by

no test coverage detected