diff options
Diffstat (limited to 'game')
-rw-r--r-- | game/src/Game/GameSession/BillboardManager.gd | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/game/src/Game/GameSession/BillboardManager.gd b/game/src/Game/GameSession/BillboardManager.gd index ac1610b..298d3a8 100644 --- a/game/src/Game/GameSession/BillboardManager.gd +++ b/game/src/Game/GameSession/BillboardManager.gd @@ -47,32 +47,18 @@ func _ready(): multimesh.mesh.surface_set_material(0,material) - # Need to have one instance for every province - # need to get a list of province centers - #GameSingleton.get_mapmode_identifier(0) - #GameSingleton.get_mapmode_count() - - var positions_len = MapItemSingleton.get_province_count() - - - print(positions_len) - # Then resize (otherwise, changing the format is not allowed). - multimesh.instance_count = positions_len - multimesh.visible_instance_count = positions_len - print("===============") var positions = MapItemSingleton.get_province_positions() - print("===============") + + # Then resize (otherwise, changing the format is not allowed). + multimesh.instance_count = positions.size() + multimesh.visible_instance_count = positions.size() + var map_positions : PackedVector3Array = PackedVector3Array() for pos_in in positions: - var pos = _map_view._map_to_world_coords(pos_in)# + Vector3(0, 0.5 * SCALE_FACTOR, 0) + var pos = _map_view._map_to_world_coords(pos_in) map_positions.push_back(pos) - #print(positions) - #print(positions.size()) - # Set the transform of the instances. - #model.set_position( - #_map_view._map_to_world_coords(unit_dict[position_key]) - # + Vector3(0, 0.1 * MODEL_SCALE, 0)) + for i in multimesh.visible_instance_count: multimesh.set_instance_transform(i, Transform3D(Basis(), map_positions[i] |