mirror of
https://github.com/Relintai/terraman_2d.git
synced 2024-11-08 10:02:11 +01:00
Reimplemented world_transform_changed event in chunks. This fixes chunk poitions, but only in gles3. It turns out that the transform parameter of canvas render_mesh is not implemented in gles2.
This commit is contained in:
parent
1e056b03e2
commit
fb9bace145
@ -445,7 +445,7 @@ void Terrain2DChunkDefault::free_index(const int mesh_index) {
|
||||
|
||||
void Terrain2DChunkDefault::update_transforms() {
|
||||
RID empty_rid;
|
||||
//Transform t = get_transform();
|
||||
//Transform2D t = get_transform();
|
||||
|
||||
List<Variant> keys;
|
||||
|
||||
|
@ -1245,14 +1245,10 @@ void Terrain2DChunk::_generation_physics_process(const float delta) {
|
||||
}
|
||||
|
||||
void Terrain2DChunk::_world_transform_changed() {
|
||||
Transform2D wt;
|
||||
Transform2D t;
|
||||
t.set_origin( Vector2(_position_x * static_cast<int>(_size_x) * _voxel_scale, _position_z * static_cast<int>(_size_z) * _voxel_scale));
|
||||
|
||||
if (_voxel_world != NULL) {
|
||||
wt = _voxel_world->get_transform();
|
||||
}
|
||||
|
||||
//TODO
|
||||
//set_transform(wt * Transform(Basis(), Vector3(_position_x * static_cast<int>(_size_x) * _voxel_scale, 0, _position_z * static_cast<int>(_size_z) * _voxel_scale)));
|
||||
set_transform(t);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user