| 496 | } |
| 497 | |
| 498 | void ForestWindEmitter::_renderEmitterInfo( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat ) |
| 499 | { |
| 500 | if ( overrideMat ) |
| 501 | return; |
| 502 | |
| 503 | GFXTransformSaver saver; |
| 504 | |
| 505 | GFXDrawUtil *drawer = GFX->getDrawUtil(); |
| 506 | |
| 507 | AssertFatal( drawer, "Got NULL GFXDrawUtil!" ); |
| 508 | |
| 509 | const Point3F &pos = getPosition(); |
| 510 | const VectorF &windVec = mWind->getDirection(); |
| 511 | |
| 512 | GFXStateBlockDesc desc; |
| 513 | desc.setBlend( true ); |
| 514 | desc.setZReadWrite( true, false ); |
| 515 | |
| 516 | // Draw an arrow pointing |
| 517 | // in the wind direction. |
| 518 | drawer->drawArrow( desc, pos, pos + (windVec * mWindStrength), ColorI( 0, 0, 255, 255 ) );//Point3F( -235.214, 219.589, 34.0991 ), Point3F( -218.814, 244.731, 37.5587 ), ColorI( 255, 255, 0, 255 ) );// |
| 519 | drawer->drawArrow( desc, pos, pos + (mWind->getTarget() * mWindStrength ), ColorI( 255, 0, 0, 85 ) ); |
| 520 | |
| 521 | S32 useRadius = mWindRadius; |
| 522 | // Draw a 2D circle for the wind radius. |
| 523 | if ( isRadialEmitter() ) |
| 524 | { |
| 525 | // If the camera is close to the sphere, shrink the sphere so it remains visible. |
| 526 | GameConnection* gc = GameConnection::getConnectionToServer(); |
| 527 | GameBase *gb = gc ? gc->getCameraObject() : NULL; |
| 528 | if (gb) |
| 529 | { |
| 530 | F32 camDist = (gb->getPosition() - getPosition()).len(); |
| 531 | if ( camDist < mWindRadius ) |
| 532 | useRadius = camDist; |
| 533 | } |
| 534 | drawer->drawSphere( desc, useRadius, pos, ColorI( 255, 0, 0, 80 ) ); |
| 535 | } |
| 536 | } |
| 537 | |
| 538 | F32 ForestWindEmitter::getStrength() const |
| 539 | { |
nothing calls this directly
no test coverage detected