From 6d872160abb1a44c96d17901f2489bdaa8940382 Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Sat, 27 Apr 2019 02:06:09 +0100 Subject: [PATCH] Added get_size() as Vector3 to VoxelBuffer --- voxel_buffer.cpp | 1 + voxel_buffer.h | 1 + 2 files changed, 2 insertions(+) diff --git a/voxel_buffer.cpp b/voxel_buffer.cpp index aceb6c4..3c94c03 100644 --- a/voxel_buffer.cpp +++ b/voxel_buffer.cpp @@ -287,6 +287,7 @@ void VoxelBuffer::_bind_methods() { ClassDB::bind_method(D_METHOD("create", "sx", "sy", "sz"), &VoxelBuffer::create); 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_y"), &VoxelBuffer::get_size_y); ClassDB::bind_method(D_METHOD("get_size_z"), &VoxelBuffer::get_size_z); diff --git a/voxel_buffer.h b/voxel_buffer.h index b068029..cb681a8 100644 --- a/voxel_buffer.h +++ b/voxel_buffer.h @@ -112,6 +112,7 @@ protected: _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_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_ void _set_voxel_binding(int value, int x, int y, int z, unsigned int channel) { set_voxel(value, x, y, z, channel); }