Prepared for buildings spawning
This commit is contained in:
@@ -480,6 +480,10 @@ void RoadsData::_bind_methods()
|
||||
ClassDB::bind_method(D_METHOD("get_road_grid"), &RoadsData::get_road_grid);
|
||||
ClassDB::bind_method(D_METHOD("get_sdf", "x", "y", "z"), &RoadsData::get_sdf);
|
||||
ClassDB::bind_method(D_METHOD("get_site_pos", "site"), &RoadsData::get_site_pos);
|
||||
ClassDB::bind_method(D_METHOD("get_site_polygon_2d", "site"), &RoadsData::get_site_polygon_2d);
|
||||
ClassDB::bind_method(D_METHOD("get_site_polygon_3d", "site"), &RoadsData::get_site_polygon_3d);
|
||||
ClassDB::bind_method(D_METHOD("get_here_sites", "site"), &RoadsData::get_here_sites);
|
||||
ClassDB::bind_method(D_METHOD("get_site_avg_height", "site"), &RoadsData::get_site_avg_height);
|
||||
}
|
||||
void RoadsData::set_noise(Ref<FastNoiseLite> noise)
|
||||
{
|
||||
@@ -516,7 +520,7 @@ float RoadsData::get_sdf(int x, int y, int z)
|
||||
int site = rg->get_site_from_point(x, z);
|
||||
// printf("in site %d %d %d\n", site, rg->site_is_town(site), rg->site_is_farm(site));
|
||||
if (site >= 0 && (rg->site_is_town(site) || rg->site_is_farm(site))) {
|
||||
ret = y - rg->get_site_avg_height(site);
|
||||
ret = y - rg->get_site_avg_height(site) - CLAMP(n * 0.1f, -0.5f, 0.5f);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@@ -530,3 +534,17 @@ Vector2 RoadsData::get_site_pos(int site)
|
||||
return rg->get_site_pos(site);
|
||||
}
|
||||
|
||||
PoolVector<Vector2> RoadsData::get_site_polygon_2d(int site)
|
||||
{
|
||||
return rg->get_site_polygon_2d(site);
|
||||
}
|
||||
|
||||
PoolVector<Vector3> RoadsData::get_site_polygon_3d(int site)
|
||||
{
|
||||
return rg->get_site_polygon_3d(site);
|
||||
}
|
||||
|
||||
PoolVector<int> RoadsData::get_here_sites(const Vector3 &position)
|
||||
{
|
||||
return rg->get_here_sites(position);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user