This commit is contained in:
Marc Gilleron 2021-07-25 20:37:47 +01:00
parent 27d54a0d5c
commit 466bc41ab8
3 changed files with 7 additions and 2 deletions

View File

@ -9,7 +9,7 @@
class VoxelLibrary;
// TODO Rename VoxelModel?
// TODO Rename VoxelModel? Or VoxelBlockyLibraryItem?
// Definition of one type of voxel for use with `VoxelMesherBlocky`.
// A voxel can be a simple coloured cube, or a more complex model.
// Important: it is recommended that you create voxels from a library rather than using new().

View File

@ -5,6 +5,9 @@
#include "voxel.h"
#include <core/resource.h>
// TODO Rename VoxelBlockyLibrary
// Stores a list of models that can be used with VoxelMesherBlocky
class VoxelLibrary : public Resource {
GDCLASS(VoxelLibrary, Resource)

View File

@ -19,7 +19,7 @@ struct VoxelInstanceBlockData {
// Scale is uniform and is lossy-compressed to 256 values
// - uint8_t scale;
//
// Rotation is a compressed quaternion
// Rotation is a compressed quaternion with naive quantization of its members to 256 values
// - uint8_t x;
// - uint8_t y;
// - uint8_t z;
@ -28,10 +28,12 @@ struct VoxelInstanceBlockData {
};
static const int POSITION_RESOLUTION = 65536;
// Because position is quantized we need its range, but it cannot be zero so it may be clamped to this.
static const float POSITION_RANGE_MINIMUM;
static const int SIMPLE_11B_V1_SCALE_RESOLUTION = 256;
static const int SIMPLE_11B_V1_QUAT_RESOLUTION = 256;
// Because scale is quantized we need its range, but it cannot be zero so it may be clamped to this.
static const float SIMPLE_11B_V1_SCALE_RANGE_MINIMUM;
struct LayerData {