| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | #include <osgViewer/Viewer> |
|---|
| 21 | |
|---|
| 22 | #include <osg/Group> |
|---|
| 23 | #include <osg/Geode> |
|---|
| 24 | #include <osg/ShapeDrawable> |
|---|
| 25 | #include <osg/Texture2D> |
|---|
| 26 | #include <osg/PositionAttitudeTransform> |
|---|
| 27 | #include <osg/MatrixTransform> |
|---|
| 28 | #include <osg/io_utils> |
|---|
| 29 | |
|---|
| 30 | #include <osgUtil/Optimizer> |
|---|
| 31 | |
|---|
| 32 | #include <osgDB/ReadFile> |
|---|
| 33 | |
|---|
| 34 | #include <osgText/Text> |
|---|
| 35 | |
|---|
| 36 | #include <osgParticle/ExplosionEffect> |
|---|
| 37 | #include <osgParticle/ExplosionDebrisEffect> |
|---|
| 38 | #include <osgParticle/SmokeEffect> |
|---|
| 39 | #include <osgParticle/SmokeTrailEffect> |
|---|
| 40 | #include <osgParticle/FireEffect> |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | #include "../osghangglide/terrain_coords.h" |
|---|
| 44 | |
|---|
| 45 | osg::Vec3 wind(1.0f,0.0f,0.0f); |
|---|
| 46 | |
|---|
| 47 | osg::AnimationPath* createAnimationPath(const osg::Vec3& center,float radius,double looptime) |
|---|
| 48 | { |
|---|
| 49 | |
|---|
| 50 | osg::AnimationPath* animationPath = new osg::AnimationPath; |
|---|
| 51 | animationPath->setLoopMode(osg::AnimationPath::LOOP); |
|---|
| 52 | |
|---|
| 53 | int numSamples = 40; |
|---|
| 54 | float yaw = 0.0f; |
|---|
| 55 | float yaw_delta = 2.0f*osg::PI/((float)numSamples-1.0f); |
|---|
| 56 | float roll = osg::inDegrees(30.0f); |
|---|
| 57 | |
|---|
| 58 | double time=0.0f; |
|---|
| 59 | double time_delta = looptime/(double)numSamples; |
|---|
| 60 | for(int i=0;i<numSamples;++i) |
|---|
| 61 | { |
|---|
| 62 | osg::Vec3 position(center+osg::Vec3(sinf(yaw)*radius,cosf(yaw)*radius,0.0f)); |
|---|
| 63 | osg::Quat rotation(osg::Quat(roll,osg::Vec3(0.0,1.0,0.0))*osg::Quat(-(yaw+osg::inDegrees(90.0f)),osg::Vec3(0.0,0.0,1.0))); |
|---|
| 64 | |
|---|
| 65 | animationPath->insert(time,osg::AnimationPath::ControlPoint(position,rotation)); |
|---|
| 66 | |
|---|
| 67 | yaw += yaw_delta; |
|---|
| 68 | time += time_delta; |
|---|
| 69 | |
|---|
| 70 | } |
|---|
| 71 | return animationPath; |
|---|
| 72 | } |
|---|
| 73 | |
|---|
| 74 | osg::Node* createMovingModel(const osg::Vec3& center, float radius) |
|---|
| 75 | { |
|---|
| 76 | float animationLength = 10.0f; |
|---|
| 77 | |
|---|
| 78 | osg::AnimationPath* animationPath = createAnimationPath(center,radius,animationLength); |
|---|
| 79 | |
|---|
| 80 | osg::Group* model = new osg::Group; |
|---|
| 81 | |
|---|
| 82 | osg::Node* glider = osgDB::readNodeFile("glider.osgt"); |
|---|
| 83 | if (glider) |
|---|
| 84 | { |
|---|
| 85 | const osg::BoundingSphere& bs = glider->getBound(); |
|---|
| 86 | float size = radius/bs.radius()*0.15f; |
|---|
| 87 | |
|---|
| 88 | osg::MatrixTransform* positioned = new osg::MatrixTransform; |
|---|
| 89 | positioned->setDataVariance(osg::Object::STATIC); |
|---|
| 90 | positioned->setMatrix(osg::Matrix::translate(-bs.center())* |
|---|
| 91 | osg::Matrix::scale(size,size,size)* |
|---|
| 92 | osg::Matrix::rotate(osg::inDegrees(-90.0f),0.0f,0.0f,1.0f)); |
|---|
| 93 | |
|---|
| 94 | positioned->addChild(glider); |
|---|
| 95 | |
|---|
| 96 | osg::PositionAttitudeTransform* xform = new osg::PositionAttitudeTransform; |
|---|
| 97 | xform->setDataVariance(osg::Object::DYNAMIC); |
|---|
| 98 | xform->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON); |
|---|
| 99 | xform->setUpdateCallback(new osg::AnimationPathCallback(animationPath,0.0,0.5)); |
|---|
| 100 | xform->addChild(positioned); |
|---|
| 101 | |
|---|
| 102 | model->addChild(xform); |
|---|
| 103 | } |
|---|
| 104 | |
|---|
| 105 | osg::Node* cessna = osgDB::readNodeFile("cessna.osgt"); |
|---|
| 106 | if (cessna) |
|---|
| 107 | { |
|---|
| 108 | const osg::BoundingSphere& bs = cessna->getBound(); |
|---|
| 109 | float size = radius/bs.radius()*0.15f; |
|---|
| 110 | |
|---|
| 111 | osg::MatrixTransform* positioned = new osg::MatrixTransform; |
|---|
| 112 | positioned->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON); |
|---|
| 113 | positioned->setDataVariance(osg::Object::STATIC); |
|---|
| 114 | positioned->setMatrix(osg::Matrix::translate(-bs.center())* |
|---|
| 115 | osg::Matrix::scale(size,size,size)* |
|---|
| 116 | osg::Matrix::rotate(osg::inDegrees(180.0f),0.0f,0.0f,1.0f)); |
|---|
| 117 | |
|---|
| 118 | |
|---|
| 119 | positioned->addChild(cessna); |
|---|
| 120 | |
|---|
| 121 | osg::MatrixTransform* xform = new osg::MatrixTransform; |
|---|
| 122 | xform->setDataVariance(osg::Object::DYNAMIC); |
|---|
| 123 | xform->setUpdateCallback(new osg::AnimationPathCallback(animationPath,0.0f,1.0)); |
|---|
| 124 | xform->addChild(positioned); |
|---|
| 125 | |
|---|
| 126 | model->addChild(xform); |
|---|
| 127 | } |
|---|
| 128 | |
|---|
| 129 | return model; |
|---|
| 130 | } |
|---|
| 131 | |
|---|
| 132 | |
|---|
| 133 | osg::Vec3 computeTerrainIntersection(osg::Node* subgraph,float x,float y) |
|---|
| 134 | { |
|---|
| 135 | const osg::BoundingSphere& bs = subgraph->getBound(); |
|---|
| 136 | float zMax = bs.center().z()+bs.radius(); |
|---|
| 137 | float zMin = bs.center().z()-bs.radius(); |
|---|
| 138 | |
|---|
| 139 | osg::ref_ptr<osgUtil::LineSegmentIntersector> intersector = |
|---|
| 140 | new osgUtil::LineSegmentIntersector(osg::Vec3(x,y,zMin),osg::Vec3(x,y,zMax)); |
|---|
| 141 | |
|---|
| 142 | osgUtil::IntersectionVisitor iv(intersector.get()); |
|---|
| 143 | |
|---|
| 144 | subgraph->accept(iv); |
|---|
| 145 | |
|---|
| 146 | if (intersector->containsIntersections()) |
|---|
| 147 | { |
|---|
| 148 | return intersector->getFirstIntersection().getWorldIntersectPoint(); |
|---|
| 149 | } |
|---|
| 150 | |
|---|
| 151 | return osg::Vec3(x,y,0.0f); |
|---|
| 152 | } |
|---|
| 153 | |
|---|
| 154 | |
|---|
| 155 | |
|---|
| 156 | |
|---|
| 157 | |
|---|
| 158 | |
|---|
| 159 | void build_world(osg::Group *root) |
|---|
| 160 | { |
|---|
| 161 | |
|---|
| 162 | osg::Geode* terrainGeode = new osg::Geode; |
|---|
| 163 | |
|---|
| 164 | { |
|---|
| 165 | osg::StateSet* stateset = new osg::StateSet(); |
|---|
| 166 | osg::Image* image = osgDB::readImageFile("Images/lz.rgb"); |
|---|
| 167 | if (image) |
|---|
| 168 | { |
|---|
| 169 | osg::Texture2D* texture = new osg::Texture2D; |
|---|
| 170 | texture->setImage(image); |
|---|
| 171 | stateset->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON); |
|---|
| 172 | } |
|---|
| 173 | |
|---|
| 174 | terrainGeode->setStateSet( stateset ); |
|---|
| 175 | |
|---|
| 176 | float size = 1000; |
|---|
| 177 | float scale = size/39.0f; |
|---|
| 178 | float z_scale = scale*3.0f; |
|---|
| 179 | |
|---|
| 180 | osg::HeightField* grid = new osg::HeightField; |
|---|
| 181 | grid->allocate(38,39); |
|---|
| 182 | grid->setXInterval(scale); |
|---|
| 183 | grid->setYInterval(scale); |
|---|
| 184 | |
|---|
| 185 | for(unsigned int r=0;r<39;++r) |
|---|
| 186 | { |
|---|
| 187 | for(unsigned int c=0;c<38;++c) |
|---|
| 188 | { |
|---|
| 189 | grid->setHeight(c,r,z_scale*vertex[r+c*39][2]); |
|---|
| 190 | } |
|---|
| 191 | } |
|---|
| 192 | terrainGeode->addDrawable(new osg::ShapeDrawable(grid)); |
|---|
| 193 | |
|---|
| 194 | root->addChild(terrainGeode); |
|---|
| 195 | } |
|---|
| 196 | |
|---|
| 197 | |
|---|
| 198 | |
|---|
| 199 | { |
|---|
| 200 | osg::Vec3 position = computeTerrainIntersection(terrainGeode,100.0f,100.0f); |
|---|
| 201 | |
|---|
| 202 | osgParticle::ExplosionEffect* explosion = new osgParticle::ExplosionEffect(position, 10.0f); |
|---|
| 203 | osgParticle::ExplosionDebrisEffect* explosionDebri = new osgParticle::ExplosionDebrisEffect(position, 10.0f); |
|---|
| 204 | osgParticle::SmokeEffect* smoke = new osgParticle::SmokeEffect(position, 10.0f); |
|---|
| 205 | osgParticle::FireEffect* fire = new osgParticle::FireEffect(position, 10.0f); |
|---|
| 206 | |
|---|
| 207 | explosion->setWind(wind); |
|---|
| 208 | explosionDebri->setWind(wind); |
|---|
| 209 | smoke->setWind(wind); |
|---|
| 210 | fire->setWind(wind); |
|---|
| 211 | |
|---|
| 212 | root->addChild(explosion); |
|---|
| 213 | root->addChild(explosionDebri); |
|---|
| 214 | root->addChild(smoke); |
|---|
| 215 | root->addChild(fire); |
|---|
| 216 | } |
|---|
| 217 | |
|---|
| 218 | |
|---|
| 219 | { |
|---|
| 220 | osg::Vec3 position = computeTerrainIntersection(terrainGeode,200.0f,100.0f); |
|---|
| 221 | |
|---|
| 222 | osgParticle::ExplosionEffect* explosion = new osgParticle::ExplosionEffect(position, 1.0f); |
|---|
| 223 | osgParticle::ExplosionDebrisEffect* explosionDebri = new osgParticle::ExplosionDebrisEffect(position, 1.0f); |
|---|
| 224 | osgParticle::SmokeEffect* smoke = new osgParticle::SmokeEffect(position, 1.0f); |
|---|
| 225 | osgParticle::FireEffect* fire = new osgParticle::FireEffect(position, 1.0f); |
|---|
| 226 | |
|---|
| 227 | explosion->setWind(wind); |
|---|
| 228 | explosionDebri->setWind(wind); |
|---|
| 229 | smoke->setWind(wind); |
|---|
| 230 | fire->setWind(wind); |
|---|
| 231 | |
|---|
| 232 | root->addChild(explosion); |
|---|
| 233 | root->addChild(explosionDebri); |
|---|
| 234 | root->addChild(smoke); |
|---|
| 235 | root->addChild(fire); |
|---|
| 236 | } |
|---|
| 237 | |
|---|
| 238 | |
|---|
| 239 | { |
|---|
| 240 | root->addChild(createMovingModel(osg::Vec3(500.0f,500.0f,500.0f),300.0f)); |
|---|
| 241 | } |
|---|
| 242 | } |
|---|
| 243 | |
|---|
| 244 | |
|---|
| 245 | |
|---|
| 246 | class PickHandler : public osgGA::GUIEventHandler { |
|---|
| 247 | public: |
|---|
| 248 | |
|---|
| 249 | PickHandler() {} |
|---|
| 250 | |
|---|
| 251 | bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa) |
|---|
| 252 | { |
|---|
| 253 | switch(ea.getEventType()) |
|---|
| 254 | { |
|---|
| 255 | case(osgGA::GUIEventAdapter::PUSH): |
|---|
| 256 | { |
|---|
| 257 | osgViewer::Viewer* viewer = dynamic_cast<osgViewer::Viewer*>(&aa); |
|---|
| 258 | pick(viewer,ea); |
|---|
| 259 | } |
|---|
| 260 | return false; |
|---|
| 261 | |
|---|
| 262 | default: |
|---|
| 263 | return false; |
|---|
| 264 | } |
|---|
| 265 | } |
|---|
| 266 | |
|---|
| 267 | void pick(osgViewer::Viewer* viewer, const osgGA::GUIEventAdapter& ea) |
|---|
| 268 | { |
|---|
| 269 | osg::Group* root = dynamic_cast<osg::Group*>(viewer->getSceneData()); |
|---|
| 270 | if (!root) return; |
|---|
| 271 | |
|---|
| 272 | osgUtil::LineSegmentIntersector::Intersections intersections; |
|---|
| 273 | if (viewer->computeIntersections(ea,intersections)) |
|---|
| 274 | { |
|---|
| 275 | const osgUtil::LineSegmentIntersector::Intersection& hit = *intersections.begin(); |
|---|
| 276 | |
|---|
| 277 | bool handleMovingModels = false; |
|---|
| 278 | const osg::NodePath& nodePath = hit.nodePath; |
|---|
| 279 | for(osg::NodePath::const_iterator nitr=nodePath.begin(); |
|---|
| 280 | nitr!=nodePath.end(); |
|---|
| 281 | ++nitr) |
|---|
| 282 | { |
|---|
| 283 | const osg::Transform* transform = dynamic_cast<const osg::Transform*>(*nitr); |
|---|
| 284 | if (transform) |
|---|
| 285 | { |
|---|
| 286 | if (transform->getDataVariance()==osg::Object::DYNAMIC) handleMovingModels=true; |
|---|
| 287 | } |
|---|
| 288 | } |
|---|
| 289 | |
|---|
| 290 | osg::Vec3 position = handleMovingModels ? hit.getLocalIntersectPoint() : hit.getWorldIntersectPoint(); |
|---|
| 291 | float scale = 10.0f * ((float)rand() / (float)RAND_MAX); |
|---|
| 292 | float intensity = 1.0f; |
|---|
| 293 | |
|---|
| 294 | osgParticle::ExplosionEffect* explosion = new osgParticle::ExplosionEffect(position, scale, intensity); |
|---|
| 295 | osgParticle::ExplosionDebrisEffect* explosionDebri = new osgParticle::ExplosionDebrisEffect(position, scale, intensity); |
|---|
| 296 | osgParticle::FireEffect* fire = new osgParticle::FireEffect(position, scale, intensity); |
|---|
| 297 | osgParticle::ParticleEffect* smoke = 0; |
|---|
| 298 | if (handleMovingModels) |
|---|
| 299 | smoke = new osgParticle::SmokeTrailEffect(position, scale, intensity); |
|---|
| 300 | else |
|---|
| 301 | smoke = new osgParticle::SmokeEffect(position, scale, intensity); |
|---|
| 302 | |
|---|
| 303 | explosion->setWind(wind); |
|---|
| 304 | explosionDebri->setWind(wind); |
|---|
| 305 | smoke->setWind(wind); |
|---|
| 306 | fire->setWind(wind); |
|---|
| 307 | |
|---|
| 308 | osg::Group* effectsGroup = new osg::Group; |
|---|
| 309 | effectsGroup->addChild(explosion); |
|---|
| 310 | effectsGroup->addChild(explosionDebri); |
|---|
| 311 | effectsGroup->addChild(smoke); |
|---|
| 312 | effectsGroup->addChild(fire); |
|---|
| 313 | |
|---|
| 314 | |
|---|
| 315 | if (handleMovingModels) |
|---|
| 316 | { |
|---|
| 317 | |
|---|
| 318 | |
|---|
| 319 | |
|---|
| 320 | |
|---|
| 321 | |
|---|
| 322 | |
|---|
| 323 | |
|---|
| 324 | |
|---|
| 325 | explosion->setUseLocalParticleSystem(false); |
|---|
| 326 | explosionDebri->setUseLocalParticleSystem(false); |
|---|
| 327 | smoke->setUseLocalParticleSystem(false); |
|---|
| 328 | fire->setUseLocalParticleSystem(false); |
|---|
| 329 | |
|---|
| 330 | |
|---|
| 331 | |
|---|
| 332 | |
|---|
| 333 | |
|---|
| 334 | |
|---|
| 335 | osg::ref_ptr<osg::Node> hitNode = hit.nodePath.back(); |
|---|
| 336 | osg::Node::ParentList parents = hitNode->getParents(); |
|---|
| 337 | osg::Group* insertGroup = 0; |
|---|
| 338 | unsigned int numGroupsFound = 0; |
|---|
| 339 | for(osg::Node::ParentList::iterator itr=parents.begin(); |
|---|
| 340 | itr!=parents.end(); |
|---|
| 341 | ++itr) |
|---|
| 342 | { |
|---|
| 343 | if (typeid(*(*itr))==typeid(osg::Group)) |
|---|
| 344 | { |
|---|
| 345 | ++numGroupsFound; |
|---|
| 346 | insertGroup = *itr; |
|---|
| 347 | } |
|---|
| 348 | } |
|---|
| 349 | if (numGroupsFound==parents.size() && numGroupsFound==1 && insertGroup) |
|---|
| 350 | { |
|---|
| 351 | osg::notify(osg::INFO)<<"PickHandler::pick(,) hit node's parent is a single osg::Group so we can simple the insert the particle effects group here."<<std::endl; |
|---|
| 352 | |
|---|
| 353 | |
|---|
| 354 | insertGroup->addChild(effectsGroup); |
|---|
| 355 | } |
|---|
| 356 | else |
|---|
| 357 | { |
|---|
| 358 | osg::notify(osg::INFO)<<"PickHandler::pick(,) hit node doesn't have an appropriate osg::Group node to insert particle effects into, inserting a new osg::Group."<<std::endl; |
|---|
| 359 | insertGroup = new osg::Group; |
|---|
| 360 | for(osg::Node::ParentList::iterator itr=parents.begin(); |
|---|
| 361 | itr!=parents.end(); |
|---|
| 362 | ++itr) |
|---|
| 363 | { |
|---|
| 364 | (*itr)->replaceChild(hit.nodePath.back(),insertGroup); |
|---|
| 365 | } |
|---|
| 366 | insertGroup->addChild(hitNode.get()); |
|---|
| 367 | insertGroup->addChild(effectsGroup); |
|---|
| 368 | } |
|---|
| 369 | |
|---|
| 370 | |
|---|
| 371 | |
|---|
| 372 | osg::Geode* geode = new osg::Geode; |
|---|
| 373 | geode->addDrawable(explosion->getParticleSystem()); |
|---|
| 374 | geode->addDrawable(explosionDebri->getParticleSystem()); |
|---|
| 375 | geode->addDrawable(smoke->getParticleSystem()); |
|---|
| 376 | geode->addDrawable(fire->getParticleSystem()); |
|---|
| 377 | |
|---|
| 378 | root->addChild(geode); |
|---|
| 379 | |
|---|
| 380 | } |
|---|
| 381 | else |
|---|
| 382 | { |
|---|
| 383 | |
|---|
| 384 | osg::notify(osg::INFO)<<"PickHandler::pick(,) adding particle effects to root node."<<std::endl; |
|---|
| 385 | root->addChild(effectsGroup); |
|---|
| 386 | } |
|---|
| 387 | |
|---|
| 388 | #if 0 |
|---|
| 389 | osg::Geode* geode = new osg::Geode; |
|---|
| 390 | geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(position,scale))); |
|---|
| 391 | group->addChild(geode); |
|---|
| 392 | #endif |
|---|
| 393 | |
|---|
| 394 | } |
|---|
| 395 | } |
|---|
| 396 | |
|---|
| 397 | protected: |
|---|
| 398 | virtual ~PickHandler() {} |
|---|
| 399 | }; |
|---|
| 400 | |
|---|
| 401 | |
|---|
| 402 | void insertParticle(osg::Group* root, const osg::Vec3& center, float radius) |
|---|
| 403 | { |
|---|
| 404 | bool handleMovingModels = false; |
|---|
| 405 | |
|---|
| 406 | osg::Vec3 position = center + |
|---|
| 407 | osg::Vec3( radius * (((float)rand() / (float)RAND_MAX)-0.5)*2.0, |
|---|
| 408 | radius * (((float)rand() / (float)RAND_MAX)-0.5)*2.0, |
|---|
| 409 | 0.0f); |
|---|
| 410 | |
|---|
| 411 | float scale = 10.0f * ((float)rand() / (float)RAND_MAX); |
|---|
| 412 | float intensity = 1.0f; |
|---|
| 413 | |
|---|
| 414 | osgParticle::ExplosionEffect* explosion = new osgParticle::ExplosionEffect(position, scale, intensity); |
|---|
| 415 | osgParticle::ExplosionDebrisEffect* explosionDebri = new osgParticle::ExplosionDebrisEffect(position, scale, intensity); |
|---|
| 416 | osgParticle::FireEffect* fire = new osgParticle::FireEffect(position, scale, intensity); |
|---|
| 417 | osgParticle::ParticleEffect* smoke = 0; |
|---|
| 418 | if (handleMovingModels) |
|---|
| 419 | smoke = new osgParticle::SmokeTrailEffect(position, scale, intensity); |
|---|
| 420 | else |
|---|
| 421 | smoke = new osgParticle::SmokeEffect(position, scale, intensity); |
|---|
| 422 | |
|---|
| 423 | explosion->setWind(wind); |
|---|
| 424 | explosionDebri->setWind(wind); |
|---|
| 425 | smoke->setWind(wind); |
|---|
| 426 | fire->setWind(wind); |
|---|
| 427 | |
|---|
| 428 | osg::Group* effectsGroup = new osg::Group; |
|---|
| 429 | effectsGroup->addChild(explosion); |
|---|
| 430 | effectsGroup->addChild(explosionDebri); |
|---|
| 431 | effectsGroup->addChild(smoke); |
|---|
| 432 | effectsGroup->addChild(fire); |
|---|
| 433 | |
|---|
| 434 | root->addChild(effectsGroup); |
|---|
| 435 | } |
|---|
| 436 | |
|---|
| 437 | |
|---|
| 438 | |
|---|
| 439 | |
|---|
| 440 | |
|---|
| 441 | int main(int, char **) |
|---|
| 442 | { |
|---|
| 443 | |
|---|
| 444 | osgViewer::Viewer viewer; |
|---|
| 445 | |
|---|
| 446 | |
|---|
| 447 | viewer.addEventHandler(new PickHandler()); |
|---|
| 448 | |
|---|
| 449 | osg::Group *root = new osg::Group; |
|---|
| 450 | build_world(root); |
|---|
| 451 | |
|---|
| 452 | osgUtil::Optimizer optimizer; |
|---|
| 453 | optimizer.optimize(root); |
|---|
| 454 | |
|---|
| 455 | |
|---|
| 456 | viewer.setSceneData(root); |
|---|
| 457 | |
|---|
| 458 | return viewer.run(); |
|---|
| 459 | } |
|---|