mirror of
https://github.com/Relintai/godot_voxel.git
synced 2025-03-11 21:53:24 +01:00
Moved is_mesh_empty() to utility.h
This commit is contained in:
parent
d1c21bdf5d
commit
c80a24ef0b
@ -525,17 +525,6 @@ static void remove_positions_outside_box(
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool is_mesh_empty(Ref<Mesh> mesh_ref) {
|
||||
if (mesh_ref.is_null())
|
||||
return true;
|
||||
const Mesh &mesh = **mesh_ref;
|
||||
if (mesh.get_surface_count() == 0)
|
||||
return true;
|
||||
if (mesh.surface_get_array_len(0) == 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void VoxelTerrain::_process() {
|
||||
|
||||
// TODO Should be able to run without library, tho!
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <core/pool_vector.h>
|
||||
#include <core/ustring.h>
|
||||
#include <core/vector.h>
|
||||
#include <scene/resources/mesh.h>
|
||||
#include <vector>
|
||||
|
||||
// Takes elements starting from a given position and moves them at the beginning,
|
||||
@ -79,4 +80,15 @@ inline float max(const float &a, const float &b) {
|
||||
return a > b ? a : b;
|
||||
}
|
||||
|
||||
inline bool is_mesh_empty(Ref<Mesh> mesh_ref) {
|
||||
if (mesh_ref.is_null())
|
||||
return true;
|
||||
const Mesh &mesh = **mesh_ref;
|
||||
if (mesh.get_surface_count() == 0)
|
||||
return true;
|
||||
if (mesh.surface_get_array_len(0) == 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // HEADER_VOXEL_UTILITY_H
|
||||
|
Loading…
Reference in New Issue
Block a user