michal Posted October 11, 2019 Share Posted October 11, 2019 Hello, i wonder how to control the weather only via the IG plugin. According to the documentation, there are 5 layers active. But I have no regions. meteo.getNumRegions () returns 0. What about the layers, is it only for CIGI? I am trying to start raining, but not working. I can only manage the clouds through my added global region. How should I proceed if I want to activate raining? Thanks for your help. Link to comment
morbid Posted October 11, 2019 Share Posted October 11, 2019 Hello Michal, Firstly you need to create a region with addRegion and specify its type (global/local). Then you can control the region with IG::IRegion. To start raining use setPrecipitationType. Please note, that rain/snow/etc. in the local region wouldn't be visible outside of this region. If you experiencing problems with this task, please, send us a test scene (source and data folders). Thank you. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
michal Posted October 11, 2019 Author Share Posted October 11, 2019 I created the project from the IG template . The test project is attached. Clouds are fine but rain is missing. In short, the main part : Thank you. test_raining.zip Link to comment
cash-metall Posted October 14, 2019 Share Posted October 14, 2019 Hello! you should addsetPrecipitationIntensity(1) setPrecipitationSize(1) by default they are 0. These methods take range from 0.0f to 1.0f also meteo.refresh() call refresh() for all regions Link to comment
michal Posted October 14, 2019 Author Share Posted October 14, 2019 Hi, there are no other regions, only one global. (not even 5 global weather layers, as mentioned in the documentation) Unfortunately, this change didn't work. Link to comment
cash-metall Posted October 15, 2019 Share Posted October 15, 2019 the plane was not within the region. auto global_region = ig_manager->getMeteo()->addRegion(0); global_region->setEnabled(true); global_region->setType(0); global_region->setAltitude(1000.0); // Sets altitude of the base (bottom) of the layer of the weather region. Entity in winterthur_geopos.z = 1000 global_region->setVisibilityDistance(constants::global_visiblity); global_region->setCloudDensity(0.8f); global_region->setCloudTypeByEnum(constants::stratus_type); global_region->setThickness(500.0); // Sets vertical layer thickness for the weather region. The altitude of the top of the layer is equal to this value plus altitude global_region->setPrecipitationType(2); global_region->setPrecipitationIntensity(1); global_region->setPrecipitationSize(1); ig_manager->getMeteo()->refresh(); Link to comment
michal Posted October 15, 2019 Author Share Posted October 15, 2019 (edited) Thank you for your help. I need a separate global layer for rain otherwise it conflicts with clouds altitude. Now it works. Edited October 15, 2019 by michal Link to comment
Recommended Posts