Work on uv mapping.

This commit is contained in:
Relintai 2019-06-09 20:59:54 +02:00
parent 71de54d9a0
commit d7b949e8b8
2 changed files with 36 additions and 0 deletions

View File

@ -188,4 +188,12 @@ void VoxelSurface::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_voxel_name", "name"), &VoxelSurface::set_voxel_name);
ClassDB::bind_method(D_METHOD("get_voxel_name"), &VoxelSurface::get_voxel_name);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "voxel_name"), "set_name", "get_name");
BIND_ENUM_CONSTANT(VOXEL_SIDE_TOP);
BIND_ENUM_CONSTANT(VOXEL_SIDE_BOTTOM);
BIND_ENUM_CONSTANT(VOXEL_SIDE_LEFT);
BIND_ENUM_CONSTANT(VOXEL_SIDE_FRONT);
BIND_ENUM_CONSTANT(VOXEL_SIDE_RIGHT);
BIND_ENUM_CONSTANT(VOXEL_SIDE_BACK);
BIND_ENUM_CONSTANT(VOXEL_SIDES_COUNT);
}

View File

@ -14,6 +14,32 @@ class VoxelSurface : public Resource {
GDCLASS(VoxelSurface, Resource)
public:
/*
_____
/_____/I
I I I <- BACK
I F I I
I_____I/
I y
I I
O----- x I B
/ I F I /
/ z+ I ---I/
*/
enum VoxelSurfaceSides {
VOXEL_SIDE_TOP = 1 << 0,
VOXEL_SIDE_BOTTOM = 1 << 1,
VOXEL_SIDE_LEFT = 1 << 2,
VOXEL_SIDE_FRONT = 1 << 3,
VOXEL_SIDE_RIGHT = 1 << 4,
VOXEL_SIDE_BACK = 1 << 5,
VOXEL_SIDES_COUNT = 6,
};
int get_id() const;
void set_id(int value);
@ -92,4 +118,6 @@ private:
bool _is_transparent;
};
VARIANT_ENUM_CAST(VoxelSurface::VoxelSurfaceSides);
#endif