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

Method get_cell_item

modules/gridmap/grid_map.cpp:437–451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435}
436
437int GridMap::get_cell_item(const Vector3i &p_position) const {
438 ERR_FAIL_INDEX_V(Math::abs(p_position.x), 1 << 20, INVALID_CELL_ITEM);
439 ERR_FAIL_INDEX_V(Math::abs(p_position.y), 1 << 20, INVALID_CELL_ITEM);
440 ERR_FAIL_INDEX_V(Math::abs(p_position.z), 1 << 20, INVALID_CELL_ITEM);
441
442 IndexKey key;
443 key.x = p_position.x;
444 key.y = p_position.y;
445 key.z = p_position.z;
446
447 if (!cell_map.has(key)) {
448 return INVALID_CELL_ITEM;
449 }
450 return cell_map[key].item;
451}
452
453int GridMap::get_cell_item_orientation(const Vector3i &p_position) const {
454 ERR_FAIL_INDEX_V(Math::abs(p_position.x), 1 << 20, -1);

Callers 8

_menu_optionMethod · 0.80
_get_selected_cellsMethod · 0.80
do_input_actionMethod · 0.80
_delete_selectionMethod · 0.80
_fill_selectionMethod · 0.80
_set_clipboard_dataMethod · 0.80
_do_pasteMethod · 0.80

Calls 2

absFunction · 0.50
hasMethod · 0.45

Tested by

no test coverage detected