Jump to content

[SOLVED] Precipitations - IG plugin


photo

Recommended Posts

Posted

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.

Posted

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:

Posted

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 :

 

image.thumb.png.7bb327dc73b86f741773573e99fdc8a7.png

 

Thank you.

test_raining.zip

Posted

Hello!
you should add
setPrecipitationIntensity(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

Posted
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.
Posted

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();

 

Posted (edited)

Thank you for your help. I need a separate global layer for rain otherwise it conflicts with  clouds altitude.

Now it works.

image.png.885e62c2368c1352eee2f5709dc38b17.png

 

 

Edited by michal
  • morbid changed the title to [SOLVED] Precipitations - IG plugin
×
×
  • Create New...