mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Merge pull request #1124 from eightyeight/forest-wind-emitter
Forest wind emitter rendering improvement
This commit is contained in:
commit
70d2ec6718
1 changed files with 15 additions and 1 deletions
|
|
@ -39,6 +39,8 @@
|
||||||
#include "T3D/gameBase/processList.h"
|
#include "T3D/gameBase/processList.h"
|
||||||
#include "console/engineAPI.h"
|
#include "console/engineAPI.h"
|
||||||
|
|
||||||
|
#include "T3D/gameBase/gameConnection.h"
|
||||||
|
|
||||||
ConsoleDocClass( ForestWindEmitter,
|
ConsoleDocClass( ForestWindEmitter,
|
||||||
"@brief Object responsible for simulating wind in a level.\n\n"
|
"@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 + (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 ) );
|
drawer->drawArrow( desc, pos, pos + (mWind->getTarget() * mWindStrength ), ColorI( 255, 0, 0, 85 ) );
|
||||||
|
|
||||||
|
S32 useRadius = mWindRadius;
|
||||||
// Draw a 2D circle for the wind radius.
|
// Draw a 2D circle for the wind radius.
|
||||||
if ( isRadialEmitter() )
|
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
|
F32 ForestWindEmitter::getStrength() const
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue