| 303 | } |
| 304 | |
| 305 | void Forest::applyRadialImpulse( const Point3F &origin, F32 radius, F32 magnitude ) |
| 306 | { |
| 307 | if ( isServerObject() ) |
| 308 | return; |
| 309 | |
| 310 | // Find all the trees in the radius |
| 311 | // then get their accumulators and |
| 312 | // push our impulse into them. |
| 313 | VectorF impulse( 0, 0, 0 ); |
| 314 | ForestWindAccumulator *accumulator = NULL; |
| 315 | |
| 316 | Vector<TreePlacementInfo> trees; |
| 317 | getLocalWindTrees( origin, radius, &trees ); |
| 318 | for ( U32 i = 0; i < trees.size(); i++ ) |
| 319 | { |
| 320 | const TreePlacementInfo &treeInfo = trees[i]; |
| 321 | accumulator = WINDMGR->getLocalWind( treeInfo.itemKey ); |
| 322 | if ( !accumulator ) |
| 323 | continue; |
| 324 | |
| 325 | impulse = treeInfo.pos - origin; |
| 326 | impulse.normalize(); |
| 327 | impulse *= magnitude; |
| 328 | |
| 329 | accumulator->applyImpulse( impulse ); |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | void Forest::createNewFile() |
| 334 | { |
nothing calls this directly
no test coverage detected