mirror of
https://github.com/Relintai/terraman_2d.git
synced 2024-11-14 10:17:23 +01:00
Removed world height.
This commit is contained in:
parent
93e3bb48c1
commit
936143b964
@ -109,7 +109,7 @@ _FORCE_INLINE_ Vector2 Terrain2DChunk::get_world_position() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_FORCE_INLINE_ Vector3 Terrain2DChunk::get_world_size() const {
|
_FORCE_INLINE_ Vector3 Terrain2DChunk::get_world_size() const {
|
||||||
return Vector3(_size_x * _voxel_scale, _world_height * _voxel_scale, _size_z * _voxel_scale);
|
return Vector3(_size_x * _voxel_scale, 0, _size_z * _voxel_scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
_FORCE_INLINE_ AABB Terrain2DChunk::get_world_aabb() const {
|
_FORCE_INLINE_ AABB Terrain2DChunk::get_world_aabb() const {
|
||||||
@ -133,7 +133,7 @@ _FORCE_INLINE_ void Terrain2DChunk::set_size_z(const int value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_FORCE_INLINE_ Vector3 Terrain2DChunk::get_size() const {
|
_FORCE_INLINE_ Vector3 Terrain2DChunk::get_size() const {
|
||||||
return Vector3(_size_x, _world_height, _size_z);
|
return Vector3(_size_x, 0, _size_z);
|
||||||
}
|
}
|
||||||
|
|
||||||
_FORCE_INLINE_ int Terrain2DChunk::get_data_size_x() const {
|
_FORCE_INLINE_ int Terrain2DChunk::get_data_size_x() const {
|
||||||
@ -150,13 +150,6 @@ _FORCE_INLINE_ void Terrain2DChunk::set_data_size_z(const int value) {
|
|||||||
_data_size_z = value;
|
_data_size_z = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
_FORCE_INLINE_ float Terrain2DChunk::get_world_height() const {
|
|
||||||
return _world_height;
|
|
||||||
}
|
|
||||||
void Terrain2DChunk::set_world_height(const float value) {
|
|
||||||
_world_height = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Terrain2DChunk::set_position(const int x, const int z) {
|
void Terrain2DChunk::set_position(const int x, const int z) {
|
||||||
_position_x = x;
|
_position_x = x;
|
||||||
_position_z = z;
|
_position_z = z;
|
||||||
@ -1115,8 +1108,6 @@ Terrain2DChunk::Terrain2DChunk() {
|
|||||||
|
|
||||||
_current_job = -1;
|
_current_job = -1;
|
||||||
|
|
||||||
_world_height = 256;
|
|
||||||
|
|
||||||
_queued_generation = false;
|
_queued_generation = false;
|
||||||
|
|
||||||
_canvas_item = VisualServer::get_singleton()->canvas_item_create();
|
_canvas_item = VisualServer::get_singleton()->canvas_item_create();
|
||||||
@ -1401,10 +1392,6 @@ void Terrain2DChunk::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("set_data_size_z"), &Terrain2DChunk::set_data_size_z);
|
ClassDB::bind_method(D_METHOD("set_data_size_z"), &Terrain2DChunk::set_data_size_z);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "data_size_z"), "set_data_size_z", "get_data_size_z");
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "data_size_z"), "set_data_size_z", "get_data_size_z");
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_world_height"), &Terrain2DChunk::get_world_height);
|
|
||||||
ClassDB::bind_method(D_METHOD("set_world_height", "height"), &Terrain2DChunk::set_world_height);
|
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "world_height"), "set_world_height", "get_world_height");
|
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_position"), &Terrain2DChunk::get_position);
|
ClassDB::bind_method(D_METHOD("get_position"), &Terrain2DChunk::get_position);
|
||||||
ClassDB::bind_method(D_METHOD("set_position", "x", "z"), &Terrain2DChunk::set_position);
|
ClassDB::bind_method(D_METHOD("set_position", "x", "z"), &Terrain2DChunk::set_position);
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ include_pool_vector
|
|||||||
//voxel scale remove (= cell size)
|
//voxel scale remove (= cell size)
|
||||||
//light ppu -> max(cell_size.x, cell_zise.y)
|
//light ppu -> max(cell_size.x, cell_zise.y)
|
||||||
//Props->ppu -> cell size
|
//Props->ppu -> cell size
|
||||||
//mesh gen-> dont scale images, put exact sized meshes, but on the grid
|
//mesh gen-> dont scale images, put exact sized meshes, but on the grid Also pivots (just a vector2 offset should work)
|
||||||
//Add custom mesh transform
|
//Add custom mesh transform
|
||||||
//world height remove
|
//world height remove
|
||||||
//create lods and use isolevel build flag remove
|
//create lods and use isolevel build flag remove
|
||||||
@ -92,6 +92,10 @@ include_pool_vector
|
|||||||
//Add wall layer (normal types, but gets a different mesh) ? -> TiledWalls are probably better, and they do this if props are fixed
|
//Add wall layer (normal types, but gets a different mesh) ? -> TiledWalls are probably better, and they do this if props are fixed
|
||||||
//Also if they are not merged they can be hidden one by one (even automatically)
|
//Also if they are not merged they can be hidden one by one (even automatically)
|
||||||
|
|
||||||
|
//mdi2d
|
||||||
|
//sprite -> convert to mdi2d
|
||||||
|
//meshinstance2d->mdi2d
|
||||||
|
|
||||||
class Terrain2DJob;
|
class Terrain2DJob;
|
||||||
class Terrain2DWorld;
|
class Terrain2DWorld;
|
||||||
class Terrain2DStructure;
|
class Terrain2DStructure;
|
||||||
@ -144,9 +148,6 @@ public:
|
|||||||
void set_data_size_x(const int value);
|
void set_data_size_x(const int value);
|
||||||
void set_data_size_z(const int value);
|
void set_data_size_z(const int value);
|
||||||
|
|
||||||
float get_world_height() const;
|
|
||||||
void set_world_height(const float value);
|
|
||||||
|
|
||||||
Vector2 get_position() const;
|
Vector2 get_position() const;
|
||||||
Vector3 get_size() const;
|
Vector3 get_size() const;
|
||||||
|
|
||||||
@ -417,8 +418,6 @@ protected:
|
|||||||
int _prop_material_cache_key;
|
int _prop_material_cache_key;
|
||||||
bool _prop_material_cache_key_has;
|
bool _prop_material_cache_key_has;
|
||||||
|
|
||||||
float _world_height;
|
|
||||||
|
|
||||||
Vector<uint8_t *> _channels;
|
Vector<uint8_t *> _channels;
|
||||||
|
|
||||||
float _voxel_scale;
|
float _voxel_scale;
|
||||||
|
@ -100,13 +100,6 @@ void Terrain2DWorld::set_current_seed(const int value) {
|
|||||||
_current_seed = value;
|
_current_seed = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
_FORCE_INLINE_ float Terrain2DWorld::get_world_height() const {
|
|
||||||
return _world_height;
|
|
||||||
}
|
|
||||||
void Terrain2DWorld::set_world_height(const float value) {
|
|
||||||
_world_height = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
int Terrain2DWorld::get_max_concurrent_generations() {
|
int Terrain2DWorld::get_max_concurrent_generations() {
|
||||||
return _max_concurrent_generations;
|
return _max_concurrent_generations;
|
||||||
}
|
}
|
||||||
@ -428,7 +421,6 @@ Ref<Terrain2DChunk> Terrain2DWorld::_create_chunk(const int x, const int z, Ref<
|
|||||||
chunk->set_voxel_world(this);
|
chunk->set_voxel_world(this);
|
||||||
|
|
||||||
chunk->set_position(x, z);
|
chunk->set_position(x, z);
|
||||||
chunk->set_world_height(_world_height);
|
|
||||||
chunk->set_library(_library);
|
chunk->set_library(_library);
|
||||||
chunk->set_voxel_scale(_voxel_scale);
|
chunk->set_voxel_scale(_voxel_scale);
|
||||||
chunk->set_size(_chunk_size_x, _chunk_size_z, _data_margin_start, _data_margin_end);
|
chunk->set_size(_chunk_size_x, _chunk_size_z, _data_margin_start, _data_margin_end);
|
||||||
@ -884,7 +876,6 @@ Terrain2DWorld::Terrain2DWorld() {
|
|||||||
_current_seed = 0;
|
_current_seed = 0;
|
||||||
_data_margin_start = 0;
|
_data_margin_start = 0;
|
||||||
_data_margin_end = 0;
|
_data_margin_end = 0;
|
||||||
_world_height = 256;
|
|
||||||
|
|
||||||
_voxel_scale = 1;
|
_voxel_scale = 1;
|
||||||
_chunk_spawn_range = 4;
|
_chunk_spawn_range = 4;
|
||||||
@ -1119,10 +1110,6 @@ void Terrain2DWorld::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("set_data_margin_end", "value"), &Terrain2DWorld::set_data_margin_end);
|
ClassDB::bind_method(D_METHOD("set_data_margin_end", "value"), &Terrain2DWorld::set_data_margin_end);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "data_margin_end"), "set_data_margin_end", "get_data_margin_end");
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "data_margin_end"), "set_data_margin_end", "get_data_margin_end");
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_world_height"), &Terrain2DWorld::get_world_height);
|
|
||||||
ClassDB::bind_method(D_METHOD("set_world_height", "height"), &Terrain2DWorld::set_world_height);
|
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "world_height"), "set_world_height", "get_world_height");
|
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_max_concurrent_generations"), &Terrain2DWorld::get_max_concurrent_generations);
|
ClassDB::bind_method(D_METHOD("get_max_concurrent_generations"), &Terrain2DWorld::get_max_concurrent_generations);
|
||||||
ClassDB::bind_method(D_METHOD("set_max_concurrent_generations", "height"), &Terrain2DWorld::set_max_concurrent_generations);
|
ClassDB::bind_method(D_METHOD("set_max_concurrent_generations", "height"), &Terrain2DWorld::set_max_concurrent_generations);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "max_concurrent_generations"), "set_max_concurrent_generations", "get_max_concurrent_generations");
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "max_concurrent_generations"), "set_max_concurrent_generations", "get_max_concurrent_generations");
|
||||||
|
@ -89,9 +89,6 @@ public:
|
|||||||
int get_current_seed() const;
|
int get_current_seed() const;
|
||||||
void set_current_seed(const int value);
|
void set_current_seed(const int value);
|
||||||
|
|
||||||
float get_world_height() const;
|
|
||||||
void set_world_height(const float value);
|
|
||||||
|
|
||||||
int get_max_concurrent_generations();
|
int get_max_concurrent_generations();
|
||||||
void set_max_concurrent_generations(const int value);
|
void set_max_concurrent_generations(const int value);
|
||||||
|
|
||||||
@ -260,7 +257,6 @@ private:
|
|||||||
int _current_seed;
|
int _current_seed;
|
||||||
int _data_margin_start;
|
int _data_margin_start;
|
||||||
int _data_margin_end;
|
int _data_margin_end;
|
||||||
float _world_height;
|
|
||||||
|
|
||||||
Ref<Terrain2DLibrary> _library;
|
Ref<Terrain2DLibrary> _library;
|
||||||
Ref<Terrain2DLevelGenerator> _level_generator;
|
Ref<Terrain2DLevelGenerator> _level_generator;
|
||||||
|
Loading…
Reference in New Issue
Block a user