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:
Relintai 2022-02-24 12:44:02 +01:00
parent 1e056b03e2
commit fb9bace145
2 changed files with 4 additions and 8 deletions

View File

@ -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;

View File

@ -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);
}
/*