Changeset 195 for osgVisual/trunk/src/core
- Timestamp:
- Jan 11, 2011, 9:21:44 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/trunk/src/core/visual_core.cpp
r194 r195 341 341 if(cur_node->type == XML_ELEMENT_NODE && node_name == "visibility") 342 342 { 343 //<visibility range="50000" turbidity="2.2" ></visibility> 343 float range = 50000, turbidity=2.2; 344 xmlAttr *attr = cur_node->properties; 345 while ( attr ) 346 { 347 std::string attr_name=reinterpret_cast<const char*>(attr->name); 348 std::string attr_value=reinterpret_cast<const char*>(attr->children->content); 349 if( attr_name == "range" ) 350 { 351 std::stringstream sstr(attr_value); 352 sstr >> range; 353 } 354 if( attr_name == "turbidity" ) 355 { 356 std::stringstream sstr(attr_value); 357 sstr >> turbidity; 358 } 359 attr = attr->next; 360 } 361 if(sky.valid()) 362 { 363 sky->setVisibility( range ); 364 sky->setTurbidity( turbidity ); 365 } 344 366 } 345 367 … … 356 378 if(cur_node->type == XML_ELEMENT_NODE && node_name == "windlayer") 357 379 { 358 //<windlayer bottom="500.0" top="700." speed="25.0" direction="90.0"></windlayer> 380 float bottom = 0.0, top=5000.0, speed=25.0, direction=0.0; 381 xmlAttr *attr = cur_node->properties; 382 while ( attr ) 383 { 384 std::string attr_name=reinterpret_cast<const char*>(attr->name); 385 std::string attr_value=reinterpret_cast<const char*>(attr->children->content); 386 if( attr_name == "bottom" ) 387 { 388 std::stringstream sstr(attr_value); 389 sstr >> bottom; 390 } 391 if( attr_name == "top" ) 392 { 393 std::stringstream sstr(attr_value); 394 sstr >> top; 395 } 396 if( attr_name == "speed" ) 397 { 398 std::stringstream sstr(attr_value); 399 sstr >> speed; 400 } 401 if( attr_name == "direction" ) 402 { 403 std::stringstream sstr(attr_value); 404 sstr >> direction; 405 } 406 attr = attr->next; 407 } 408 if(sky.valid()) 409 { 410 sky->addWindVolume( bottom, top, speed, direction ); 411 } 359 412 } 360 413 }// FOR all nodes END … … 414 467 if(sky.valid()) 415 468 { 416 //sky->setTime(15,30,00);417 sky->setVisibility(50000);418 sky->addWindVolume( 0.0, 15000.0, 25.0, 90.0 );419 420 469 //sky->addCloudLayer( 0, 20000, 20000, 600.0, 1000.0, 0.5, CUMULONIMBUS_CAPPILATUS ); 421 470 //sky->addCloudLayer( 1, 5000000, 5000000, 600.0, 7351.0, 0.2, CIRRUS_FIBRATUS );
Note: See TracChangeset
for help on using the changeset viewer.