Added get_size() as Vector3 to VoxelBuffer

This commit is contained in:
Marc Gilleron 2019-04-27 02:06:09 +01:00
parent 10c2e69a0c
commit 6d872160ab
2 changed files with 2 additions and 0 deletions

View File

@ -287,6 +287,7 @@ void VoxelBuffer::_bind_methods() {
ClassDB::bind_method(D_METHOD("create", "sx", "sy", "sz"), &VoxelBuffer::create); ClassDB::bind_method(D_METHOD("create", "sx", "sy", "sz"), &VoxelBuffer::create);
ClassDB::bind_method(D_METHOD("clear"), &VoxelBuffer::clear); ClassDB::bind_method(D_METHOD("clear"), &VoxelBuffer::clear);
ClassDB::bind_method(D_METHOD("get_size"), &VoxelBuffer::_get_size_binding);
ClassDB::bind_method(D_METHOD("get_size_x"), &VoxelBuffer::get_size_x); ClassDB::bind_method(D_METHOD("get_size_x"), &VoxelBuffer::get_size_x);
ClassDB::bind_method(D_METHOD("get_size_y"), &VoxelBuffer::get_size_y); ClassDB::bind_method(D_METHOD("get_size_y"), &VoxelBuffer::get_size_y);
ClassDB::bind_method(D_METHOD("get_size_z"), &VoxelBuffer::get_size_z); ClassDB::bind_method(D_METHOD("get_size_z"), &VoxelBuffer::get_size_z);

View File

@ -112,6 +112,7 @@ protected:
_FORCE_INLINE_ int get_size_x() const { return _size.x; } _FORCE_INLINE_ int get_size_x() const { return _size.x; }
_FORCE_INLINE_ int get_size_y() const { return _size.y; } _FORCE_INLINE_ int get_size_y() const { return _size.y; }
_FORCE_INLINE_ int get_size_z() const { return _size.z; } _FORCE_INLINE_ int get_size_z() const { return _size.z; }
_FORCE_INLINE_ Vector3 _get_size_binding() const { return _size.to_vec3(); }
_FORCE_INLINE_ int _get_voxel_binding(int x, int y, int z, unsigned int channel) const { return get_voxel(x, y, z, channel); } _FORCE_INLINE_ int _get_voxel_binding(int x, int y, int z, unsigned int channel) const { return get_voxel(x, y, z, channel); }
_FORCE_INLINE_ void _set_voxel_binding(int value, int x, int y, int z, unsigned int channel) { set_voxel(value, x, y, z, channel); } _FORCE_INLINE_ void _set_voxel_binding(int value, int x, int y, int z, unsigned int channel) { set_voxel(value, x, y, z, channel); }