mirror of
https://github.com/Relintai/godot_voxel.git
synced 2025-05-09 00:11:34 +02: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() {
|
void VoxelTerrain::_process() {
|
||||||
|
|
||||||
// TODO Should be able to run without library, tho!
|
// TODO Should be able to run without library, tho!
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <core/pool_vector.h>
|
#include <core/pool_vector.h>
|
||||||
#include <core/ustring.h>
|
#include <core/ustring.h>
|
||||||
#include <core/vector.h>
|
#include <core/vector.h>
|
||||||
|
#include <scene/resources/mesh.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
// Takes elements starting from a given position and moves them at the beginning,
|
// 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;
|
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
|
#endif // HEADER_VOXEL_UTILITY_H
|
||||||
|
Loading…
Reference in New Issue
Block a user