MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _renderEmitterInfo

Method _renderEmitterInfo

Engine/source/forest/forestWindEmitter.cpp:498–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

496}
497
498void 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
538F32 ForestWindEmitter::getStrength() const
539{

Callers

nothing calls this directly

Calls 12

getPositionFunction · 0.85
getDrawUtilMethod · 0.80
setBlendMethod · 0.80
setZReadWriteMethod · 0.80
drawArrowMethod · 0.80
getCameraObjectMethod · 0.80
ColorIClass · 0.50
getDirectionMethod · 0.45
getTargetMethod · 0.45
lenMethod · 0.45
getPositionMethod · 0.45
drawSphereMethod · 0.45

Tested by

no test coverage detected