Rename VoxelBlock.pos => position
This commit is contained in:
parent
15ae1b99ba
commit
75cffa7d59
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user