Clang format.

This commit is contained in:
Relintai 2020-01-09 04:29:05 +01:00
parent b559329212
commit a67d0393ca
47 changed files with 426 additions and 464 deletions

View File

@ -28,10 +28,10 @@ void WorldArea::set_name(const String value) {
_name = value; _name = value;
} }
int WorldArea::get_level() const { int WorldArea::get_level() const {
return _level; return _level;
} }
void WorldArea::set_level(const int level) { void WorldArea::set_level(const int level) {
_level = level; _level = level;
} }
@ -45,7 +45,7 @@ WorldArea::~WorldArea() {
void WorldArea::_bind_methods() { void WorldArea::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_aabb"), &WorldArea::get_aabb); ClassDB::bind_method(D_METHOD("get_aabb"), &WorldArea::get_aabb);
ClassDB::bind_method(D_METHOD("set_aabb"), &WorldArea::set_aabb); ClassDB::bind_method(D_METHOD("set_aabb"), &WorldArea::set_aabb);
ADD_PROPERTY(PropertyInfo(Variant::AABB, "aabb"), "set_aabb", "get_aabb"); ADD_PROPERTY(PropertyInfo(Variant::AABB, "aabb"), "set_aabb", "get_aabb");
ClassDB::bind_method(D_METHOD("get_map_texture"), &WorldArea::get_map_texture); ClassDB::bind_method(D_METHOD("get_map_texture"), &WorldArea::get_map_texture);
ClassDB::bind_method(D_METHOD("set_map_texture"), &WorldArea::set_map_texture); ClassDB::bind_method(D_METHOD("set_map_texture"), &WorldArea::set_map_texture);

View File

@ -3,8 +3,8 @@
#include "core/reference.h" #include "core/reference.h"
#include "core/ustring.h"
#include "core/math/aabb.h" #include "core/math/aabb.h"
#include "core/ustring.h"
#include "scene/resources/texture.h" #include "scene/resources/texture.h"
class WorldArea : public Reference { class WorldArea : public Reference {

View File

@ -3,8 +3,8 @@
#include "core/resource.h" #include "core/resource.h"
#include "../meshers/voxel_mesher.h"
#include "../../texture_packer/texture_packer.h" #include "../../texture_packer/texture_packer.h"
#include "../meshers/voxel_mesher.h"
class VoxelChunk; class VoxelChunk;
class VoxelMesher; class VoxelMesher;

View File

@ -2,142 +2,142 @@
/// VMQUeue /// VMQUeue
template<typename T> template <typename T>
void VMQueue<T>::enqueue(T obj) { void VMQueue<T>::enqueue(T obj) {
_lock->write_lock(); _lock->write_lock();
if (_size == _count) { if (_size == _count) {
_resize(_size + 10); _resize(_size + 10);
} }
_items[(_head + _count) % _size] = obj; _items[(_head + _count) % _size] = obj;
++_count; ++_count;
_lock->write_unlock(); _lock->write_unlock();
} }
template<typename T> template <typename T>
T VMQueue<T>::dequeue() { T VMQueue<T>::dequeue() {
if (_size == 0) if (_size == 0)
return T(); return T();
if (_count == 0) if (_count == 0)
return T(); return T();
T obj; T obj;
_lock->write_lock(); _lock->write_lock();
obj = _items[_head]; obj = _items[_head];
_items[_head] = T(); _items[_head] = T();
++_head; ++_head;
--_count; --_count;
if (_head >= _size) if (_head >= _size)
_head -= _size; _head -= _size;
_lock->write_unlock(); _lock->write_unlock();
return obj; return obj;
} }
template<typename T> template <typename T>
T VMQueue<T>::peek() { T VMQueue<T>::peek() {
T obj; T obj;
_lock->read_lock(); _lock->read_lock();
obj = _items[_head]; obj = _items[_head];
_lock->read_unlock(); _lock->read_unlock();
return obj; return obj;
} }
template<typename T> template <typename T>
void VMQueue<T>::resize(int new_size) { void VMQueue<T>::resize(int new_size) {
_lock->write_lock(); _lock->write_lock();
_resize(new_size); _resize(new_size);
_lock->write_unlock(); _lock->write_unlock();
} }
template<typename T> template <typename T>
void VMQueue<T>::_resize(int new_size) { void VMQueue<T>::_resize(int new_size) {
if (new_size == _size) if (new_size == _size)
return; return;
if (new_size > _size) { if (new_size > _size) {
T *narr = memnew_arr(T, new_size); T *narr = memnew_arr(T, new_size);
//copymem(narr, _items, sizeof(T) * _size); //copymem(narr, _items, sizeof(T) * _size);
for (int i = 0; i < _size; ++i) { for (int i = 0; i < _size; ++i) {
narr[i] = _items[i]; narr[i] = _items[i];
} }
memdelete_arr(_items); memdelete_arr(_items);
_items = narr; _items = narr;
_size = new_size; _size = new_size;
return; return;
} }
} }
template<typename T> template <typename T>
VMQueue<T>::VMQueue(int initial_size) { VMQueue<T>::VMQueue(int initial_size) {
_items = NULL; _items = NULL;
_head = 0; _head = 0;
_count = 0; _count = 0;
_size = initial_size; _size = initial_size;
if (unlikely(initial_size <= 0)) { if (unlikely(initial_size <= 0)) {
_size = 10; _size = 10;
print_error("initial_size <= 0");
}
_lock = RWLock::create(); print_error("initial_size <= 0");
}
_items = memnew_arr(T, _size); _lock = RWLock::create();
_items = memnew_arr(T, _size);
} }
template<typename T> template <typename T>
VMQueue<T>::VMQueue() { VMQueue<T>::VMQueue() {
_items = NULL; _items = NULL;
_head = 0; _head = 0;
_count = 0; _count = 0;
_size = 10; _size = 10;
_lock = RWLock::create(); _lock = RWLock::create();
_items = memnew_arr(T, _size); _items = memnew_arr(T, _size);
} }
template<typename T> template <typename T>
VMQueue<T>::~VMQueue() { VMQueue<T>::~VMQueue() {
if (_items) if (_items)
memdelete_arr(_items); memdelete_arr(_items);
memdelete(_lock); memdelete(_lock);
} }
///VoxelmanQueue ///VoxelmanQueue
void VoxelmanQueue::enqueue(Variant obj) { void VoxelmanQueue::enqueue(Variant obj) {
_queue.enqueue(obj); _queue.enqueue(obj);
} }
Variant VoxelmanQueue::dequeue() { Variant VoxelmanQueue::dequeue() {
return _queue.dequeue(); return _queue.dequeue();
} }
Variant VoxelmanQueue::peek() { Variant VoxelmanQueue::peek() {
return _queue.peek(); return _queue.peek();
} }
void VoxelmanQueue::resize(int new_size) { void VoxelmanQueue::resize(int new_size) {
_queue.resize(new_size); _queue.resize(new_size);
} }
VoxelmanQueue::VoxelmanQueue() { VoxelmanQueue::VoxelmanQueue() {
@ -147,8 +147,8 @@ VoxelmanQueue::~VoxelmanQueue() {
} }
void VoxelmanQueue::_bind_methods() { void VoxelmanQueue::_bind_methods() {
ClassDB::bind_method(D_METHOD("enqueue", "obj"), &VoxelmanQueue::enqueue); ClassDB::bind_method(D_METHOD("enqueue", "obj"), &VoxelmanQueue::enqueue);
ClassDB::bind_method(D_METHOD("dequeue"), &VoxelmanQueue::dequeue); ClassDB::bind_method(D_METHOD("dequeue"), &VoxelmanQueue::dequeue);
ClassDB::bind_method(D_METHOD("peek"), &VoxelmanQueue::peek); ClassDB::bind_method(D_METHOD("peek"), &VoxelmanQueue::peek);
ClassDB::bind_method(D_METHOD("resize", "new_size"), &VoxelmanQueue::resize); ClassDB::bind_method(D_METHOD("resize", "new_size"), &VoxelmanQueue::resize);
} }

View File

@ -8,50 +8,50 @@
#include "core/os/rw_lock.h" #include "core/os/rw_lock.h"
#include "core/variant.h" #include "core/variant.h"
template<class T> template <class T>
class VMQueue { class VMQueue {
public: public:
void enqueue(T obj); void enqueue(T obj);
T dequeue(); T dequeue();
T peek(); T peek();
void resize(int new_size); void resize(int new_size);
VMQueue(int initial_size); VMQueue(int initial_size);
VMQueue(); VMQueue();
~VMQueue(); ~VMQueue();
protected: protected:
void _resize(int new_size); void _resize(int new_size);
private: private:
RWLock *_lock; RWLock *_lock;
int _head; int _head;
int _count; int _count;
int _size; int _size;
T *_items; T *_items;
}; };
class VoxelmanQueue : public Reference { class VoxelmanQueue : public Reference {
GDCLASS(VoxelmanQueue, Reference); GDCLASS(VoxelmanQueue, Reference);
public: public:
void enqueue(Variant obj); void enqueue(Variant obj);
Variant dequeue(); Variant dequeue();
Variant peek(); Variant peek();
void resize(int new_size); void resize(int new_size);
VoxelmanQueue(); VoxelmanQueue();
~VoxelmanQueue(); ~VoxelmanQueue();
protected: protected:
static void _bind_methods(); static void _bind_methods();
private: private:
VMQueue<Variant> _queue; VMQueue<Variant> _queue;
}; };
#endif #endif

View File

@ -2,81 +2,81 @@
/// VMQUeue /// VMQUeue
template<typename T> template <typename T>
void VMUBQueue<T>::enqueue(T obj) { void VMUBQueue<T>::enqueue(T obj) {
_enqueue_lock->write_lock(); _enqueue_lock->write_lock();
UBQueueNode<T> *n = memnew(UBQueueNode<T>(obj)); UBQueueNode<T> *n = memnew(UBQueueNode<T>(obj));
_tail->next = n; _tail->next = n;
_tail = n; _tail = n;
_enqueue_lock->write_unlock(); _enqueue_lock->write_unlock();
} }
template<typename T> template <typename T>
T VMUBQueue<T>::dequeue() { T VMUBQueue<T>::dequeue() {
T result; T result;
_dequeue_lock->write_lock(); _dequeue_lock->write_lock();
if (_head->next == NULL) { if (_head->next == NULL) {
return result; return result;
} }
result = _head->next->data; result = _head->next->data;
UBQueueNode<T> *h = _head;
_head = _head->next; UBQueueNode<T> *h = _head;
memdelete(h); _head = _head->next;
_dequeue_lock->write_unlock(); memdelete(h);
return result; _dequeue_lock->write_unlock();
return result;
} }
template<typename T> template <typename T>
T VMUBQueue<T>::peek() { T VMUBQueue<T>::peek() {
return _head->data; return _head->data;
} }
template<typename T> template <typename T>
VMUBQueue<T>::VMUBQueue() { VMUBQueue<T>::VMUBQueue() {
_head = memnew(UBQueueNode<T>); _head = memnew(UBQueueNode<T>);
_tail = _head; _tail = _head;
_enqueue_lock = RWLock::create(); _enqueue_lock = RWLock::create();
_dequeue_lock = RWLock::create(); _dequeue_lock = RWLock::create();
} }
template<typename T> template <typename T>
VMUBQueue<T>::~VMUBQueue() { VMUBQueue<T>::~VMUBQueue() {
memdelete(_enqueue_lock); memdelete(_enqueue_lock);
memdelete(_dequeue_lock); memdelete(_dequeue_lock);
UBQueueNode<T> *h = _head; UBQueueNode<T> *h = _head;
while (h) { while (h) {
UBQueueNode<T> *n = h->next; UBQueueNode<T> *n = h->next;
memdelete(h); memdelete(h);
h = n; h = n;
} }
} }
///VoxelmanUnboundedQueue ///VoxelmanUnboundedQueue
void VoxelmanUnboundedQueue::enqueue(Variant obj) { void VoxelmanUnboundedQueue::enqueue(Variant obj) {
_queue.enqueue(obj); _queue.enqueue(obj);
} }
Variant VoxelmanUnboundedQueue::dequeue() { Variant VoxelmanUnboundedQueue::dequeue() {
return _queue.dequeue(); return _queue.dequeue();
} }
Variant VoxelmanUnboundedQueue::peek() { Variant VoxelmanUnboundedQueue::peek() {
return _queue.peek(); return _queue.peek();
} }
VoxelmanUnboundedQueue::VoxelmanUnboundedQueue() { VoxelmanUnboundedQueue::VoxelmanUnboundedQueue() {
@ -86,7 +86,7 @@ VoxelmanUnboundedQueue::~VoxelmanUnboundedQueue() {
} }
void VoxelmanUnboundedQueue::_bind_methods() { void VoxelmanUnboundedQueue::_bind_methods() {
ClassDB::bind_method(D_METHOD("enqueue", "obj"), &VoxelmanUnboundedQueue::enqueue); ClassDB::bind_method(D_METHOD("enqueue", "obj"), &VoxelmanUnboundedQueue::enqueue);
ClassDB::bind_method(D_METHOD("dequeue"), &VoxelmanUnboundedQueue::dequeue); ClassDB::bind_method(D_METHOD("dequeue"), &VoxelmanUnboundedQueue::dequeue);
ClassDB::bind_method(D_METHOD("peek"), &VoxelmanUnboundedQueue::peek); ClassDB::bind_method(D_METHOD("peek"), &VoxelmanUnboundedQueue::peek);
} }

View File

@ -8,56 +8,56 @@
#include "core/os/rw_lock.h" #include "core/os/rw_lock.h"
#include "core/variant.h" #include "core/variant.h"
template<class T> template <class T>
struct UBQueueNode { struct UBQueueNode {
T data; T data;
UBQueueNode *next; UBQueueNode *next;
UBQueueNode() { UBQueueNode() {
next = NULL; next = NULL;
} }
UBQueueNode(T value) { UBQueueNode(T value) {
data = value; data = value;
next = NULL; next = NULL;
} }
}; };
template<class T> template <class T>
class VMUBQueue { class VMUBQueue {
public: public:
void enqueue(T obj); void enqueue(T obj);
T dequeue(); T dequeue();
T peek(); T peek();
VMUBQueue(); VMUBQueue();
~VMUBQueue(); ~VMUBQueue();
private: private:
RWLock *_enqueue_lock; RWLock *_enqueue_lock;
RWLock *_dequeue_lock; RWLock *_dequeue_lock;
UBQueueNode<T> *_head; UBQueueNode<T> *_head;
UBQueueNode<T> *_tail; UBQueueNode<T> *_tail;
}; };
class VoxelmanUnboundedQueue : public Reference { class VoxelmanUnboundedQueue : public Reference {
GDCLASS(VoxelmanUnboundedQueue, Reference); GDCLASS(VoxelmanUnboundedQueue, Reference);
public: public:
void enqueue(Variant obj); void enqueue(Variant obj);
Variant dequeue(); Variant dequeue();
Variant peek(); Variant peek();
VoxelmanUnboundedQueue(); VoxelmanUnboundedQueue();
~VoxelmanUnboundedQueue(); ~VoxelmanUnboundedQueue();
protected: protected:
static void _bind_methods(); static void _bind_methods();
private: private:
VMUBQueue<Variant> _queue; VMUBQueue<Variant> _queue;
}; };
#endif #endif

View File

@ -1,58 +1,55 @@
#include "voxel_light.h" #include "voxel_light.h"
_FORCE_INLINE_ int VoxelLight::get_world_position_x() const { _FORCE_INLINE_ int VoxelLight::get_world_position_x() const {
return _world_position_x; return _world_position_x;
} }
_FORCE_INLINE_ int VoxelLight::get_world_position_y() const { _FORCE_INLINE_ int VoxelLight::get_world_position_y() const {
return _world_position_y; return _world_position_y;
} }
_FORCE_INLINE_ int VoxelLight::get_world_position_z() const { _FORCE_INLINE_ int VoxelLight::get_world_position_z() const {
return _world_position_z; return _world_position_z;
} }
Vector3 VoxelLight::get_world_position() { Vector3 VoxelLight::get_world_position() {
return Vector3(_world_position_x, _world_position_y, _world_position_z); return Vector3(_world_position_x, _world_position_y, _world_position_z);
} }
void VoxelLight::set_world_position(const int x, const int y, const int z) { void VoxelLight::set_world_position(const int x, const int y, const int z) {
_world_position_x = x; _world_position_x = x;
_world_position_y = y; _world_position_y = y;
_world_position_z = z; _world_position_z = z;
} }
_FORCE_INLINE_ Color VoxelLight::get_color() const { _FORCE_INLINE_ Color VoxelLight::get_color() const {
return _color; return _color;
} }
void VoxelLight::set_color(Color color) { void VoxelLight::set_color(Color color) {
_color = color; _color = color;
} }
_FORCE_INLINE_ float VoxelLight::get_size() const { _FORCE_INLINE_ float VoxelLight::get_size() const {
return _size; return _size;
} }
void VoxelLight::set_size(const float size) { void VoxelLight::set_size(const float size) {
_size = size; _size = size;
} }
VoxelLight::VoxelLight() { VoxelLight::VoxelLight() {
_size = 0; _size = 0;
} }
VoxelLight::~VoxelLight() { VoxelLight::~VoxelLight() {
} }
void VoxelLight::_bind_methods() { void VoxelLight::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_world_position_x"), &VoxelLight::get_world_position_x); ClassDB::bind_method(D_METHOD("get_world_position_x"), &VoxelLight::get_world_position_x);
ClassDB::bind_method(D_METHOD("get_world_position_y"), &VoxelLight::get_world_position_y); ClassDB::bind_method(D_METHOD("get_world_position_y"), &VoxelLight::get_world_position_y);
ClassDB::bind_method(D_METHOD("get_world_position_z"), &VoxelLight::get_world_position_z); ClassDB::bind_method(D_METHOD("get_world_position_z"), &VoxelLight::get_world_position_z);
ClassDB::bind_method(D_METHOD("set_world_position", "x", "y", "z"), &VoxelLight::set_world_position); ClassDB::bind_method(D_METHOD("set_world_position", "x", "y", "z"), &VoxelLight::set_world_position);
ClassDB::bind_method(D_METHOD("get_color"), &VoxelLight::get_color); ClassDB::bind_method(D_METHOD("get_color"), &VoxelLight::get_color);
ClassDB::bind_method(D_METHOD("set_color"), &VoxelLight::set_color); ClassDB::bind_method(D_METHOD("set_color"), &VoxelLight::set_color);
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color");
ClassDB::bind_method(D_METHOD("get_size"), &VoxelLight::get_size); ClassDB::bind_method(D_METHOD("get_size"), &VoxelLight::get_size);
ClassDB::bind_method(D_METHOD("set_size"), &VoxelLight::set_size); ClassDB::bind_method(D_METHOD("set_size"), &VoxelLight::set_size);
ADD_PROPERTY(PropertyInfo(Variant::INT, "size"), "set_size", "get_size"); ADD_PROPERTY(PropertyInfo(Variant::INT, "size"), "set_size", "get_size");
} }

View File

@ -4,4 +4,4 @@
{% if not meta or meta.get('github_url') != 'hide' %} {% if not meta or meta.get('github_url') != 'hide' %}
{{ super() }} {{ super() }}
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "!layout.html" %} {% extends "!layout.html" %}
{% block linktags %} {% block linktags %}
{{ super() }} {{ super() }}
{% endblock %} {% endblock %}

View File

@ -3,12 +3,12 @@
#include "../world/voxel_chunk.h" #include "../world/voxel_chunk.h"
void VoxelmanLevelGenerator::generate_chunk_bind(Node *chunk) { void VoxelmanLevelGenerator::generate_chunk_bind(Node *chunk) {
generate_chunk(Object::cast_to<VoxelChunk>(chunk)); generate_chunk(Object::cast_to<VoxelChunk>(chunk));
} }
void VoxelmanLevelGenerator::generate_chunk(VoxelChunk *chunk) { void VoxelmanLevelGenerator::generate_chunk(VoxelChunk *chunk) {
if (has_method("_generate_chunk")) { if (has_method("_generate_chunk")) {
call("_generate_chunk", chunk); call("_generate_chunk", chunk);
} }
} }
VoxelmanLevelGenerator::VoxelmanLevelGenerator() { VoxelmanLevelGenerator::VoxelmanLevelGenerator() {
@ -18,7 +18,7 @@ VoxelmanLevelGenerator::~VoxelmanLevelGenerator() {
} }
void VoxelmanLevelGenerator::_bind_methods() { void VoxelmanLevelGenerator::_bind_methods() {
BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"))); BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk")));
ClassDB::bind_method(D_METHOD("generate_chunk", "chunk"), &VoxelmanLevelGenerator::generate_chunk_bind); ClassDB::bind_method(D_METHOD("generate_chunk", "chunk"), &VoxelmanLevelGenerator::generate_chunk_bind);
} }

View File

@ -17,8 +17,6 @@ public:
protected: protected:
static void _bind_methods(); static void _bind_methods();
}; };
#endif #endif

