| 136 | | while (arguments.read("--snow", intensity)) parameters.snow(intensity); |
| 137 | | while (arguments.read("--rain", intensity)) parameters.rain(intensity); |
| 138 | | |
| 139 | | while (arguments.read("--particleSize", parameters.particleSize)) {} |
| 140 | | while (arguments.read("--particleColor", parameters.particleColour.r(), parameters.particleColour.g(), parameters.particleColour.b(), parameters.particleColour.a())) {} |
| 141 | | while (arguments.read("--particleColour", parameters.particleColour.r(), parameters.particleColour.g(), parameters.particleColour.b(), parameters.particleColour.a())) {} |
| | 135 | while (arguments.read("--snow", intensity)) precipitationEffect->snow(intensity); |
| | 136 | while (arguments.read("--rain", intensity)) precipitationEffect->rain(intensity); |
| | 137 | |
| | 138 | float value; |
| | 139 | while (arguments.read("--particleSize", value)) precipitationEffect->setParticleSize(value); |
| | 140 | |
| | 141 | osg::Vec4 color; |
| | 142 | while (arguments.read("--particleColor", color.r(), color.g(), color.b(), color.a())) precipitationEffect->setParticleColor(color); |
| | 143 | while (arguments.read("--particleColour", color.r(), color.g(), color.b(), color.a())) precipitationEffect->setParticleColor(color); |
| 144 | | while (arguments.read("--wind", wind.x(), wind.y(), wind.z())) parameters.wind = wind; |
| 145 | | |
| 146 | | while (arguments.read("--particleVelocity", parameters.particleVelocity)) {} |
| 147 | | |
| 148 | | while (arguments.read("--nearTransition", parameters.nearTransition )) {} |
| 149 | | while (arguments.read("--farTransition", parameters.farTransition )) {} |
| 150 | | |
| 151 | | while (arguments.read("--particleDensity", parameters.particleDensity )) {} |
| 152 | | |
| 153 | | while (arguments.read("--cellSizeX", parameters.cellSizeX )) {} |
| 154 | | while (arguments.read("--cellSizeY", parameters.cellSizeY )) {} |
| 155 | | while (arguments.read("--cellSizeZ", parameters.cellSizeZ )) {} |
| 156 | | |
| 157 | | while (arguments.read("--boundingBox", parameters.boundingBox.xMin(), |
| 158 | | parameters.boundingBox.yMin(), |
| 159 | | parameters.boundingBox.zMin(), |
| 160 | | parameters.boundingBox.xMax(), |
| 161 | | parameters.boundingBox.yMax(), |
| 162 | | parameters.boundingBox.zMax())) {} |
| 163 | | |
| 164 | | while (arguments.read("--fogDensity", parameters.fogDensity )) {} |
| 165 | | while (arguments.read("--fogExponent", parameters.fogExponent )) {} |
| 166 | | while (arguments.read("--fogEnd", parameters.fogEnd )) {} |
| 167 | | while (arguments.read("--fogColor", parameters.fogColour.r(), parameters.fogColour.g(), parameters.fogColour.b(), parameters.fogColour.a())) {} |
| 168 | | while (arguments.read("--fogColour", parameters.fogColour.r(), parameters.fogColour.g(), parameters.fogColour.b(), parameters.fogColour.a())) {} |
| | 146 | while (arguments.read("--wind", wind.x(), wind.y(), wind.z())) precipitationEffect->setWind(wind); |
| | 147 | |
| | 148 | while (arguments.read("--particleSpeed", value)) precipitationEffect->setParticleSpeed(value); |
| | 149 | |
| | 150 | while (arguments.read("--nearTransition", value )) precipitationEffect->setNearTransition(value); |
| | 151 | while (arguments.read("--farTransition", value )) precipitationEffect->setFarTransition(value); |
| | 152 | |
| | 153 | while (arguments.read("--particleDensity", value )) precipitationEffect->setMaximumParticleDensity(value); |
| | 154 | |
| | 155 | osg::Vec3 cellSize; |
| | 156 | while (arguments.read("--cellSize", cellSize.x(), cellSize.y(), cellSize.z())) precipitationEffect->setCellSize(cellSize); |
| | 157 | |
| | 158 | osg::BoundingBox bb; |
| | 159 | while (arguments.read("--boundingBox", bb.xMin(), |
| | 160 | bb.yMin(), |
| | 161 | bb.zMin(), |
| | 162 | bb.xMax(), |
| | 163 | bb.yMax(), |
| | 164 | bb.zMax())) {} |
| | 165 | |
| | 166 | while (arguments.read("--fogDensity", value )) precipitationEffect->getFog()->setDensity(value); |
| | 167 | while (arguments.read("--fogColor", color.r(), color.g(), color.b(), color.a() )) precipitationEffect->getFog()->setColor(color); |
| | 168 | while (arguments.read("--fogColour", color.r(), color.g(), color.b(), color.a() )) precipitationEffect->getFog()->setColor(color); |
| 211 | | |
| | 211 | loadedModel->getOrCreateStateSet()->setAttributeAndModes(precipitationEffect->getFog()); |
| | 212 | |
| | 213 | // create the light |
| | 214 | osg::LightSource* lightSource = new osg::LightSource; |
| | 215 | group->addChild(lightSource); |
| | 216 | |
| | 217 | osg::Light* light = lightSource->getLight(); |
| | 218 | light->setLightNum(0); |
| | 219 | light->setPosition(osg::Vec4(0.0f,0.0f,1.0f,0.0f)); // directional light from above |
| | 220 | light->setAmbient(osg::Vec4(0.8f,0.8f,0.8f,1.0f)); |
| | 221 | light->setDiffuse(osg::Vec4(0.2f,0.2f,0.2f,1.0f)); |
| | 222 | light->setSpecular(osg::Vec4(0.2f,0.2f,0.2f,1.0f)); |
| | 223 | |
| | 224 | |
| | 225 | |
| | 226 | |