Expose VoxelTool.is_area_editable()
This commit is contained in:
parent
d848da3a6f
commit
e30a3f51d6
@ -265,6 +265,8 @@ void VoxelTool::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("raycast", "origin", "direction", "max_distance", "collision_mask"),
|
ClassDB::bind_method(D_METHOD("raycast", "origin", "direction", "max_distance", "collision_mask"),
|
||||||
&VoxelTool::_b_raycast, DEFVAL(10.0), DEFVAL(0xffffffff));
|
&VoxelTool::_b_raycast, DEFVAL(10.0), DEFVAL(0xffffffff));
|
||||||
|
|
||||||
|
ClassDB::bind_method(D_METHOD("is_area_editable", "box"), &VoxelTool::_b_is_area_editable);
|
||||||
|
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "value"), "set_value", "get_value");
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "value"), "set_value", "get_value");
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "channel", PROPERTY_HINT_ENUM, VoxelBuffer::CHANNEL_ID_HINT_STRING), "set_channel", "get_channel");
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "channel", PROPERTY_HINT_ENUM, VoxelBuffer::CHANNEL_ID_HINT_STRING), "set_channel", "get_channel");
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "eraser_value"), "set_eraser_value", "get_eraser_value");
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "eraser_value"), "set_eraser_value", "get_eraser_value");
|
||||||
|
@ -97,6 +97,8 @@ private:
|
|||||||
Variant _b_get_voxel_metadata(Vector3 pos) { return get_voxel_metadata(Vector3i(pos)); }
|
Variant _b_get_voxel_metadata(Vector3 pos) { return get_voxel_metadata(Vector3i(pos)); }
|
||||||
void _b_set_voxel_metadata(Vector3 pos, Variant meta) { return set_voxel_metadata(Vector3i(pos), meta); }
|
void _b_set_voxel_metadata(Vector3 pos, Variant meta) { return set_voxel_metadata(Vector3i(pos), meta); }
|
||||||
|
|
||||||
|
bool _b_is_area_editable(AABB box) { return is_area_editable(Rect3i(box.position, box.size)); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint64_t _value = 0;
|
uint64_t _value = 0;
|
||||||
uint64_t _eraser_value = 0; // air
|
uint64_t _eraser_value = 0; // air
|
||||||
|
Loading…
x
Reference in New Issue
Block a user