View File

@ -8,8 +8,8 @@
#include "core/vector.h" #include "core/vector.h"
#include "scene/resources/material.h" #include "scene/resources/material.h"
#include "voxelman_library.h"
#include "../clutter/ground_clutter.h" #include "../clutter/ground_clutter.h"
#include "voxelman_library.h"
class VoxelmanLibrary; class VoxelmanLibrary;
class GroundClutter; class GroundClutter;
@ -47,22 +47,22 @@ public:
int get_id() const; int get_id() const;
void set_id(const int value); void set_id(const int value);
bool is_transparent() const; bool is_transparent() const;
void set_transparent(const bool transparent); void set_transparent(const bool transparent);
Rect2 get_rect(const VoxelSurfaceSides side) const; Rect2 get_rect(const VoxelSurfaceSides side) const;
void set_rect(const VoxelSurfaceSides side, const Rect2 rect); void set_rect(const VoxelSurfaceSides side, const Rect2 rect);
Ref<GroundClutter> get_clutter(); Ref<GroundClutter> get_clutter();
void set_clutter(Ref<GroundClutter> clutter); void set_clutter(Ref<GroundClutter> clutter);
Ref<VoxelmanLibrary> get_library() const; Ref<VoxelmanLibrary> get_library() const;
void set_library(Ref<VoxelmanLibrary> library); void set_library(Ref<VoxelmanLibrary> library);
Vector2 transform_uv(const VoxelSurfaceSides side, const Vector2 uv) const; Vector2 transform_uv(const VoxelSurfaceSides side, const Vector2 uv) const;
virtual void refresh_rects(); virtual void refresh_rects();
VoxelSurface(); VoxelSurface();
~VoxelSurface(); ~VoxelSurface();

View File

@ -36,7 +36,7 @@ void VoxelSurfaceMerger::refresh_rects() {
} }
Rect2 region = at->get_region(); Rect2 region = at->get_region();
float w = tex->get_width(); float w = tex->get_width();
float h = tex->get_height(); float h = tex->get_height();
Rect2 r; Rect2 r;
@ -72,5 +72,4 @@ void VoxelSurfaceMerger::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "texture_top", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", VOXEL_SIDE_TOP); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "texture_top", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", VOXEL_SIDE_TOP);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "texture_bottom", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", VOXEL_SIDE_BOTTOM); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "texture_bottom", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", VOXEL_SIDE_BOTTOM);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "texture_side", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", VOXEL_SIDE_SIDE); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "texture_side", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", VOXEL_SIDE_SIDE);
} }

View File

