Namespaced godot utility funcs
This commit is contained in:
parent
4ced432a3c
commit
0fee995c0f
@ -4,6 +4,8 @@
|
||||
|
||||
namespace VoxImportUtils {
|
||||
|
||||
using namespace zylann;
|
||||
|
||||
static void scale_surface(Array &surface, float scale) {
|
||||
PackedVector3Array positions = surface[Mesh::ARRAY_VERTEX];
|
||||
// Avoiding stupid CoW, assuming this array holds the only instance of this vector
|
||||
|
@ -2,6 +2,8 @@
|
||||
#include "../storage/voxel_buffer.h"
|
||||
#include "../util/godot/funcs.h"
|
||||
|
||||
using namespace zylann;
|
||||
|
||||
Ref<Mesh> VoxelMesher::build_mesh(Ref<VoxelBuffer> voxels, Array materials) {
|
||||
ERR_FAIL_COND_V(voxels.is_null(), Ref<ArrayMesh>());
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
#include <core/io/image.h>
|
||||
|
||||
using namespace zylann;
|
||||
|
||||
const char *VoxelBuffer::CHANNEL_ID_HINT_STRING = "Type,Sdf,Color,Indices,Weights,Data5,Data6,Data7";
|
||||
|
||||
VoxelBuffer::VoxelBuffer() {
|
||||
|
@ -7,6 +7,8 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
using namespace zylann;
|
||||
|
||||
VoxelDataMap::VoxelDataMap() {
|
||||
// TODO Make it configurable in editor (with all necessary notifications and updatings!)
|
||||
set_block_size_pow2(VoxelConstants::DEFAULT_BLOCK_SIZE_PO2);
|
||||
|
@ -838,7 +838,7 @@ void VoxelStreamSQLite::load_all_blocks(FullLoadingResult &result) {
|
||||
result_block.lod = location.lod;
|
||||
|
||||
if (voxel_data.size() > 0) {
|
||||
std::shared_ptr<VoxelBufferInternal> voxels = gd_make_shared<VoxelBufferInternal>();
|
||||
std::shared_ptr<VoxelBufferInternal> voxels = zylann::gd_make_shared<VoxelBufferInternal>();
|
||||
ERR_FAIL_COND(!ctx->stream._voxel_block_serializer.decompress_and_deserialize(voxel_data, *voxels));
|
||||
result_block.voxels = voxels;
|
||||
}
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace zylann;
|
||||
|
||||
VoxelInstancer::VoxelInstancer() {
|
||||
set_notify_transform(true);
|
||||
set_process_internal(true);
|
||||
|
@ -3,6 +3,8 @@
|
||||
#include "../meshers/cubes/voxel_mesher_cubes.h"
|
||||
#include "../util/godot/funcs.h"
|
||||
|
||||
using namespace zylann;
|
||||
|
||||
static AABB expand_with_vector(AABB box, Vector3 v) {
|
||||
if (v.x > 0) {
|
||||
box.size.x += v.x;
|
||||
|
@ -8,6 +8,8 @@
|
||||
#include <scene/3d/node_3d.h>
|
||||
#include <scene/resources/concave_polygon_shape_3d.h>
|
||||
|
||||
using namespace zylann;
|
||||
|
||||
VoxelMeshBlock *VoxelMeshBlock::create(Vector3i bpos, unsigned int size, unsigned int p_lod_index) {
|
||||
VoxelMeshBlock *block = memnew(VoxelMeshBlock);
|
||||
block->position = bpos;
|
||||
|
@ -8,6 +8,8 @@
|
||||
#include <scene/resources/mesh.h>
|
||||
#include <scene/resources/multimesh.h>
|
||||
|
||||
namespace zylann {
|
||||
|
||||
bool is_surface_triangulated(Array surface) {
|
||||
PackedVector3Array positions = surface[Mesh::ARRAY_VERTEX];
|
||||
PackedInt32Array indices = surface[Mesh::ARRAY_INDEX];
|
||||
@ -252,3 +254,5 @@ void set_nodes_owner_except_root(Node *root, Node *owner) {
|
||||
set_nodes_owner(root->get_child(i), owner);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace zylann
|
||||
|
@ -10,6 +10,8 @@ class ConcavePolygonShape3D;
|
||||
class MultiMesh;
|
||||
class Node;
|
||||
|
||||
namespace zylann {
|
||||
|
||||
bool is_surface_triangulated(Array surface);
|
||||
bool is_mesh_empty(Ref<Mesh> mesh_ref);
|
||||
|
||||
@ -66,4 +68,6 @@ template <typename T> struct RefHasher {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace zylann
|
||||
|
||||
#endif // VOXEL_UTILITY_GODOT_FUNCS_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user