Rename VoxelBlock.pos => position

This commit is contained in:
Marc Gilleron 2019-05-25 15:50:01 +01:00
parent 15ae1b99ba
commit 75cffa7d59
5 changed files with 8 additions and 8 deletions

View File

@ -7,7 +7,7 @@ VoxelBlock *VoxelBlock::create(Vector3i bpos, Ref<VoxelBuffer> buffer, unsigned
ERR_FAIL_COND_V(buffer->get_size() != Vector3i(bs, bs, bs), NULL);
VoxelBlock *block = memnew(VoxelBlock);
block->pos = bpos;
block->position = bpos;
block->lod_index = p_lod_index;
block->_position_in_voxels = bpos * (size << p_lod_index);
block->voxels = buffer;

View File

@ -17,7 +17,7 @@ public:
};
Ref<VoxelBuffer> voxels;
Vector3i pos; // TODO Rename position
Vector3i position; // TODO Rename position
unsigned int lod_index = 0;
static VoxelBlock *create(Vector3i bpos, Ref<VoxelBuffer> buffer, unsigned int size, unsigned int p_lod_index);

View File

@ -361,9 +361,9 @@ bool VoxelLodTerrain::check_block_loaded_and_updated(const Vector3i &p_bpos, uns
if (!block->has_been_meshed()) {
if (!block->is_mesh_update_scheduled()) {
if (lod.map->is_block_surrounded(block->pos)) {
if (lod.map->is_block_surrounded(block->position)) {
lod.blocks_pending_update.push_back(block->pos);
lod.blocks_pending_update.push_back(block->position);
block->set_mesh_state(VoxelBlock::MESH_UPDATE_NOT_SENT);
} else {

View File

@ -105,7 +105,7 @@ int VoxelMap::get_default_voxel(unsigned int channel) {
}
VoxelBlock *VoxelMap::get_block(Vector3i bpos) {
if (_last_accessed_block && _last_accessed_block->pos == bpos) {
if (_last_accessed_block && _last_accessed_block->position == bpos) {
return _last_accessed_block;
}
VoxelBlock **p = _blocks.getptr(bpos);
@ -118,7 +118,7 @@ VoxelBlock *VoxelMap::get_block(Vector3i bpos) {
}
const VoxelBlock *VoxelMap::get_block(Vector3i bpos) const {
if (_last_accessed_block && _last_accessed_block->pos == bpos) {
if (_last_accessed_block && _last_accessed_block->position == bpos) {
return _last_accessed_block;
}
const VoxelBlock *const *p = _blocks.getptr(bpos);
@ -132,7 +132,7 @@ const VoxelBlock *VoxelMap::get_block(Vector3i bpos) const {
void VoxelMap::set_block(Vector3i bpos, VoxelBlock *block) {
ERR_FAIL_COND(block == NULL);
if (_last_accessed_block == NULL || _last_accessed_block->pos == bpos) {
if (_last_accessed_block == NULL || _last_accessed_block->position == bpos) {
_last_accessed_block = block;
}
_blocks.set(bpos, block);

View File

@ -68,7 +68,7 @@ public:
template <typename Action_T>
void remove_block(Vector3i bpos, Action_T pre_delete) {
if (_last_accessed_block && _last_accessed_block->pos == bpos)
if (_last_accessed_block && _last_accessed_block->position == bpos)
_last_accessed_block = NULL;
VoxelBlock **pptr = _blocks.getptr(bpos);
if (pptr) {