@ -57,7 +57,7 @@ VoxelSurfaceSimple::~VoxelSurfaceSimple() {
void VoxelSurfaceSimple::_bind_methods() { void VoxelSurfaceSimple::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_atlas_x", "side"), &VoxelSurfaceSimple::get_atlas_x); ClassDB::bind_method(D_METHOD("get_atlas_x", "side"), &VoxelSurfaceSimple::get_atlas_x);
ClassDB::bind_method(D_METHOD("set_atlas_x", "side", "value"), &VoxelSurfaceSimple::set_atlas_x); ClassDB::bind_method(D_METHOD("set_atlas_x", "side", "value"), &VoxelSurfaceSimple::set_atlas_x);
ClassDB::bind_method(D_METHOD("get_atlas_y", "side"), &VoxelSurfaceSimple::get_atlas_y); ClassDB::bind_method(D_METHOD("get_atlas_y", "side"), &VoxelSurfaceSimple::get_atlas_y);
ClassDB::bind_method(D_METHOD("set_atlas_y", "side", "value"), &VoxelSurfaceSimple::set_atlas_y); ClassDB::bind_method(D_METHOD("set_atlas_y", "side", "value"), &VoxelSurfaceSimple::set_atlas_y);

View File

@ -317,7 +317,6 @@ void VoxelCubePoints::refresh_neighbours(VoxelChunk *chunk) {
_point_neighbours[P001] = neighbours; _point_neighbours[P001] = neighbours;
neighbours = 0; neighbours = 0;
x = _x + 1; x = _x + 1;
y = _y; y = _y;
@ -376,7 +375,6 @@ void VoxelCubePoints::refresh_neighbours(VoxelChunk *chunk) {
_point_neighbours[P011] = neighbours; _point_neighbours[P011] = neighbours;
neighbours = 0; neighbours = 0;
x = _x + 1; x = _x + 1;
y = _y + 1; y = _y + 1;
@ -444,7 +442,7 @@ void VoxelCubePoints::setup(VoxelChunk *chunk, int x, int y, int z, int size) {
_point_fills[P101] = chunk->get_voxel(x + size, y, z + size, VoxelChunk::DEFAULT_CHANNEL_ISOLEVEL); _point_fills[P101] = chunk->get_voxel(x + size, y, z + size, VoxelChunk::DEFAULT_CHANNEL_ISOLEVEL);
_point_fills[P111] = chunk->get_voxel(x + size, y + size, z + size, VoxelChunk::DEFAULT_CHANNEL_ISOLEVEL); _point_fills[P111] = chunk->get_voxel(x + size, y + size, z + size, VoxelChunk::DEFAULT_CHANNEL_ISOLEVEL);
_point_aos[P000] = chunk->get_voxel(x, y, z, VoxelChunk::DEFAULT_CHANNEL_AO); _point_aos[P000] = chunk->get_voxel(x, y, z, VoxelChunk::DEFAULT_CHANNEL_AO);
_point_aos[P100] = chunk->get_voxel(x + size, y, z, VoxelChunk::DEFAULT_CHANNEL_AO); _point_aos[P100] = chunk->get_voxel(x + size, y, z, VoxelChunk::DEFAULT_CHANNEL_AO);
_point_aos[P010] = chunk->get_voxel(x, y + size, z, VoxelChunk::DEFAULT_CHANNEL_AO); _point_aos[P010] = chunk->get_voxel(x, y + size, z, VoxelChunk::DEFAULT_CHANNEL_AO);
_point_aos[P001] = chunk->get_voxel(x, y, z + size, VoxelChunk::DEFAULT_CHANNEL_AO); _point_aos[P001] = chunk->get_voxel(x, y, z + size, VoxelChunk::DEFAULT_CHANNEL_AO);
@ -461,13 +459,12 @@ void VoxelCubePoints::setup(VoxelChunk *chunk, int x, int y, int z, int size) {
_point_colors[P011] = Color(chunk->get_voxel(x, y + size, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_R) / 255.0, chunk->get_voxel(x, y + size, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_G) / 255.0, chunk->get_voxel(x, y + size, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_B) / 255.0); _point_colors[P011] = Color(chunk->get_voxel(x, y + size, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_R) / 255.0, chunk->get_voxel(x, y + size, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_G) / 255.0, chunk->get_voxel(x, y + size, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_B) / 255.0);
_point_colors[P101] = Color(chunk->get_voxel(x + size, y, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_R) / 255.0, chunk->get_voxel(x + size, y, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_G) / 255.0, chunk->get_voxel(x + size, y, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_B) / 255.0); _point_colors[P101] = Color(chunk->get_voxel(x + size, y, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_R) / 255.0, chunk->get_voxel(x + size, y, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_G) / 255.0, chunk->get_voxel(x + size, y, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_B) / 255.0);
_point_colors[P111] = Color(chunk->get_voxel(x + size, y + size, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_R) / 255.0, chunk->get_voxel(x + size, y + size, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_G) / 255.0, chunk->get_voxel(x + size, y + size, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_B) / 255.0); _point_colors[P111] = Color(chunk->get_voxel(x + size, y + size, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_R) / 255.0, chunk->get_voxel(x + size, y + size, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_G) / 255.0, chunk->get_voxel(x + size, y + size, z + size, VoxelChunk::DEFAULT_CHANNEL_LIGHT_COLOR_B) / 255.0);
refresh_neighbours(chunk); refresh_neighbours(chunk);
refresh_points(); refresh_points();
} }
void VoxelCubePoints::reset() { void VoxelCubePoints::reset() {
for (int i = 0; i < POINT_COUNT; ++i) { for (int i = 0; i < POINT_COUNT; ++i) {
_point_types[i] = 0; _point_types[i] = 0;
@ -557,7 +554,6 @@ Vector3 VoxelCubePoints::get_vertex_vector3_for_point(int face, int index) {
vector.z -= num2; vector.z -= num2;
vector /= num; vector /= num;
return vector; return vector;
} }
@ -580,19 +576,19 @@ int VoxelCubePoints::get_point_neighbours(int index) {
} }
int VoxelCubePoints::get_point_ao(int index) { int VoxelCubePoints::get_point_ao(int index) {
ERR_FAIL_INDEX_V(index, POINT_COUNT, 0); ERR_FAIL_INDEX_V(index, POINT_COUNT, 0);
return _point_aos[index]; return _point_aos[index];
} }
int VoxelCubePoints::get_face_point_ao(int face, int index) { int VoxelCubePoints::get_face_point_ao(int face, int index) {
int indx = get_point_index(face, index); int indx = get_point_index(face, index);
return _point_aos[indx]; return _point_aos[indx];
} }
Color VoxelCubePoints::get_face_point_ao_color(int face, int index) { Color VoxelCubePoints::get_face_point_ao_color(int face, int index) {
int indx = get_point_index(face, index); int indx = get_point_index(face, index);
float ao_value = (_point_aos[indx] / 255.0) * 0.75; float ao_value = (_point_aos[indx] / 255.0) * 0.75;
@ -744,7 +740,6 @@ VoxelCubePoints::VoxelCubePoints() {
VoxelCubePoints::~VoxelCubePoints() { VoxelCubePoints::~VoxelCubePoints() {
} }
void VoxelCubePoints::_bind_methods() { void VoxelCubePoints::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_x"), &VoxelCubePoints::get_x); ClassDB::bind_method(D_METHOD("get_x"), &VoxelCubePoints::get_x);
@ -783,9 +778,9 @@ void VoxelCubePoints::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_point_type", "index"), &VoxelCubePoints::get_point_type); ClassDB::bind_method(D_METHOD("get_point_type", "index"), &VoxelCubePoints::get_point_type);
ClassDB::bind_method(D_METHOD("get_point_fill", "index"), &VoxelCubePoints::get_point_fill); ClassDB::bind_method(D_METHOD("get_point_fill", "index"), &VoxelCubePoints::get_point_fill);
ClassDB::bind_method(D_METHOD("get_point_neighbours", "index"), &VoxelCubePoints::get_point_neighbours); ClassDB::bind_method(D_METHOD("get_point_neighbours", "index"), &VoxelCubePoints::get_point_neighbours);
ClassDB::bind_method(D_METHOD("get_point_ao", "index"), &VoxelCubePoints::get_point_ao); ClassDB::bind_method(D_METHOD("get_point_ao", "index"), &VoxelCubePoints::get_point_ao);
ClassDB::bind_method(D_METHOD("get_face_point_ao", "face", "index"), &VoxelCubePoints::get_face_point_ao); ClassDB::bind_method(D_METHOD("get_face_point_ao", "face", "index"), &VoxelCubePoints::get_face_point_ao);
ClassDB::bind_method(D_METHOD("get_face_point_ao_color", "face", "index"), &VoxelCubePoints::get_face_point_ao_color); ClassDB::bind_method(D_METHOD("get_face_point_ao_color", "face", "index"), &VoxelCubePoints::get_face_point_ao_color);
ClassDB::bind_method(D_METHOD("get_face_point_light_color", "face", "index"), &VoxelCubePoints::get_face_point_light_color); ClassDB::bind_method(D_METHOD("get_face_point_light_color", "face", "index"), &VoxelCubePoints::get_face_point_light_color);
ClassDB::bind_method(D_METHOD("get_face_point_color_mixed", "face", "index"), &VoxelCubePoints::get_face_point_color_mixed); ClassDB::bind_method(D_METHOD("get_face_point_color_mixed", "face", "index"), &VoxelCubePoints::get_face_point_color_mixed);

View File

@ -113,8 +113,8 @@ public:
int get_point_fill(int index); int get_point_fill(int index);
int get_point_neighbours(int index); int get_point_neighbours(int index);
int get_point_ao(int index); int get_point_ao(int index);
int get_face_point_ao(int face, int index); int get_face_point_ao(int face, int index);
Color get_face_point_ao_color(int face, int index); Color get_face_point_ao_color(int face, int index);
Color get_face_point_light_color(int face, int index); Color get_face_point_light_color(int face, int index);
Color get_face_point_color_mixed(int face, int index); Color get_face_point_color_mixed(int face, int index);
@ -148,8 +148,8 @@ private:
uint8_t _point_types[POINT_COUNT]; uint8_t _point_types[POINT_COUNT];
uint8_t _point_fills[POINT_COUNT]; uint8_t _point_fills[POINT_COUNT];
uint8_t _point_aos[POINT_COUNT]; uint8_t _point_aos[POINT_COUNT];
Color _point_colors[POINT_COUNT]; Color _point_colors[POINT_COUNT];
unsigned int _point_neighbours[POINT_COUNT]; unsigned int _point_neighbours[POINT_COUNT];
int _size; int _size;

View File

@ -1,6 +1,5 @@
#include "voxel_mesher_cubic.h" #include "voxel_mesher_cubic.h"
void VoxelMesherCubic::_add_buffer(Node *p_chunk) { void VoxelMesherCubic::_add_buffer(Node *p_chunk) {
VoxelChunk *chunk = Object::cast_to<VoxelChunk>(p_chunk); VoxelChunk *chunk = Object::cast_to<VoxelChunk>(p_chunk);
@ -85,7 +84,6 @@ void VoxelMesherCubic::_add_buffer(Node *p_chunk) {
} }
VoxelMesherCubic::VoxelMesherCubic() { VoxelMesherCubic::VoxelMesherCubic() {
} }
VoxelMesherCubic::~VoxelMesherCubic() { VoxelMesherCubic::~VoxelMesherCubic() {

View File

@ -2,8 +2,8 @@
#define VOXEL_MESHER_CUBIC_H #define VOXEL_MESHER_CUBIC_H
#include "core/color.h" #include "core/color.h"
#include "core/math/vector3.h"
#include "core/math/vector2.h" #include "core/math/vector2.h"
#include "core/math/vector3.h"
#include "../voxel_mesher.h" #include "../voxel_mesher.h"
@ -14,13 +14,12 @@ class VoxelMesherCubic : public VoxelMesher {
public: public:
void _add_buffer(Node *p_chunk); void _add_buffer(Node *p_chunk);
VoxelMesherCubic(); VoxelMesherCubic();
~VoxelMesherCubic(); ~VoxelMesherCubic();
protected: protected:
static void _bind_methods(); static void _bind_methods();
}; };
#endif #endif

View File

@ -4,8 +4,8 @@ int TransvoxelCellData::get_vertex_index(int index) const {
return static_cast<int>(vertexIndex[index]); return static_cast<int>(vertexIndex[index]);
} }
void TransvoxelCellData::set_vertex_index(int index, int value) { void TransvoxelCellData::set_vertex_index(int index, int value) {
ERR_FAIL_INDEX(index, 36); ERR_FAIL_INDEX(index, 36);
vertexIndex[index] = static_cast<unsigned char>(value); vertexIndex[index] = static_cast<unsigned char>(value);
} }
@ -13,8 +13,8 @@ int TransvoxelCellData::get_vertex_count() const {
return (geometryCounts >> 4); return (geometryCounts >> 4);
} }
void TransvoxelCellData::set_vertex_count(int value) { void TransvoxelCellData::set_vertex_count(int value) {
geometryCounts &= 0xFF0F; geometryCounts &= 0xFF0F;
geometryCounts |= value << 4; geometryCounts |= value << 4;
} }
@ -23,32 +23,32 @@ int TransvoxelCellData::get_triangle_count() const {
} }
void TransvoxelCellData::set_triangle_count(int value) { void TransvoxelCellData::set_triangle_count(int value) {
geometryCounts &= 0xFFF0; geometryCounts &= 0xFFF0;
geometryCounts |= value; geometryCounts |= value;
} }
TransvoxelCellData::TransvoxelCellData() { TransvoxelCellData::TransvoxelCellData() {
geometryCounts = 0; geometryCounts = 0;
for (int i = 0; i < 36; ++i) { for (int i = 0; i < 36; ++i) {
vertexIndex[i] = 0; vertexIndex[i] = 0;
} }
} }
TransvoxelCellData::TransvoxelCellData(const RegularCellData &cell_data) { TransvoxelCellData::TransvoxelCellData(const RegularCellData &cell_data) {
geometryCounts = cell_data.geometryCounts; geometryCounts = cell_data.geometryCounts;
for (int i = 0; i < 15; ++i) { for (int i = 0; i < 15; ++i) {
vertexIndex[i] = cell_data.vertexIndex[i]; vertexIndex[i] = cell_data.vertexIndex[i];
} }
} }
TransvoxelCellData::TransvoxelCellData(const TransitionCellData &cell_data) { TransvoxelCellData::TransvoxelCellData(const TransitionCellData &cell_data) {
geometryCounts = cell_data.geometryCounts; geometryCounts = cell_data.geometryCounts;
for (int i = 0; i < 36; ++i) { for (int i = 0; i < 36; ++i) {
vertexIndex[i] = cell_data.vertexIndex[i]; vertexIndex[i] = cell_data.vertexIndex[i];
} }
} }
TransvoxelCellData::~TransvoxelCellData() { TransvoxelCellData::~TransvoxelCellData() {
@ -56,13 +56,11 @@ TransvoxelCellData::~TransvoxelCellData() {
void TransvoxelCellData::_bind_methods() { void TransvoxelCellData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_vertex_index", "index"), &TransvoxelCellData::get_vertex_index); ClassDB::bind_method(D_METHOD("get_vertex_index", "index"), &TransvoxelCellData::get_vertex_index);
ClassDB::bind_method(D_METHOD("set_vertex_index", "index", "value"), &TransvoxelCellData::set_vertex_index); ClassDB::bind_method(D_METHOD("set_vertex_index", "index", "value"), &TransvoxelCellData::set_vertex_index);
ClassDB::bind_method(D_METHOD("get_vertex_count"), &TransvoxelCellData::get_vertex_count); ClassDB::bind_method(D_METHOD("get_vertex_count"), &TransvoxelCellData::get_vertex_count);
ClassDB::bind_method(D_METHOD("set_vertex_count", "value"), &TransvoxelCellData::set_vertex_count); ClassDB::bind_method(D_METHOD("set_vertex_count", "value"), &TransvoxelCellData::set_vertex_count);
ClassDB::bind_method(D_METHOD("get_triangle_count"), &TransvoxelCellData::get_triangle_count); ClassDB::bind_method(D_METHOD("get_triangle_count"), &TransvoxelCellData::get_triangle_count);
ClassDB::bind_method(D_METHOD("set_triangle_count", "value"), &TransvoxelCellData::set_triangle_count); ClassDB::bind_method(D_METHOD("set_triangle_count", "value"), &TransvoxelCellData::set_triangle_count);
} }

View File

@ -12,15 +12,15 @@ class TransvoxelCellData : public Reference {
public: public:
int get_vertex_index(int index) const; int get_vertex_index(int index) const;
void set_vertex_index(int index, int value); void set_vertex_index(int index, int value);
int get_vertex_count() const; int get_vertex_count() const;
void set_vertex_count(int value); void set_vertex_count(int value);
int get_triangle_count() const; int get_triangle_count() const;
void set_triangle_count(int value); void set_triangle_count(int value);
TransvoxelCellData(); TransvoxelCellData();
TransvoxelCellData(const RegularCellData &cell_data); TransvoxelCellData(const RegularCellData &cell_data);
TransvoxelCellData(const TransitionCellData &cell_data); TransvoxelCellData(const TransitionCellData &cell_data);
~TransvoxelCellData(); ~TransvoxelCellData();
protected: protected:

View File

@ -41,7 +41,7 @@ namespace Transvoxel {
// that the class index ranges from 0 to 15. // that the class index ranges from 0 to 15.
const unsigned char regularCellClass[256] = { const unsigned char regularCellClass[256] = {
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0x00, 0x01, 0x01, 0x03, 0x01, 0x03, 0x02, 0x04, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x04, 0x03, // 0 0x00, 0x01, 0x01, 0x03, 0x01, 0x03, 0x02, 0x04, 0x01, 0x02, 0x03, 0x04, 0x03, 0x04, 0x04, 0x03, // 0
0x01, 0x03, 0x02, 0x04, 0x02, 0x04, 0x06, 0x0C, 0x02, 0x05, 0x05, 0x0B, 0x05, 0x0A, 0x07, 0x04, // 16 0x01, 0x03, 0x02, 0x04, 0x02, 0x04, 0x06, 0x0C, 0x02, 0x05, 0x05, 0x0B, 0x05, 0x0A, 0x07, 0x04, // 16
0x01, 0x02, 0x03, 0x04, 0x02, 0x05, 0x05, 0x0A, 0x02, 0x06, 0x04, 0x0C, 0x05, 0x07, 0x0B, 0x04, // 32 0x01, 0x02, 0x03, 0x04, 0x02, 0x05, 0x05, 0x0A, 0x02, 0x06, 0x04, 0x0C, 0x05, 0x07, 0x0B, 0x04, // 32
@ -57,7 +57,7 @@ const unsigned char regularCellClass[256] = {
0x03, 0x05, 0x05, 0x08, 0x04, 0x0A, 0x07, 0x0E, 0x04, 0x07, 0x0B, 0x0E, 0x03, 0x04, 0x04, 0x03, // 192 0x03, 0x05, 0x05, 0x08, 0x04, 0x0A, 0x07, 0x0E, 0x04, 0x07, 0x0B, 0x0E, 0x03, 0x04, 0x04, 0x03, // 192
0x04, 0x0B, 0x07, 0x0E, 0x0C, 0x04, 0x0F, 0x0D, 0x0A, 0x0E, 0x0E, 0x02, 0x04, 0x03, 0x0D, 0x01, // 208 0x04, 0x0B, 0x07, 0x0E, 0x0C, 0x04, 0x0F, 0x0D, 0x0A, 0x0E, 0x0E, 0x02, 0x04, 0x03, 0x0D, 0x01, // 208
0x04, 0x07, 0x0A, 0x0E, 0x0B, 0x0E, 0x0E, 0x02, 0x0C, 0x0F, 0x04, 0x0D, 0x04, 0x0D, 0x03, 0x01, // 224 0x04, 0x07, 0x0A, 0x0E, 0x0B, 0x0E, 0x0E, 0x02, 0x0C, 0x0F, 0x04, 0x0D, 0x04, 0x0D, 0x03, 0x01, // 224
0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x0D, 0x01, 0x04, 0x0D, 0x03, 0x01, 0x03, 0x01, 0x01, 0x00 // 240 0x03, 0x04, 0x04, 0x03, 0x04, 0x03, 0x0D, 0x01, 0x04, 0x0D, 0x03, 0x01, 0x03, 0x01, 0x01, 0x00 // 240
}; };
// The regularCellData table holds the triangulation data for all 16 distinct classes to // The regularCellData table holds the triangulation data for all 16 distinct classes to
@ -66,20 +66,20 @@ const unsigned char regularCellClass[256] = {
const RegularCellData regularCellData[16] = { const RegularCellData regularCellData[16] = {
{ 0x00, {} }, { 0x00, {} },
{ 0x31, { 0, 1, 2 } }, { 0x31, { 0, 1, 2 } },
{ 0x62, { 0, 1, 2, 3, 4, 5 } }, { 0x62, { 0, 1, 2, 3, 4, 5 } },
{ 0x62, { 0, 1, 2, 4, 5, 3 } }, //{ 0x42, { 0, 1, 2, 0, 2, 3 } } { 0x62, { 0, 1, 2, 4, 5, 3 } }, //{ 0x42, { 0, 1, 2, 0, 2, 3 } }
{ 0x93, { 0, 1, 4, 5, 3, 6, 7, 2, 8 } }, //{ 0x53, { 0, 1, 4, 1, 3, 4, 1, 2, 3 } } { 0x93, { 0, 1, 4, 5, 3, 6, 7, 2, 8 } }, //{ 0x53, { 0, 1, 4, 1, 3, 4, 1, 2, 3 } }
{ 0x73, { 0, 1, 2, 0, 2, 3, 4, 5, 6 } }, { 0x73, { 0, 1, 2, 0, 2, 3, 4, 5, 6 } },
{ 0x93, { 0, 1, 2, 3, 4, 5, 6, 7, 8 } }, { 0x93, { 0, 1, 2, 3, 4, 5, 6, 7, 8 } },
{ 0xC4, { 0, 1, 4, 8, 3, 9, 10, 2, 11, 5, 6, 7 } }, //7 { 0x84, { 0, 1, 4, 1, 3, 4, 1, 2, 3, 5, 6, 7 } }, { 0xC4, { 0, 1, 4, 8, 3, 9, 10, 2, 11, 5, 6, 7 } }, //7 { 0x84, { 0, 1, 4, 1, 3, 4, 1, 2, 3, 5, 6, 7 } },
{ 0x84, { 0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7 } }, { 0x84, { 0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7 } },
{ 0xC4, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } }, { 0xC4, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } },
{ 0xC4, { 0, 4, 5, 6, 7, 8, 9, 10, 11, 1, 2, 3 } }, //A { 0x64, { 0, 4, 5, 0, 1, 4, 1, 3, 4, 1, 2, 3 } }, { 0xC4, { 0, 4, 5, 6, 7, 8, 9, 10, 11, 1, 2, 3 } }, //A { 0x64, { 0, 4, 5, 0, 1, 4, 1, 3, 4, 1, 2, 3 } },
{ 0xC4, { 0, 5, 4, 6, 8, 7, 9, 11, 10, 1, 3, 2 } }, //B { 0x64, { 0, 5, 4, 0, 4, 1, 1, 4, 3, 1, 3, 2 } }, { 0xC4, { 0, 5, 4, 6, 8, 7, 9, 11, 10, 1, 3, 2 } }, //B { 0x64, { 0, 5, 4, 0, 4, 1, 1, 4, 3, 1, 3, 2 } },
{ 0xC4, { 0, 4, 5, 6, 7, 8, 9, 10, 11, 1, 2, 3 } }, //C { 0x64, { 0, 4, 5, 0, 3, 4, 0, 1, 3, 1, 2, 3 } }, { 0xC4, { 0, 4, 5, 6, 7, 8, 9, 10, 11, 1, 2, 3 } }, //C { 0x64, { 0, 4, 5, 0, 3, 4, 0, 1, 3, 1, 2, 3 } },
{ 0xC4, { 0, 1, 2, 6, 7, 3, 8, 9, 4, 10, 11, 5 } }, //D { 0x64, { 0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5 } }, { 0xC4, { 0, 1, 2, 6, 7, 3, 8, 9, 4, 10, 11, 5 } }, //D { 0x64, { 0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5 } },
{ 0xF5, { 0, 1, 2, 7, 8, 3, 9, 10, 4, 11, 12, 5, 13, 14, 6 } }, //E { 0x75, { 0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 6 } }, { 0xF5, { 0, 1, 2, 7, 8, 3, 9, 10, 4, 11, 12, 5, 13, 14, 6 } }, //E { 0x75, { 0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 6 } },
{ 0xF5, { 0, 4, 5, 9, 3, 10, 11, 1, 12, 13, 2, 14, 6, 7, 8 } } //F { 0x95, { 0, 4, 5, 0, 3, 4, 0, 1, 3, 1, 2, 3, 6, 7, 8 } } { 0xF5, { 0, 4, 5, 9, 3, 10, 11, 1, 12, 13, 2, 14, 6, 7, 8 } } //F { 0x95, { 0, 4, 5, 0, 3, 4, 0, 1, 3, 1, 2, 3, 6, 7, 8 } }
}; };
// The regularVertexData table gives the vertex locations for every one of the 256 possible // The regularVertexData table gives the vertex locations for every one of the 256 possible
@ -105,7 +105,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x4113, 0x8337, 0x1326, 0x3304, 0x6201, 0x8337, 0x6201, 0x8337, 0x3304 }, { 0x4113, 0x8337, 0x1326, 0x3304, 0x6201, 0x8337, 0x6201, 0x8337, 0x3304 },
{ 0x6201, 0x2315, 0x8337, 0x1326, 0x5102, 0x2315, 0x5102, 0x2315, 0x1326 }, { 0x6201, 0x2315, 0x8337, 0x1326, 0x5102, 0x2315, 0x5102, 0x2315, 0x1326 },
{ 0x3304, 0x2315, 0x8337, 0x1326, 0x3304, 0x8337 }, { 0x3304, 0x2315, 0x8337, 0x1326, 0x3304, 0x8337 },
//16 3 5 15 //16 3 5 15
{ 0x3304, 0x1146, 0x2245 }, { 0x3304, 0x1146, 0x2245 },
{ 0x6201, 0x5102, 0x1146, 0x2245, 0x6201, 0x1146 }, { 0x6201, 0x5102, 0x1146, 0x2245, 0x6201, 0x1146 },
{ 0x6201, 0x2315, 0x4113, 0x3304, 0x1146, 0x2245 }, { 0x6201, 0x2315, 0x4113, 0x3304, 0x1146, 0x2245 },
@ -122,7 +122,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x4113, 0x8337, 0x1326, 0x1146, 0x2245, 0x6201, 0x4113, 0x8337, 0x2245, 0x8337, 0x1146, 0x2245 }, { 0x4113, 0x8337, 0x1326, 0x1146, 0x2245, 0x6201, 0x4113, 0x8337, 0x2245, 0x8337, 0x1146, 0x2245 },
{ 0x6201, 0x2315, 0x8337, 0x1326, 0x5102, 0x3304, 0x1146, 0x2245, 0x2315, 0x5102, 0x2315, 0x1326 }, { 0x6201, 0x2315, 0x8337, 0x1326, 0x5102, 0x3304, 0x1146, 0x2245, 0x2315, 0x5102, 0x2315, 0x1326 },
{ 0x2245, 0x2315, 0x8337, 0x1326, 0x1146, 0x2315, 0x1146, 0x2315, 0x1326 }, { 0x2245, 0x2315, 0x8337, 0x1326, 0x1146, 0x2315, 0x1146, 0x2315, 0x1326 },
//32 3 10 15 //32 3 10 15
{ 0x2315, 0x2245, 0x8157 }, { 0x2315, 0x2245, 0x8157 },
{ 0x6201, 0x5102, 0x3304, 0x2315, 0x2245, 0x8157 }, { 0x6201, 0x5102, 0x3304, 0x2315, 0x2245, 0x8157 },
{ 0x4113, 0x6201, 0x2245, 0x8157, 0x4113, 0x2245 }, { 0x4113, 0x6201, 0x2245, 0x8157, 0x4113, 0x2245 },
@ -139,7 +139,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x4113, 0x8337, 0x1326, 0x3304, 0x6201, 0x2315, 0x2245, 0x8157, 0x8337, 0x6201, 0x8337, 0x3304 }, { 0x4113, 0x8337, 0x1326, 0x3304, 0x6201, 0x2315, 0x2245, 0x8157, 0x8337, 0x6201, 0x8337, 0x3304 },
{ 0x5102, 0x1326, 0x8337, 0x8157, 0x2245, 0x6201, 0x5102, 0x1326, 0x2245, 0x1326, 0x8157, 0x2245 }, { 0x5102, 0x1326, 0x8337, 0x8157, 0x2245, 0x6201, 0x5102, 0x1326, 0x2245, 0x1326, 0x8157, 0x2245 },
{ 0x8157, 0x8337, 0x1326, 0x3304, 0x2245, 0x8337, 0x2245, 0x8337, 0x3304 }, { 0x8157, 0x8337, 0x1326, 0x3304, 0x2245, 0x8337, 0x2245, 0x8337, 0x3304 },
//48 1 2 7 11 //48 1 2 7 11
{ 0x2315, 0x3304, 0x1146, 0x8157, 0x2315, 0x1146 }, { 0x2315, 0x3304, 0x1146, 0x8157, 0x2315, 0x1146 },
{ 0x6201, 0x5102, 0x1146, 0x8157, 0x2315, 0x5102, 0x2315, 0x5102, 0x8157 }, { 0x6201, 0x5102, 0x1146, 0x8157, 0x2315, 0x5102, 0x2315, 0x5102, 0x8157 },
{ 0x3304, 0x1146, 0x8157, 0x4113, 0x6201, 0x1146, 0x6201, 0x1146, 0x4113 }, { 0x3304, 0x1146, 0x8157, 0x4113, 0x6201, 0x1146, 0x6201, 0x1146, 0x4113 },
@ -156,7 +156,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x6201, 0x4113, 0x8337, 0x1326, 0x1146, 0x8157, 0x2315, 0x6201, 0x8337, 0x6201, 0x1326, 0x6201, 0x1146, 0x6201, 0x8157 }, { 0x6201, 0x4113, 0x8337, 0x1326, 0x1146, 0x8157, 0x2315, 0x6201, 0x8337, 0x6201, 0x1326, 0x6201, 0x1146, 0x6201, 0x8157 },
{ 0x6201, 0x3304, 0x1146, 0x8157, 0x8337, 0x1326, 0x5102, 0x6201, 0x1146, 0x6201, 0x8157, 0x6201, 0x8337, 0x6201, 0x1326 }, { 0x6201, 0x3304, 0x1146, 0x8157, 0x8337, 0x1326, 0x5102, 0x6201, 0x1146, 0x6201, 0x8157, 0x6201, 0x8337, 0x6201, 0x1326 },
{ 0x1326, 0x1146, 0x8157, 0x8337, 0x1326, 0x8157 }, { 0x1326, 0x1146, 0x8157, 0x8337, 0x1326, 0x8157 },
//64 5 12 15 //64 5 12 15
{ 0x1326, 0x8267, 0x1146 }, { 0x1326, 0x8267, 0x1146 },
{ 0x6201, 0x5102, 0x3304, 0x1326, 0x8267, 0x1146 }, { 0x6201, 0x5102, 0x3304, 0x1326, 0x8267, 0x1146 },
{ 0x6201, 0x2315, 0x4113, 0x1326, 0x8267, 0x1146 }, { 0x6201, 0x2315, 0x4113, 0x1326, 0x8267, 0x1146 },
@ -173,7 +173,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x6201, 0x4113, 0x8337, 0x8267, 0x1146, 0x3304, 0x6201, 0x8267, 0x1146, 0x6201, 0x4113, 0x8267 }, { 0x6201, 0x4113, 0x8337, 0x8267, 0x1146, 0x3304, 0x6201, 0x8267, 0x1146, 0x6201, 0x4113, 0x8267 },
{ 0x6201, 0x2315, 0x8337, 0x8267, 0x1146, 0x5102, 0x6201, 0x2315, 0x1146, 0x2315, 0x8267, 0x1146 }, { 0x6201, 0x2315, 0x8337, 0x8267, 0x1146, 0x5102, 0x6201, 0x2315, 0x1146, 0x2315, 0x8267, 0x1146 },
{ 0x1146, 0x3304, 0x2315, 0x8337, 0x8267, 0x3304, 0x8267, 0x3304, 0x8337 }, { 0x1146, 0x3304, 0x2315, 0x8337, 0x8267, 0x3304, 0x8267, 0x3304, 0x8337 },
//80 1 4 7 13 //80 1 4 7 13
{ 0x3304, 0x1326, 0x8267, 0x2245, 0x3304, 0x8267 }, { 0x3304, 0x1326, 0x8267, 0x2245, 0x3304, 0x8267 },
{ 0x1326, 0x8267, 0x2245, 0x6201, 0x5102, 0x8267, 0x5102, 0x8267, 0x6201 }, { 0x1326, 0x8267, 0x2245, 0x6201, 0x5102, 0x8267, 0x5102, 0x8267, 0x6201 },
{ 0x3304, 0x1326, 0x8267, 0x2245, 0x6201, 0x2315, 0x4113 }, { 0x3304, 0x1326, 0x8267, 0x2245, 0x6201, 0x2315, 0x4113 },
@ -190,7 +190,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x8337, 0x8267, 0x2245, 0x6201, 0x4113, 0x8267, 0x4113, 0x8267, 0x6201 }, { 0x8337, 0x8267, 0x2245, 0x6201, 0x4113, 0x8267, 0x4113, 0x8267, 0x6201 },
{ 0x5102, 0x6201, 0x2315, 0x8337, 0x8267, 0x2245, 0x3304, 0x5102, 0x2315, 0x5102, 0x8337, 0x5102, 0x8267, 0x5102, 0x2245 }, { 0x5102, 0x6201, 0x2315, 0x8337, 0x8267, 0x2245, 0x3304, 0x5102, 0x2315, 0x5102, 0x8337, 0x5102, 0x8267, 0x5102, 0x2245 },
{ 0x2315, 0x8337, 0x8267, 0x2245, 0x2315, 0x8267 }, { 0x2315, 0x8337, 0x8267, 0x2245, 0x2315, 0x8267 },
//96 - //96 -
{ 0x2315, 0x2245, 0x8157, 0x1326, 0x8267, 0x1146 }, { 0x2315, 0x2245, 0x8157, 0x1326, 0x8267, 0x1146 },
{ 0x6201, 0x5102, 0x3304, 0x2315, 0x2245, 0x8157, 0x1326, 0x8267, 0x1146 }, { 0x6201, 0x5102, 0x3304, 0x2315, 0x2245, 0x8157, 0x1326, 0x8267, 0x1146 },
{ 0x6201, 0x2245, 0x8157, 0x4113, 0x1326, 0x8267, 0x1146 }, { 0x6201, 0x2245, 0x8157, 0x4113, 0x1326, 0x8267, 0x1146 },
@ -207,7 +207,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x6201, 0x4113, 0x8337, 0x8267, 0x1146, 0x3304, 0x2315, 0x2245, 0x8157, 0x6201, 0x1146, 0x6201, 0x8267, 0x4113, 0x8267 }, { 0x6201, 0x4113, 0x8337, 0x8267, 0x1146, 0x3304, 0x2315, 0x2245, 0x8157, 0x6201, 0x1146, 0x6201, 0x8267, 0x4113, 0x8267 },
{ 0x8337, 0x8267, 0x1146, 0x5102, 0x6201, 0x2245, 0x8157, 0x8337, 0x1146, 0x8337, 0x5102, 0x8337, 0x6201, 0x8337, 0x2245 }, { 0x8337, 0x8267, 0x1146, 0x5102, 0x6201, 0x2245, 0x8157, 0x8337, 0x1146, 0x8337, 0x5102, 0x8337, 0x6201, 0x8337, 0x2245 },
{ 0x3304, 0x2245, 0x8157, 0x8337, 0x8267, 0x1146, 0x3304, 0x8157, 0x3304, 0x8337, 0x3304, 0x8267 }, { 0x3304, 0x2245, 0x8157, 0x8337, 0x8267, 0x1146, 0x3304, 0x8157, 0x3304, 0x8337, 0x3304, 0x8267 },
//112 0 3 5 //112 0 3 5
{ 0x8157, 0x2315, 0x3304, 0x1326, 0x8267, 0x2315, 0x8267, 0x2315, 0x1326 }, { 0x8157, 0x2315, 0x3304, 0x1326, 0x8267, 0x2315, 0x8267, 0x2315, 0x1326 },
{ 0x8267, 0x8157, 0x2315, 0x6201, 0x5102, 0x1326, 0x8267, 0x6201, 0x5102, 0x8267, 0x8157, 0x6201 }, { 0x8267, 0x8157, 0x2315, 0x6201, 0x5102, 0x1326, 0x8267, 0x6201, 0x5102, 0x8267, 0x8157, 0x6201 },
{ 0x8267, 0x1326, 0x3304, 0x6201, 0x4113, 0x8157, 0x8267, 0x1326, 0x4113, 0x1326, 0x6201, 0x4113 }, { 0x8267, 0x1326, 0x3304, 0x6201, 0x4113, 0x8157, 0x8267, 0x1326, 0x4113, 0x1326, 0x6201, 0x4113 },
@ -224,7 +224,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x6201, 0x4113, 0x8337, 0x8267, 0x8157, 0x2315, 0x6201, 0x8337, 0x6201, 0x8267, 0x6201, 0x8157 }, { 0x6201, 0x4113, 0x8337, 0x8267, 0x8157, 0x2315, 0x6201, 0x8337, 0x6201, 0x8267, 0x6201, 0x8157 },
{ 0x6201, 0x3304, 0x5102, 0x8337, 0x8267, 0x8157 }, { 0x6201, 0x3304, 0x5102, 0x8337, 0x8267, 0x8157 },
{ 0x8337, 0x8267, 0x8157 }, { 0x8337, 0x8267, 0x8157 },
//128 10 12 15 //128 10 12 15
{ 0x8337, 0x8157, 0x8267 }, { 0x8337, 0x8157, 0x8267 },
{ 0x6201, 0x5102, 0x3304, 0x8337, 0x8157, 0x8267 }, { 0x6201, 0x5102, 0x3304, 0x8337, 0x8157, 0x8267 },
{ 0x6201, 0x2315, 0x4113, 0x8337, 0x8157, 0x8267 }, { 0x6201, 0x2315, 0x4113, 0x8337, 0x8157, 0x8267 },
@ -241,7 +241,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x8157, 0x4113, 0x6201, 0x3304, 0x1326, 0x8267, 0x8157, 0x4113, 0x1326, 0x4113, 0x3304, 0x1326 }, { 0x8157, 0x4113, 0x6201, 0x3304, 0x1326, 0x8267, 0x8157, 0x4113, 0x1326, 0x4113, 0x3304, 0x1326 },
{ 0x1326, 0x5102, 0x6201, 0x2315, 0x8157, 0x8267, 0x1326, 0x2315, 0x8157, 0x1326, 0x5102, 0x2315 }, { 0x1326, 0x5102, 0x6201, 0x2315, 0x8157, 0x8267, 0x1326, 0x2315, 0x8157, 0x1326, 0x5102, 0x2315 },
{ 0x8267, 0x1326, 0x3304, 0x2315, 0x8157, 0x1326, 0x8157, 0x1326, 0x2315 }, { 0x8267, 0x1326, 0x3304, 0x2315, 0x8157, 0x1326, 0x8157, 0x1326, 0x2315 },
//144 - //144 -
{ 0x3304, 0x1146, 0x2245, 0x8337, 0x8157, 0x8267 }, { 0x3304, 0x1146, 0x2245, 0x8337, 0x8157, 0x8267 },
{ 0x6201, 0x5102, 0x1146, 0x2245, 0x8337, 0x8157, 0x8267 }, { 0x6201, 0x5102, 0x1146, 0x2245, 0x8337, 0x8157, 0x8267 },
{ 0x6201, 0x2315, 0x4113, 0x3304, 0x1146, 0x2245, 0x8337, 0x8157, 0x8267 }, { 0x6201, 0x2315, 0x4113, 0x3304, 0x1146, 0x2245, 0x8337, 0x8157, 0x8267 },
@ -258,7 +258,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x1326, 0x1146, 0x2245, 0x6201, 0x4113, 0x8157, 0x8267, 0x1326, 0x2245, 0x1326, 0x6201, 0x1326, 0x4113, 0x1326, 0x8157 }, { 0x1326, 0x1146, 0x2245, 0x6201, 0x4113, 0x8157, 0x8267, 0x1326, 0x2245, 0x1326, 0x6201, 0x1326, 0x4113, 0x1326, 0x8157 },
{ 0x5102, 0x6201, 0x2315, 0x8157, 0x8267, 0x1326, 0x3304, 0x1146, 0x2245, 0x5102, 0x8267, 0x5102, 0x8157, 0x6201, 0x8157 }, { 0x5102, 0x6201, 0x2315, 0x8157, 0x8267, 0x1326, 0x3304, 0x1146, 0x2245, 0x5102, 0x8267, 0x5102, 0x8157, 0x6201, 0x8157 },
{ 0x1326, 0x1146, 0x2245, 0x2315, 0x8157, 0x8267, 0x1326, 0x2245, 0x1326, 0x2315, 0x1326, 0x8157 }, { 0x1326, 0x1146, 0x2245, 0x2315, 0x8157, 0x8267, 0x1326, 0x2245, 0x1326, 0x2315, 0x1326, 0x8157 },
//160 2 8 11 14 //160 2 8 11 14
{ 0x2315, 0x2245, 0x8267, 0x8337, 0x2315, 0x8267 }, { 0x2315, 0x2245, 0x8267, 0x8337, 0x2315, 0x8267 },
{ 0x2315, 0x2245, 0x8267, 0x8337, 0x6201, 0x5102, 0x3304 }, { 0x2315, 0x2245, 0x8267, 0x8337, 0x6201, 0x5102, 0x3304 },
{ 0x4113, 0x6201, 0x2245, 0x8267, 0x8337, 0x6201, 0x8337, 0x6201, 0x8267 }, { 0x4113, 0x6201, 0x2245, 0x8267, 0x8337, 0x6201, 0x8337, 0x6201, 0x8267 },
@ -275,7 +275,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x4113, 0x2315, 0x2245, 0x8267, 0x1326, 0x3304, 0x6201, 0x4113, 0x2245, 0x4113, 0x8267, 0x4113, 0x1326, 0x4113, 0x3304 }, { 0x4113, 0x2315, 0x2245, 0x8267, 0x1326, 0x3304, 0x6201, 0x4113, 0x2245, 0x4113, 0x8267, 0x4113, 0x1326, 0x4113, 0x3304 },
{ 0x5102, 0x6201, 0x2245, 0x8267, 0x1326, 0x6201, 0x1326, 0x6201, 0x8267 }, { 0x5102, 0x6201, 0x2245, 0x8267, 0x1326, 0x6201, 0x1326, 0x6201, 0x8267 },
{ 0x3304, 0x2245, 0x8267, 0x1326, 0x3304, 0x8267 }, { 0x3304, 0x2245, 0x8267, 0x1326, 0x3304, 0x8267 },
//176 0 3 10 //176 0 3 10
{ 0x8267, 0x8337, 0x2315, 0x3304, 0x1146, 0x8337, 0x1146, 0x8337, 0x3304 }, { 0x8267, 0x8337, 0x2315, 0x3304, 0x1146, 0x8337, 0x1146, 0x8337, 0x3304 },
{ 0x5102, 0x1146, 0x8267, 0x8337, 0x2315, 0x6201, 0x5102, 0x1146, 0x2315, 0x1146, 0x8337, 0x2315 }, { 0x5102, 0x1146, 0x8267, 0x8337, 0x2315, 0x6201, 0x5102, 0x1146, 0x2315, 0x1146, 0x8337, 0x2315 },
{ 0x3304, 0x1146, 0x8267, 0x8337, 0x4113, 0x6201, 0x3304, 0x8337, 0x4113, 0x3304, 0x1146, 0x8337 }, { 0x3304, 0x1146, 0x8267, 0x8337, 0x4113, 0x6201, 0x3304, 0x8337, 0x4113, 0x3304, 0x1146, 0x8337 },
@ -292,7 +292,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x6201, 0x4113, 0x2315, 0x1326, 0x1146, 0x8267 }, { 0x6201, 0x4113, 0x2315, 0x1326, 0x1146, 0x8267 },
{ 0x6201, 0x3304, 0x1146, 0x8267, 0x1326, 0x5102, 0x6201, 0x1146, 0x6201, 0x8267, 0x6201, 0x1326 }, { 0x6201, 0x3304, 0x1146, 0x8267, 0x1326, 0x5102, 0x6201, 0x1146, 0x6201, 0x8267, 0x6201, 0x1326 },
{ 0x1326, 0x1146, 0x8267 }, { 0x1326, 0x1146, 0x8267 },
//192 4 8 13 14 //192 4 8 13 14
{ 0x1326, 0x8337, 0x8157, 0x1146, 0x1326, 0x8157 }, { 0x1326, 0x8337, 0x8157, 0x1146, 0x1326, 0x8157 },
{ 0x8337, 0x8157, 0x1146, 0x1326, 0x6201, 0x5102, 0x3304 }, { 0x8337, 0x8157, 0x1146, 0x1326, 0x6201, 0x5102, 0x3304 },
{ 0x8337, 0x8157, 0x1146, 0x1326, 0x6201, 0x2315, 0x4113 }, { 0x8337, 0x8157, 0x1146, 0x1326, 0x6201, 0x2315, 0x4113 },
@ -309,7 +309,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x6201, 0x4113, 0x8157, 0x1146, 0x3304, 0x4113, 0x3304, 0x4113, 0x1146 }, { 0x6201, 0x4113, 0x8157, 0x1146, 0x3304, 0x4113, 0x3304, 0x4113, 0x1146 },
{ 0x2315, 0x8157, 0x1146, 0x5102, 0x6201, 0x8157, 0x6201, 0x8157, 0x5102 }, { 0x2315, 0x8157, 0x1146, 0x5102, 0x6201, 0x8157, 0x6201, 0x8157, 0x5102 },
{ 0x2315, 0x8157, 0x1146, 0x3304, 0x2315, 0x1146 }, { 0x2315, 0x8157, 0x1146, 0x3304, 0x2315, 0x1146 },
//208 0 5 12 //208 0 5 12
{ 0x2245, 0x3304, 0x1326, 0x8337, 0x8157, 0x3304, 0x8157, 0x3304, 0x8337 }, { 0x2245, 0x3304, 0x1326, 0x8337, 0x8157, 0x3304, 0x8157, 0x3304, 0x8337 },
{ 0x6201, 0x2245, 0x8157, 0x8337, 0x1326, 0x5102, 0x6201, 0x2245, 0x1326, 0x2245, 0x8337, 0x1326 }, { 0x6201, 0x2245, 0x8157, 0x8337, 0x1326, 0x5102, 0x6201, 0x2245, 0x1326, 0x2245, 0x8337, 0x1326 },
{ 0x2245, 0x3304, 0x1326, 0x8337, 0x8157, 0x6201, 0x2315, 0x4113, 0x3304, 0x8157, 0x3304, 0x8337 }, { 0x2245, 0x3304, 0x1326, 0x8337, 0x8157, 0x6201, 0x2315, 0x4113, 0x3304, 0x8157, 0x3304, 0x8337 },
@ -326,7 +326,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x4113, 0x8157, 0x2245, 0x6201, 0x4113, 0x2245 }, { 0x4113, 0x8157, 0x2245, 0x6201, 0x4113, 0x2245 },
{ 0x5102, 0x6201, 0x2315, 0x8157, 0x2245, 0x3304, 0x5102, 0x2315, 0x5102, 0x8157, 0x5102, 0x2245 }, { 0x5102, 0x6201, 0x2315, 0x8157, 0x2245, 0x3304, 0x5102, 0x2315, 0x5102, 0x8157, 0x5102, 0x2245 },
{ 0x2315, 0x8157, 0x2245 }, { 0x2315, 0x8157, 0x2245 },
//224 0 10 12 //224 0 10 12
{ 0x1146, 0x1326, 0x8337, 0x2315, 0x2245, 0x1326, 0x2245, 0x1326, 0x2315 }, { 0x1146, 0x1326, 0x8337, 0x2315, 0x2245, 0x1326, 0x2245, 0x1326, 0x2315 },
{ 0x1146, 0x1326, 0x8337, 0x2315, 0x2245, 0x6201, 0x5102, 0x3304, 0x1326, 0x2245, 0x1326, 0x2315 }, { 0x1146, 0x1326, 0x8337, 0x2315, 0x2245, 0x6201, 0x5102, 0x3304, 0x1326, 0x2245, 0x1326, 0x2315 },
{ 0x6201, 0x2245, 0x1146, 0x1326, 0x8337, 0x4113, 0x6201, 0x2245, 0x8337, 0x2245, 0x1326, 0x8337 }, { 0x6201, 0x2245, 0x1146, 0x1326, 0x8337, 0x4113, 0x6201, 0x2245, 0x8337, 0x2245, 0x1326, 0x8337 },
@ -343,7 +343,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x4113, 0x2315, 0x2245, 0x1146, 0x3304, 0x6201, 0x4113, 0x2245, 0x4113, 0x1146, 0x4113, 0x3304 }, { 0x4113, 0x2315, 0x2245, 0x1146, 0x3304, 0x6201, 0x4113, 0x2245, 0x4113, 0x1146, 0x4113, 0x3304 },
{ 0x6201, 0x2245, 0x1146, 0x5102, 0x6201, 0x1146 }, { 0x6201, 0x2245, 0x1146, 0x5102, 0x6201, 0x1146 },
{ 0x3304, 0x2245, 0x1146 }, { 0x3304, 0x2245, 0x1146 },
//240 1 2 4 8 //240 1 2 4 8
{ 0x3304, 0x1326, 0x8337, 0x2315, 0x3304, 0x8337 }, { 0x3304, 0x1326, 0x8337, 0x2315, 0x3304, 0x8337 },
{ 0x5102, 0x1326, 0x8337, 0x2315, 0x6201, 0x1326, 0x6201, 0x1326, 0x2315 }, { 0x5102, 0x1326, 0x8337, 0x2315, 0x6201, 0x1326, 0x6201, 0x1326, 0x2315 },
{ 0x6201, 0x3304, 0x1326, 0x8337, 0x4113, 0x3304, 0x4113, 0x3304, 0x8337 }, { 0x6201, 0x3304, 0x1326, 0x8337, 0x4113, 0x3304, 0x4113, 0x3304, 0x8337 },
@ -359,7 +359,7 @@ const unsigned short regularVertexData[256][15] = {
{ 0x5102, 0x4113, 0x2315, 0x3304, 0x5102, 0x2315 }, { 0x5102, 0x4113, 0x2315, 0x3304, 0x5102, 0x2315 },
{ 0x6201, 0x4113, 0x2315 }, { 0x6201, 0x4113, 0x2315 },
{ 0x6201, 0x3304, 0x5102 }, { 0x6201, 0x3304, 0x5102 },
{} {}
//256 //256
}; };

