mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Merge pull request #1124 from eightyeight/forest-wind-emitter
Forest wind emitter rendering improvement
This commit is contained in:
commit
70d2ec6718
|
|
@ -39,6 +39,8 @@
|
|||
#include "T3D/gameBase/processList.h"
|
||||
#include "console/engineAPI.h"
|
||||
|
||||
#include "T3D/gameBase/gameConnection.h"
|
||||
|
||||
ConsoleDocClass( ForestWindEmitter,
|
||||
"@brief Object responsible for simulating wind in a level.\n\n"
|
||||
|
||||
|
|
@ -513,9 +515,21 @@ void ForestWindEmitter::_renderEmitterInfo( ObjectRenderInst *ri, SceneRenderSta
|
|||
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 ) );//
|
||||
drawer->drawArrow( desc, pos, pos + (mWind->getTarget() * mWindStrength ), ColorI( 255, 0, 0, 85 ) );
|
||||
|
||||
S32 useRadius = mWindRadius;
|
||||
// Draw a 2D circle for the wind radius.
|
||||
if ( isRadialEmitter() )
|
||||
drawer->drawSphere( desc, mWindRadius, pos, ColorI( 255, 0, 0, 80 ) );
|
||||
{
|
||||
// If the camera is close to the sphere, shrink the sphere so it remains visible.
|
||||
GameConnection* gc = GameConnection::getConnectionToServer();
|
||||
GameBase* gb;
|
||||
if ( gc && (gb = gc->getCameraObject()) )
|
||||
{
|
||||
F32 camDist = (gb->getPosition() - getPosition()).len();
|
||||
if ( camDist < mWindRadius )
|
||||
useRadius = camDist;
|
||||
}
|
||||
drawer->drawSphere( desc, useRadius, pos, ColorI( 255, 0, 0, 80 ) );
|
||||
}
|
||||
}
|
||||
|
||||
F32 ForestWindEmitter::getStrength() const
|
||||
|
|
|
|||
Loading…
Reference in a new issue