View File

@ -3,9 +3,9 @@
#include "core/reference.h" #include "core/reference.h"
#include "core/vector.h" #include "core/vector.h"
#include "scene/resources/material.h"
#include "scene/resources/mesh.h" #include "scene/resources/mesh.h"
#include "scene/resources/surface_tool.h" #include "scene/resources/surface_tool.h"
#include "scene/resources/material.h"
class VoxelMeshData : public Reference { class VoxelMeshData : public Reference {
GDCLASS(VoxelMeshData, Reference) GDCLASS(VoxelMeshData, Reference)

View File

@ -702,7 +702,7 @@ void VoxelMesher::_bind_methods() {
ClassDB::bind_method(D_METHOD("add_chunk", "chunk"), &VoxelMesher::add_chunk_bind); ClassDB::bind_method(D_METHOD("add_chunk", "chunk"), &VoxelMesher::add_chunk_bind);
ClassDB::bind_method(D_METHOD("add_chunk_liquid", "chunk"), &VoxelMesher::add_chunk_liquid_bind); ClassDB::bind_method(D_METHOD("add_chunk_liquid", "chunk"), &VoxelMesher::add_chunk_liquid_bind);
ClassDB::bind_method(D_METHOD("add_mesh_data_resource", "mesh", "position", "rotation", "scale", "uv_rect"), &VoxelMesher::add_mesh_data_resource, DEFVAL(Rect2(0, 0, 1, 1)), DEFVAL(Vector3(1.0, 1.0, 1.0)), DEFVAL(Vector3()), DEFVAL(Vector3())); ClassDB::bind_method(D_METHOD("add_mesh_data_resource", "mesh", "position", "rotation", "scale", "uv_rect"), &VoxelMesher::add_mesh_data_resource, DEFVAL(Rect2(0, 0, 1, 1)), DEFVAL(Vector3(1.0, 1.0, 1.0)), DEFVAL(Vector3()), DEFVAL(Vector3()));
ClassDB::bind_method(D_METHOD("add_mesh_data_resource_transform", "mesh", "transform", "uv_rect"), &VoxelMesher::add_mesh_data_resource_transform, DEFVAL(Rect2(0, 0, 1, 1))); ClassDB::bind_method(D_METHOD("add_mesh_data_resource_transform", "mesh", "transform", "uv_rect"), &VoxelMesher::add_mesh_data_resource_transform, DEFVAL(Rect2(0, 0, 1, 1)));

View File

@ -1,23 +1,23 @@
#ifndef VOXEL_TOOLS_H #ifndef VOXEL_TOOLS_H
#define VOXEL_TOOLS_H #define VOXEL_TOOLS_H
#include "core/reference.h"
#include "core/color.h" #include "core/color.h"
#include "core/math/rect2.h"
#include "core/math/vector2.h" #include "core/math/vector2.h"
#include "core/math/vector3.h" #include "core/math/vector3.h"
#include "core/math/rect2.h" #include "core/reference.h"
#include "core/vector.h" #include "core/vector.h"
#include "scene/3d/mesh_instance.h"
#include "scene/resources/material.h"
#include "scene/resources/mesh.h"
#include "scene/resources/surface_tool.h"
#include "scene/3d/immediate_geometry.h" #include "scene/3d/immediate_geometry.h"
#include "scene/3d/mesh_instance.h"
#include "scene/3d/spatial.h" #include "scene/3d/spatial.h"
#include "scene/main/node.h" #include "scene/main/node.h"
#include "scene/resources/concave_polygon_shape.h" #include "scene/resources/concave_polygon_shape.h"
#include "scene/resources/material.h"
#include "scene/resources/mesh.h"
#include "scene/resources/surface_tool.h"
#include "../library/voxelman_library.h"
#include "../../mesh_data_resource/mesh_data_resource.h" #include "../../mesh_data_resource/mesh_data_resource.h"
#include "../library/voxelman_library.h"
const double PI_2 = 3.141592653589793238463 / 2; const double PI_2 = 3.141592653589793238463 / 2;
const double PI = 3.141592653589793238463; const double PI = 3.141592653589793238463;

View File

@ -20,9 +20,9 @@ int VoxelMesherTransvoxel::get_regular_vertex_data(int index1, int index2) const
} }
//void VoxelMesherTransvoxel::set_regular_vertex_data(int index1, int index2, int value) { //void VoxelMesherTransvoxel::set_regular_vertex_data(int index1, int index2, int value) {
// ERR_FAIL_INDEX(index1, 256); // ERR_FAIL_INDEX(index1, 256);
// ERR_FAIL_INDEX(index2, 13); // ERR_FAIL_INDEX(index2, 13);
// regularVertexData[index1][index2] = value; // regularVertexData[index1][index2] = value;
//} //}
@ -108,7 +108,6 @@ Vector3 VoxelMesherTransvoxel::get_transition_vertex_direction(int index1, int i
return transvoxel_vertices[vert2] - transvoxel_vertices[vert1]; return transvoxel_vertices[vert2] - transvoxel_vertices[vert1];
} }
VoxelMesherTransvoxel::VoxelMesherTransvoxel() { VoxelMesherTransvoxel::VoxelMesherTransvoxel() {
for (int i = 0; i < 16; ++i) { for (int i = 0; i < 16; ++i) {
_regular_cell_datas[i] = Ref<TransvoxelCellData>(memnew(TransvoxelCellData(regularCellData[i]))); _regular_cell_datas[i] = Ref<TransvoxelCellData>(memnew(TransvoxelCellData(regularCellData[i])));
@ -117,11 +116,9 @@ VoxelMesherTransvoxel::VoxelMesherTransvoxel() {
for (int i = 0; i < 56; ++i) { for (int i = 0; i < 56; ++i) {
_transition_cell_data[i] = Ref<TransvoxelCellData>(memnew(TransvoxelCellData(transitionCellData[i]))); _transition_cell_data[i] = Ref<TransvoxelCellData>(memnew(TransvoxelCellData(transitionCellData[i])));
} }
} }
VoxelMesherTransvoxel::~VoxelMesherTransvoxel() { VoxelMesherTransvoxel::~VoxelMesherTransvoxel() {
} }
void VoxelMesherTransvoxel::_bind_methods() { void VoxelMesherTransvoxel::_bind_methods() {
@ -130,7 +127,7 @@ void VoxelMesherTransvoxel::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_regular_cell_class", "index"), &VoxelMesherTransvoxel::get_regular_cell_class); ClassDB::bind_method(D_METHOD("get_regular_cell_class", "index"), &VoxelMesherTransvoxel::get_regular_cell_class);
ClassDB::bind_method(D_METHOD("get_regular_cell_data", "index"), &VoxelMesherTransvoxel::get_regular_cell_data); ClassDB::bind_method(D_METHOD("get_regular_cell_data", "index"), &VoxelMesherTransvoxel::get_regular_cell_data);
ClassDB::bind_method(D_METHOD("get_regular_vertex_data", "index1", "index2"), &VoxelMesherTransvoxel::get_regular_vertex_data); ClassDB::bind_method(D_METHOD("get_regular_vertex_data", "index1", "index2"), &VoxelMesherTransvoxel::get_regular_vertex_data);
// ClassDB::bind_method(D_METHOD("set_regular_vertex_data", "index1", "index2", "value"), &VoxelMesherTransvoxel::set_regular_vertex_data); // ClassDB::bind_method(D_METHOD("set_regular_vertex_data", "index1", "index2", "value"), &VoxelMesherTransvoxel::set_regular_vertex_data);
ClassDB::bind_method(D_METHOD("get_regular_vertex_data_first_vertex", "index1", "index2"), &VoxelMesherTransvoxel::get_regular_vertex_data_first_vertex); ClassDB::bind_method(D_METHOD("get_regular_vertex_data_first_vertex", "index1", "index2"), &VoxelMesherTransvoxel::get_regular_vertex_data_first_vertex);
ClassDB::bind_method(D_METHOD("get_regular_vertex_data_second_vertex", "index1", "index2"), &VoxelMesherTransvoxel::get_regular_vertex_data_second_vertex); ClassDB::bind_method(D_METHOD("get_regular_vertex_data_second_vertex", "index1", "index2"), &VoxelMesherTransvoxel::get_regular_vertex_data_second_vertex);
ClassDB::bind_method(D_METHOD("get_regular_vertex_first_position", "index1", "index2"), &VoxelMesherTransvoxel::get_regular_vertex_first_position); ClassDB::bind_method(D_METHOD("get_regular_vertex_first_position", "index1", "index2"), &VoxelMesherTransvoxel::get_regular_vertex_first_position);

View File

@ -49,7 +49,7 @@ public:
Ref<TransvoxelCellData> get_regular_cell_data(int index) const; Ref<TransvoxelCellData> get_regular_cell_data(int index) const;
int get_regular_vertex_data(int index10, int index2) const; int get_regular_vertex_data(int index10, int index2) const;
// void set_regular_vertex_data(int index1, int index2, int value); // void set_regular_vertex_data(int index1, int index2, int value);
int get_regular_vertex_data_first_vertex(int index1, int index2) const; int get_regular_vertex_data_first_vertex(int index1, int index2) const;
int get_regular_vertex_data_second_vertex(int index1, int index2) const; int get_regular_vertex_data_second_vertex(int index1, int index2) const;
Vector3 get_regular_vertex_first_position(int index1, int index2) const; Vector3 get_regular_vertex_first_position(int index1, int index2) const;

View File

@ -88,7 +88,7 @@ void PropData::add_prop_lights_into(VoxelChunk *chunk, Transform parent_transfor
Transform t = parent_transform * pl->get_transform(); Transform t = parent_transform * pl->get_transform();
Vector3 px = t.origin / chunk->get_voxel_scale(); Vector3 px = t.origin / chunk->get_voxel_scale();
Ref<VoxelLight> vl; Ref<VoxelLight> vl;
vl.instance(); vl.instance();
vl->set_world_position(px.x + chunk->get_position_x() * chunk->get_size_x(), px.y + chunk->get_position_y() * chunk->get_size_y(), px.z + chunk->get_position_z() * chunk->get_size_z()); vl->set_world_position(px.x + chunk->get_position_x() * chunk->get_size_x(), px.y + chunk->get_position_y() * chunk->get_size_y(), px.z + chunk->get_position_z() * chunk->get_size_z());
@ -166,7 +166,6 @@ void PropData::add_meshes_into(Ref<VoxelMesher> mesher, Ref<TexturePacker> textu
else else
pdataprop->get_prop()->add_meshes_into(mesher, texture_packer, parent_transform * pmesh->get_transform(), snap_spatial); pdataprop->get_prop()->add_meshes_into(mesher, texture_packer, parent_transform * pmesh->get_transform(), snap_spatial);
} }
} }
} }
void PropData::add_meshes_into_bind(Ref<VoxelMesher> mesher, Ref<TexturePacker> texture_packer, Transform parent_transform, Node *snap_spatial) { void PropData::add_meshes_into_bind(Ref<VoxelMesher> mesher, Ref<TexturePacker> texture_packer, Transform parent_transform, Node *snap_spatial) {

View File

@ -1,12 +1,12 @@
#ifndef PROP_DATA_H #ifndef PROP_DATA_H
#define PROP_DATA_H #define PROP_DATA_H
#include "core/reference.h" #include "core/math/rect2.h"
#include "core/vector.h"
#include "core/math/transform.h" #include "core/math/transform.h"
#include "core/math/vector2.h" #include "core/math/vector2.h"
#include "core/math/vector3.h" #include "core/math/vector3.h"
#include "core/math/rect2.h" #include "core/reference.h"
#include "core/vector.h"
#include "servers/physics_server.h" #include "servers/physics_server.h"
@ -39,8 +39,8 @@ public:
Vector<Variant> get_props(); Vector<Variant> get_props();
void set_props(const Vector<Variant> &props); void set_props(const Vector<Variant> &props);
void add_textures_into(Ref<TexturePacker> texture_packer); void add_textures_into(Ref<TexturePacker> texture_packer);
void add_prop_lights_into(VoxelChunk *chunk, Transform parent_transform, bool allow_snap); void add_prop_lights_into(VoxelChunk *chunk, Transform parent_transform, bool allow_snap);
void add_prop_lights_into_bind(Node *chunk, Transform parent_transform, bool allow_snap); void add_prop_lights_into_bind(Node *chunk, Transform parent_transform, bool allow_snap);
void add_meshes_into(Ref<VoxelMesher> mesher, Ref<TexturePacker> texture_packer, Transform parent_transform, Spatial *snap_spatial = NULL); void add_meshes_into(Ref<VoxelMesher> mesher, Ref<TexturePacker> texture_packer, Transform parent_transform, Spatial *snap_spatial = NULL);

View File

@ -1,6 +1,5 @@
#include "prop_data_entity.h" #include "prop_data_entity.h"
int PropDataEntity::get_entity_data_id() const { int PropDataEntity::get_entity_data_id() const {
return _entity_data_id; return _entity_data_id;
} }

View File

@ -5,7 +5,7 @@
class PropDataEntity : public PropDataEntry { class PropDataEntity : public PropDataEntry {
GDCLASS(PropDataEntity, PropDataEntry); GDCLASS(PropDataEntity, PropDataEntry);
public: public:
int get_entity_data_id() const; int get_entity_data_id() const;
void set_entity_data_id(const int value); void set_entity_data_id(const int value);

View File

@ -8,10 +8,8 @@ void PropDataEntry::set_transform(const Transform value) {
} }
PropDataEntry::PropDataEntry() { PropDataEntry::PropDataEntry() {
} }
PropDataEntry::~PropDataEntry() { PropDataEntry::~PropDataEntry() {
} }
void PropDataEntry::_bind_methods() { void PropDataEntry::_bind_methods() {

View File

@ -1,14 +1,13 @@
#ifndef PROP_DATA_DATA_H #ifndef PROP_DATA_DATA_H
#define PROP_DATA_DATA_H #define PROP_DATA_DATA_H
#include "core/resource.h"
#include "core/math/transform.h" #include "core/math/transform.h"
#include "core/resource.h"
class PropDataEntry : public Resource { class PropDataEntry : public Resource {
GDCLASS(PropDataEntry, Resource); GDCLASS(PropDataEntry, Resource);
public:
public:
Transform get_transform() const; Transform get_transform() const;
void set_transform(const Transform value); void set_transform(const Transform value);
@ -19,7 +18,6 @@ protected:
static void _bind_methods(); static void _bind_methods();
private: private:
Transform _transform; Transform _transform;
}; };

View File

@ -1,6 +1,5 @@
#include "prop_data_light.h" #include "prop_data_light.h"
Color PropDataLight::get_light_color() const { Color PropDataLight::get_light_color() const {
return _light_color; return _light_color;
} }

View File

@ -7,7 +7,7 @@
class PropDataLight : public PropDataEntry { class PropDataLight : public PropDataEntry {
GDCLASS(PropDataLight, PropDataEntry); GDCLASS(PropDataLight, PropDataEntry);
public: public:
Color get_light_color() const; Color get_light_color() const;
void set_light_color(const Color value); void set_light_color(const Color value);

View File

@ -1,8 +1,8 @@
#ifndef PROP_DATA_MESH_H #ifndef PROP_DATA_MESH_H
#define PROP_DATA_MESH_H #define PROP_DATA_MESH_H
#include "prop_data_entry.h"
#include "core/math/vector3.h" #include "core/math/vector3.h"
#include "prop_data_entry.h"
#include "scene/resources/texture.h" #include "scene/resources/texture.h"
@ -10,7 +10,7 @@
class PropDataMesh : public PropDataEntry { class PropDataMesh : public PropDataEntry {
GDCLASS(PropDataMesh, PropDataEntry); GDCLASS(PropDataMesh, PropDataEntry);
public: public:
Ref<MeshDataResource> get_mesh() const; Ref<MeshDataResource> get_mesh() const;
void set_mesh(const Ref<MeshDataResource> mesh); void set_mesh(const Ref<MeshDataResource> mesh);

View File

@ -1,14 +1,14 @@
#ifndef PROP_DATA_PROP_H #ifndef PROP_DATA_PROP_H
#define PROP_DATA_PROP_H #define PROP_DATA_PROP_H
#include "prop_data_entry.h"
#include "core/math/vector3.h" #include "core/math/vector3.h"
#include "prop_data_entry.h"
#include "prop_data.h" #include "prop_data.h"
class PropDataProp : public PropDataEntry { class PropDataProp : public PropDataEntry {
GDCLASS(PropDataProp, PropDataEntry); GDCLASS(PropDataProp, PropDataEntry);
public: public:
Ref<PropData> get_prop() const; Ref<PropData> get_prop() const;
void set_prop(const Ref<PropData> value); void set_prop(const Ref<PropData> value);

View File

@ -1,14 +1,14 @@
#ifndef PROP_DATA_SCENE_H #ifndef PROP_DATA_SCENE_H
#define PROP_DATA_SCENE_H #define PROP_DATA_SCENE_H
#include "prop_data_entry.h"
#include "core/math/vector3.h" #include "core/math/vector3.h"
#include "prop_data_entry.h"
#include "scene/resources/packed_scene.h" #include "scene/resources/packed_scene.h"
class PropDataScene : public PropDataEntry { class PropDataScene : public PropDataEntry {
GDCLASS(PropDataScene, PropDataEntry); GDCLASS(PropDataScene, PropDataEntry);
public: public:
Ref<PackedScene> get_scene() const; Ref<PackedScene> get_scene() const;
void set_scene(const Ref<PackedScene> value); void set_scene(const Ref<PackedScene> value);

View File

@ -4,34 +4,34 @@
#include "containers/voxelman_unbounded_queue.h" #include "containers/voxelman_unbounded_queue.h"
#include "library/voxel_surface.h" #include "library/voxel_surface.h"
#include "library/voxel_surface_simple.h"
#include "library/voxel_surface_merger.h" #include "library/voxel_surface_merger.h"
#include "library/voxel_surface_simple.h"
#include "library/voxelman_library.h" #include "library/voxelman_library.h"
#include "library/voxelman_library_simple.h"
#include "library/voxelman_library_merger.h" #include "library/voxelman_library_merger.h"
#include "library/voxelman_library_simple.h"
#include "data/voxel_light.h" #include "data/voxel_light.h"
#include "meshers/voxel_mesher.h"
#include "meshers/transvoxel_cell_data.h" #include "meshers/transvoxel_cell_data.h"
#include "meshers/voxel_mesher.h"
#include "meshers/voxel_mesher_transvoxel.h" #include "meshers/voxel_mesher_transvoxel.h"
#include "world/voxel_world.h"
#include "world/voxel_chunk.h"
#include "world/voxel_structure.h"
#include "world/environment_data.h" #include "world/environment_data.h"
#include "world/voxel_chunk.h"
#include "world/voxel_chunk_prop_data.h" #include "world/voxel_chunk_prop_data.h"
#include "world/voxel_structure.h"
#include "world/voxel_world.h"
#include "meshers/cubic_mesher/voxel_mesher_cubic.h"
#include "meshers/cubic_mesher/voxel_cube_points.h" #include "meshers/cubic_mesher/voxel_cube_points.h"
#include "meshers/cubic_mesher/voxel_mesher_cubic.h"
#include "props/prop_data.h" #include "props/prop_data.h"
#include "props/prop_data_entry.h"
#include "props/prop_data_scene.h"
#include "props/prop_data_mesh.h"
#include "props/prop_data_light.h"
#include "props/prop_data_prop.h"
#include "props/prop_data_entity.h" #include "props/prop_data_entity.h"
#include "props/prop_data_entry.h"
#include "props/prop_data_light.h"
#include "props/prop_data_mesh.h"
#include "props/prop_data_prop.h"
#include "props/prop_data_scene.h"
#include "level_generator/voxelman_level_generator.h" #include "level_generator/voxelman_level_generator.h"
@ -40,9 +40,8 @@
#include "clutter/ground_clutter.h" #include "clutter/ground_clutter.h"
#include "clutter/ground_clutter_foliage.h" #include "clutter/ground_clutter_foliage.h"
void register_voxelman_types() { void register_voxelman_types() {
ClassDB::register_class<VoxelmanQueue>();\ ClassDB::register_class<VoxelmanQueue>();
ClassDB::register_class<VoxelmanUnboundedQueue>(); ClassDB::register_class<VoxelmanUnboundedQueue>();
ClassDB::register_class<VoxelMesher>(); ClassDB::register_class<VoxelMesher>();
@ -58,15 +57,15 @@ void register_voxelman_types() {
ClassDB::register_class<VoxelmanLibraryMerger>(); ClassDB::register_class<VoxelmanLibraryMerger>();
ClassDB::register_class<VoxelLight>(); ClassDB::register_class<VoxelLight>();
ClassDB::register_class<VoxelWorld>(); ClassDB::register_class<VoxelWorld>();
ClassDB::register_class<VoxelChunk>(); ClassDB::register_class<VoxelChunk>();
ClassDB::register_class<VoxelStructure>(); ClassDB::register_class<VoxelStructure>();
ClassDB::register_class<EnvironmentData>(); ClassDB::register_class<EnvironmentData>();
ClassDB::register_class<VoxelChunkPropData>(); ClassDB::register_class<VoxelChunkPropData>();
ClassDB::register_class<VoxelMesherCubic>(); ClassDB::register_class<VoxelMesherCubic>();
ClassDB::register_class<VoxelCubePoints>(); ClassDB::register_class<VoxelCubePoints>();
ClassDB::register_class<PropData>(); ClassDB::register_class<PropData>();
ClassDB::register_class<PropDataEntry>(); ClassDB::register_class<PropDataEntry>();
@ -75,15 +74,13 @@ void register_voxelman_types() {
ClassDB::register_class<PropDataLight>(); ClassDB::register_class<PropDataLight>();
ClassDB::register_class<PropDataProp>(); ClassDB::register_class<PropDataProp>();
ClassDB::register_class<PropDataEntity>(); ClassDB::register_class<PropDataEntity>();
ClassDB::register_class<VoxelmanLevelGenerator>(); ClassDB::register_class<VoxelmanLevelGenerator>();
ClassDB::register_class<WorldArea>(); ClassDB::register_class<WorldArea>();
ClassDB::register_class<GroundClutterFoliage>(); ClassDB::register_class<GroundClutterFoliage>();
}
void unregister_voxelman_types() {
} }
void unregister_voxelman_types() {
}

View File

@ -1,11 +1,11 @@
#ifndef ENVIRONMENT_DATA_H #ifndef ENVIRONMENT_DATA_H
#define ENVIRONMENT_DATA_H #define ENVIRONMENT_DATA_H
#include "core/resource.h"
#include "core/color.h" #include "core/color.h"
#include "scene/main/node.h" #include "core/resource.h"
#include "scene/3d/world_environment.h"
#include "scene/3d/light.h" #include "scene/3d/light.h"
#include "scene/3d/world_environment.h"
#include "scene/main/node.h"
class EnvironmentData : public Resource { class EnvironmentData : public Resource {
GDCLASS(EnvironmentData, Resource); GDCLASS(EnvironmentData, Resource);

View File

@ -83,11 +83,11 @@ void VoxelChunk::set_position(int x, int y, int z) {
_position_z = z; _position_z = z;
} }
_FORCE_INLINE_ int VoxelChunk::get_margin_start() const { _FORCE_INLINE_ int VoxelChunk::get_margin_start() const {
return _margin_start; return _margin_start;
} }
_FORCE_INLINE_ int VoxelChunk::get_margin_end() const { _FORCE_INLINE_ int VoxelChunk::get_margin_end() const {
return _margin_end; return _margin_end;
} }
Ref<VoxelmanLibrary> VoxelChunk::get_library() { Ref<VoxelmanLibrary> VoxelChunk::get_library() {
@ -216,7 +216,7 @@ void VoxelChunk::set_size(int size_x, int size_y, int size_z, int margin_start,
} }
for (int i = 0; i < _channels.size(); ++i) { for (int i = 0; i < _channels.size(); ++i) {
uint8_t * ch = _channels[i]; uint8_t *ch = _channels[i];
if (ch != NULL) { if (ch != NULL) {
memdelete_arr(ch); memdelete_arr(ch);
@ -245,7 +245,7 @@ uint8_t VoxelChunk::get_voxel(int x, int y, int z, int channel_index) const {
ERR_FAIL_INDEX_V(channel_index, _channels.size(), 0); ERR_FAIL_INDEX_V(channel_index, _channels.size(), 0);
ERR_FAIL_COND_V(!validate_channel_data_position(x, y, z), 0); ERR_FAIL_COND_V(!validate_channel_data_position(x, y, z), 0);
uint8_t * ch = _channels.get(channel_index); uint8_t *ch = _channels.get(channel_index);
if (!ch) if (!ch)
return 0; return 0;
@ -267,7 +267,7 @@ void VoxelChunk::set_channel_count(int count) {
if (_channels.size() >= count) { if (_channels.size() >= count) {
for (int i = count; i < _channels.size(); ++i) { for (int i = count; i < _channels.size(); ++i) {
uint8_t * ch = _channels[i]; uint8_t *ch = _channels[i];
if (ch != NULL) { if (ch != NULL) {
memdelete_arr(ch); memdelete_arr(ch);
@ -287,12 +287,12 @@ void VoxelChunk::set_channel_count(int count) {
} }
void VoxelChunk::allocate_channel(int channel_index, uint8_t default_value) { void VoxelChunk::allocate_channel(int channel_index, uint8_t default_value) {
ERR_FAIL_INDEX(channel_index, _channels.size()); ERR_FAIL_INDEX(channel_index, _channels.size());
if (_channels[channel_index] != NULL) if (_channels[channel_index] != NULL)
return; return;
uint32_t size = _data_size_x * _data_size_y * _data_size_z; uint32_t size = _data_size_x * _data_size_y * _data_size_z;
uint8_t *ch = memnew_arr(uint8_t, size); uint8_t *ch = memnew_arr(uint8_t, size);
memset(ch, default_value, size); memset(ch, default_value, size);
@ -309,7 +309,7 @@ void VoxelChunk::fill_channel(uint8_t value, int channel_index) {
} }
uint32_t size = get_data_size(); uint32_t size = get_data_size();
for (int i = 0; i < size; ++i) { for (int i = 0; i < size; ++i) {
ch[i] = value; ch[i] = value;
} }
@ -321,7 +321,7 @@ void VoxelChunk::dealloc_channel(int channel_index) {
if (ch != NULL) { if (ch != NULL) {
memdelete_arr(ch); memdelete_arr(ch);
_channels.set(channel_index, NULL); _channels.set(channel_index, NULL);
} }
} }
@ -576,13 +576,13 @@ void VoxelChunk::_build_phase(int phase) {
if (_clutter_mesh_instance_rid != RID()) if (_clutter_mesh_instance_rid != RID())
VS::get_singleton()->instance_set_visible(_clutter_mesh_instance_rid, is_visible()); VS::get_singleton()->instance_set_visible(_clutter_mesh_instance_rid, is_visible());
next_phase(); next_phase();
return; return;
} }
} }
next_phase(); next_phase();
} }
@ -842,7 +842,6 @@ void VoxelChunk::allocate_prop_mesh() {
VS::get_singleton()->instance_set_transform(_prop_mesh_instance_rid, Transform(Basis(), Vector3(_position_x * _size_x * _voxel_scale, _position_y * _size_y * _voxel_scale, _position_z * _size_z * _voxel_scale))); VS::get_singleton()->instance_set_transform(_prop_mesh_instance_rid, Transform(Basis(), Vector3(_position_x * _size_x * _voxel_scale, _position_y * _size_y * _voxel_scale, _position_z * _size_z * _voxel_scale)));
} }
void VoxelChunk::free_prop_mesh() { void VoxelChunk::free_prop_mesh() {
if (_prop_mesh_instance_rid != RID()) { if (_prop_mesh_instance_rid != RID()) {
VS::get_singleton()->free(_prop_mesh_instance_rid); VS::get_singleton()->free(_prop_mesh_instance_rid);
@ -1117,7 +1116,7 @@ VoxelChunk::~VoxelChunk() {
_props.clear(); _props.clear();
for (int i = 0; i < _channels.size(); ++i) { for (int i = 0; i < _channels.size(); ++i) {
uint8_t * ch = _channels[i]; uint8_t *ch = _channels[i];
if (ch != NULL) { if (ch != NULL) {
memdelete_arr(ch); memdelete_arr(ch);
@ -1186,7 +1185,6 @@ void VoxelChunk::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_size_z"), &VoxelChunk::get_size_z); ClassDB::bind_method(D_METHOD("get_size_z"), &VoxelChunk::get_size_z);
ADD_PROPERTY(PropertyInfo(Variant::INT, "size_z"), "", "get_size_z"); ADD_PROPERTY(PropertyInfo(Variant::INT, "size_z"), "", "get_size_z");
ClassDB::bind_method(D_METHOD("get_data_size_x"), &VoxelChunk::get_data_size_x); ClassDB::bind_method(D_METHOD("get_data_size_x"), &VoxelChunk::get_data_size_x);
ADD_PROPERTY(PropertyInfo(Variant::INT, "data_size_x"), "", "get_data_size_x"); ADD_PROPERTY(PropertyInfo(Variant::INT, "data_size_x"), "", "get_data_size_x");
@ -1196,7 +1194,6 @@ void VoxelChunk::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_data_size_z"), &VoxelChunk::get_data_size_z); ClassDB::bind_method(D_METHOD("get_data_size_z"), &VoxelChunk::get_data_size_z);
ADD_PROPERTY(PropertyInfo(Variant::INT, "data_size_z"), "", "get_data_size_z"); ADD_PROPERTY(PropertyInfo(Variant::INT, "data_size_z"), "", "get_data_size_z");
ClassDB::bind_method(D_METHOD("get_position"), &VoxelChunk::get_position); ClassDB::bind_method(D_METHOD("get_position"), &VoxelChunk::get_position);
ClassDB::bind_method(D_METHOD("get_size"), &VoxelChunk::get_size); ClassDB::bind_method(D_METHOD("get_size"), &VoxelChunk::get_size);
ClassDB::bind_method(D_METHOD("set_position", "x", "y", "z"), &VoxelChunk::set_position); ClassDB::bind_method(D_METHOD("set_position", "x", "y", "z"), &VoxelChunk::set_position);
@ -1204,7 +1201,6 @@ void VoxelChunk::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_margin_start"), &VoxelChunk::get_margin_start); ClassDB::bind_method(D_METHOD("get_margin_start"), &VoxelChunk::get_margin_start);
ClassDB::bind_method(D_METHOD("get_margin_end"), &VoxelChunk::get_margin_end); ClassDB::bind_method(D_METHOD("get_margin_end"), &VoxelChunk::get_margin_end);
ClassDB::bind_method(D_METHOD("get_library"), &VoxelChunk::get_library); ClassDB::bind_method(D_METHOD("get_library"), &VoxelChunk::get_library);
ClassDB::bind_method(D_METHOD("set_library", "value"), &VoxelChunk::set_library); ClassDB::bind_method(D_METHOD("set_library", "value"), &VoxelChunk::set_library);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "library", PROPERTY_HINT_RESOURCE_TYPE, "VoxelmanLibrary"), "set_library", "get_library"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "library", PROPERTY_HINT_RESOURCE_TYPE, "VoxelmanLibrary"), "set_library", "get_library");
@ -1385,5 +1381,4 @@ void VoxelChunk::_bind_methods() {
BIND_ENUM_CONSTANT(DEFAULT_CHANNEL_LIQUID_FILL); BIND_ENUM_CONSTANT(DEFAULT_CHANNEL_LIQUID_FILL);
BIND_ENUM_CONSTANT(DEFAULT_CHANNEL_LIQUID_FLOW); BIND_ENUM_CONSTANT(DEFAULT_CHANNEL_LIQUID_FLOW);
BIND_ENUM_CONSTANT(MAX_DEFAULT_CHANNELS); BIND_ENUM_CONSTANT(MAX_DEFAULT_CHANNELS);
} }

View File

@ -4,17 +4,17 @@
#include "scene/3d/spatial.h" #include "scene/3d/spatial.h"
#include "core/engine.h" #include "core/engine.h"
#include "core/ustring.h"
#include "core/os/thread.h" #include "core/os/thread.h"
#include "core/os/thread_safe.h" #include "core/os/thread_safe.h"
#include "core/ustring.h"
#include "scene/3d/mesh_instance.h"
#include "scene/resources/packed_scene.h"
#include "core/array.h" #include "core/array.h"
#include "scene/3d/collision_shape.h" #include "scene/3d/collision_shape.h"
#include "scene/3d/mesh_instance.h"
#include "scene/3d/physics_body.h" #include "scene/3d/physics_body.h"
#include "scene/resources/concave_polygon_shape.h"
#include "scene/3d/spatial.h" #include "scene/3d/spatial.h"
#include "scene/resources/concave_polygon_shape.h"
#include "scene/resources/packed_scene.h"
#include "voxel_world.h" #include "voxel_world.h"
@ -29,9 +29,9 @@
#include "../../mesh_data_resource/mesh_data_resource.h" #include "../../mesh_data_resource/mesh_data_resource.h"
#include "../props/prop_data.h" #include "../props/prop_data.h"
#include "../props/prop_data_entry.h" #include "../props/prop_data_entry.h"
#include "../props/prop_data_scene.h"
#include "../props/prop_data_mesh.h"
#include "../props/prop_data_light.h" #include "../props/prop_data_light.h"
#include "../props/prop_data_mesh.h"
#include "../props/prop_data_scene.h"
#include "voxel_chunk_prop_data.h" #include "voxel_chunk_prop_data.h"
class VoxelWorld; class VoxelWorld;
@ -72,7 +72,7 @@ public:
DEFAULT_CHANNEL_LIGHT_COLOR_R, DEFAULT_CHANNEL_LIGHT_COLOR_R,
DEFAULT_CHANNEL_LIGHT_COLOR_G, DEFAULT_CHANNEL_LIGHT_COLOR_G,
DEFAULT_CHANNEL_LIGHT_COLOR_B, DEFAULT_CHANNEL_LIGHT_COLOR_B,
DEFAULT_CHANNEL_AO, DEFAULT_CHANNEL_AO,
DEFAULT_CHANNEL_RANDOM_AO, DEFAULT_CHANNEL_RANDOM_AO,
DEFAULT_CHANNEL_LIQUID_TYPES, DEFAULT_CHANNEL_LIQUID_TYPES,
DEFAULT_CHANNEL_LIQUID_FILL, DEFAULT_CHANNEL_LIQUID_FILL,
@ -177,11 +177,11 @@ public:
uint32_t get_data_index(uint32_t x, uint32_t y, uint32_t z) const; uint32_t get_data_index(uint32_t x, uint32_t y, uint32_t z) const;
uint32_t get_data_size() const; uint32_t get_data_size() const;
//Data Management functions //Data Management functions
void generate_ao(); void generate_ao();
void add_light(int local_x, int local_y, int local_z, int size, Color color); void add_light(int local_x, int local_y, int local_z, int size, Color color);
void clear_baked_lights(); void clear_baked_lights();
//Meshing //Meshing
@ -195,7 +195,7 @@ public:
void build_phase(); void build_phase();
void _build_phase(int phase); void _build_phase(int phase);
void next_phase(); void next_phase();
void clear(); void clear();
//Colliders //Colliders
@ -211,13 +211,13 @@ public:
void clear_voxel_lights(); void clear_voxel_lights();
void add_lights_into(Array target); void add_lights_into(Array target);
void add_unique_lights_into(Array target); void add_unique_lights_into(Array target);
Array get_lights(); Array get_lights();
void bake_lights(); void bake_lights();
void bake_light(Ref<VoxelLight> light); void bake_light(Ref<VoxelLight> light);
void add_prop_light(Ref<VoxelLight> light); void add_prop_light(Ref<VoxelLight> light);
//props //props
void add_prop(Ref<VoxelChunkPropData> prop); void add_prop(Ref<VoxelChunkPropData> prop);
@ -226,20 +226,20 @@ public:
void remove_prop(int index); void remove_prop(int index);
void clear_props(); void clear_props();
void process_props(); void process_props();
void build_prop_meshes(); void build_prop_meshes();
void build_prop_collider(); void build_prop_collider();
void free_spawn_props(); void free_spawn_props();
//Meshes //Meshes
void allocate_main_mesh(); void allocate_main_mesh();
void free_main_mesh(); void free_main_mesh();
void allocate_prop_mesh(); void allocate_prop_mesh();
void free_prop_mesh(); void free_prop_mesh();
void allocate_prop_colliders(); void allocate_prop_colliders();
void free_prop_colliders(); void free_prop_colliders();
void allocate_liquid_mesh(); void allocate_liquid_mesh();

View File

@ -1,18 +1,18 @@
#ifndef VOXEL_CHUNK_PROP_DATA_H #ifndef VOXEL_CHUNK_PROP_DATA_H
#define VOXEL_CHUNK_PROP_DATA_H #define VOXEL_CHUNK_PROP_DATA_H
#include "core/reference.h"
#include "core/math/vector3.h" #include "core/math/vector3.h"
#include "core/reference.h"
#include "scene/resources/texture.h" #include "../../mesh_data_resource/mesh_data_resource.h"
#include "scene/resources/packed_scene.h"
#include "../props/prop_data.h" #include "../props/prop_data.h"
#include "../props/prop_data_light.h" #include "../props/prop_data_light.h"
#include "../../mesh_data_resource/mesh_data_resource.h" #include "scene/resources/packed_scene.h"
#include "scene/resources/texture.h"
class VoxelChunkPropData : public Reference { class VoxelChunkPropData : public Reference {
GDCLASS(VoxelChunkPropData, Reference); GDCLASS(VoxelChunkPropData, Reference);
public: public:
int get_x(); int get_x();
void set_x(int value); void set_x(int value);

View File

@ -45,7 +45,7 @@ void VoxelStructure::set_world_position_z(const int value) {
VoxelChunk *VoxelStructure::get_chunk_voxel_pos(int x, int y, int z) { VoxelChunk *VoxelStructure::get_chunk_voxel_pos(int x, int y, int z) {
VoxelChunk *b = get_chunk(x / _chunk_size_x, y / _chunk_size_y, z / _chunk_size_z); VoxelChunk *b = get_chunk(x / _chunk_size_x, y / _chunk_size_y, z / _chunk_size_z);
/* /*
if (!b.is_valid()) { if (!b.is_valid()) {
b.instance(); b.instance();
@ -71,7 +71,6 @@ void VoxelStructure::set_voxel(int value, int x, int y, int z, unsigned int chan
} }
void add_chunk_bind(Node *chunk, const int x, const int y, const int z) { void add_chunk_bind(Node *chunk, const int x, const int y, const int z) {
} }
void VoxelStructure::add_chunk(VoxelChunk *chunk, const int x, const int y, const int z) { void VoxelStructure::add_chunk(VoxelChunk *chunk, const int x, const int y, const int z) {
//_chunks.set(Vector3i(x, y, z), chunk); //_chunks.set(Vector3i(x, y, z), chunk);

View File

@ -19,7 +19,6 @@ public:
int get_chunk_size_z() const; int get_chunk_size_z() const;
void set_chunk_size_z(const int value); void set_chunk_size_z(const int value);
int get_world_position_x() const; int get_world_position_x() const;
void set_world_position_x(const int value); void set_world_position_x(const int value);
@ -47,7 +46,7 @@ public:
VoxelStructure(); VoxelStructure();
~VoxelStructure(); ~VoxelStructure();
protected: protected:
static void _bind_methods(); static void _bind_methods();
@ -74,8 +73,8 @@ private:
int _world_position_y; int _world_position_y;
int _world_position_z; int _world_position_z;
HashMap<IntPos, VoxelChunk*, IntPosHasher> _chunks; HashMap<IntPos, VoxelChunk *, IntPosHasher> _chunks;
Vector<VoxelChunk*> _chunks_vector; Vector<VoxelChunk *> _chunks_vector;
}; };
#endif #endif

View File

@ -199,7 +199,6 @@ int VoxelWorld::get_generation_size() {
return _generating.size(); return _generating.size();
} }
void VoxelWorld::clear() { void VoxelWorld::clear() {
for (int i = 0; i < _chunks_vector.size(); ++i) { for (int i = 0; i < _chunks_vector.size(); ++i) {
_chunks_vector.get(i)->queue_delete(); _chunks_vector.get(i)->queue_delete();
@ -218,7 +217,7 @@ VoxelChunk *VoxelWorld::create_chunk(int x, int y, int z) {
Node *n = call("_create_chunk", x, y, z, np); Node *n = call("_create_chunk", x, y, z, np);
return(Object::cast_to<VoxelChunk>(n)); return (Object::cast_to<VoxelChunk>(n));
} }
VoxelChunk *VoxelWorld::_create_chunk(int x, int y, int z, Node *p_chunk) { VoxelChunk *VoxelWorld::_create_chunk(int x, int y, int z, Node *p_chunk) {
VoxelChunk *chunk; VoxelChunk *chunk;
@ -263,7 +262,6 @@ void VoxelWorld::generate_chunk(VoxelChunk *p_chunk) {
if (has_method("_prepare_chunk_for_generation")) if (has_method("_prepare_chunk_for_generation"))
call("_prepare_chunk_for_generation", p_chunk); call("_prepare_chunk_for_generation", p_chunk);
call("_generate_chunk", p_chunk); call("_generate_chunk", p_chunk);
p_chunk->build(); p_chunk->build();
@ -439,7 +437,7 @@ void VoxelWorld::_bind_methods() {
BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"))); BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk")));
ClassDB::bind_method(D_METHOD("create_chunk", "x", "y", "z"), &VoxelWorld::create_chunk); ClassDB::bind_method(D_METHOD("create_chunk", "x", "y", "z"), &VoxelWorld::create_chunk);
ClassDB::bind_method(D_METHOD("_create_chunk", "x", "y", "z", "chunk"), &VoxelWorld::_create_chunk); ClassDB::bind_method(D_METHOD("_create_chunk", "x", "y", "z", "chunk"), &VoxelWorld::_create_chunk);
ClassDB::bind_method(D_METHOD("_generate_chunk", "chunk"), &VoxelWorld::_generate_chunk); ClassDB::bind_method(D_METHOD("_generate_chunk", "chunk"), &VoxelWorld::_generate_chunk);
} }

View File

@ -1,13 +1,13 @@
#ifndef VOXEL_WORLD_H #ifndef VOXEL_WORLD_H
#define VOXEL_WORLD_H #define VOXEL_WORLD_H
#include "scene/3d/navigation.h"
#include "core/hash_map.h"
#include "core/engine.h" #include "core/engine.h"
#include "core/hash_map.h"
#include "scene/3d/navigation.h"
#include "../library/voxelman_library.h"
#include "../level_generator/voxelman_level_generator.h"
#include "../areas/world_area.h" #include "../areas/world_area.h"
#include "../level_generator/voxelman_level_generator.h"
#include "../library/voxelman_library.h"
#include "core/os/os.h" #include "core/os/os.h"
@ -17,29 +17,29 @@ class VoxelWorld : public Navigation {
GDCLASS(VoxelWorld, Navigation); GDCLASS(VoxelWorld, Navigation);
public: public:
int get_chunk_size_x() const; int get_chunk_size_x() const;
void set_chunk_size_x(const int value); void set_chunk_size_x(const int value);
int get_chunk_size_y() const;
void set_chunk_size_y(const int value);
int get_chunk_size_z() const;
void set_chunk_size_z(const int value);
int get_current_seed() const; int get_chunk_size_y() const;
void set_current_seed(const int value); void set_chunk_size_y(const int value);
int get_chunk_size_z() const;
void set_chunk_size_z(const int value);
int get_current_seed() const;
void set_current_seed(const int value);
bool get_use_threads(); bool get_use_threads();
void set_use_threads(bool value); void set_use_threads(bool value);
uint32_t get_max_concurrent_generations(); uint32_t get_max_concurrent_generations();
void set_max_concurrent_generations(uint32_t value); void set_max_concurrent_generations(uint32_t value);
Ref<VoxelmanLibrary> get_library() const; Ref<VoxelmanLibrary> get_library() const;
void set_library(const Ref<VoxelmanLibrary> library); void set_library(const Ref<VoxelmanLibrary> library);
Ref<VoxelmanLevelGenerator> get_level_generator() const; Ref<VoxelmanLevelGenerator> get_level_generator() const;
void set_level_generator(const Ref<VoxelmanLevelGenerator> level_generator); void set_level_generator(const Ref<VoxelmanLevelGenerator> level_generator);
float get_voxel_scale() const; float get_voxel_scale() const;
void set_voxel_scale(const float value); void set_voxel_scale(const float value);
@ -49,8 +49,8 @@ public:
NodePath get_player_path(); NodePath get_player_path();
void set_player_path(NodePath player_path); void set_player_path(NodePath player_path);
Spatial *get_player() const; Spatial *get_player() const;
void set_player(Spatial *player); void set_player(Spatial *player);
void set_player_bind(Node *player); void set_player_bind(Node *player);
@ -124,18 +124,18 @@ public:
}; };
private: private:
int _chunk_size_x; int _chunk_size_x;
int _chunk_size_y; int _chunk_size_y;
int _chunk_size_z; int _chunk_size_z;
int _current_seed; int _current_seed;
Ref<VoxelmanLibrary> _library; Ref<VoxelmanLibrary> _library;
Ref<VoxelmanLevelGenerator> _level_generator; Ref<VoxelmanLevelGenerator> _level_generator;
float _voxel_scale; float _voxel_scale;
int _chunk_spawn_range; int _chunk_spawn_range;
HashMap<IntPos, VoxelChunk *, IntPosHasher> _chunks; HashMap<IntPos, VoxelChunk *, IntPosHasher> _chunks;
Vector<VoxelChunk *> _chunks_vector; Vector<VoxelChunk *> _chunks_vector;
Vector<Ref<WorldArea> > _world_areas; Vector<Ref<WorldArea> > _world_areas;