mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Undid changes to Point3F.
This commit is contained in:
parent
c1203c1cea
commit
540e68aadb
2 changed files with 9 additions and 31 deletions
|
|
@ -515,25 +515,19 @@ 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() )
|
||||
{
|
||||
|
||||
//So the problem is that when your inside the sphere it won't render so it might make someone
|
||||
//think that it's not working right. So what I did was determine if the camera is inside the sphere.
|
||||
//If the camera is inside the sphere, then I find the distance from the center of the sphere to the camera
|
||||
//Round down and use that as the radius to draw the sphere.
|
||||
//That way if someone zooms in or out, their screen is still showing the sphere.
|
||||
GameConnection * gc = GameConnection::getConnectionToServer();
|
||||
GameBase* gb = gc->getCameraObject();
|
||||
if (gb)
|
||||
{
|
||||
Point3F camPos = gb->getPosition();
|
||||
if ( getPosition().isInsideSphere( camPos, mWindRadius ) )
|
||||
useRadius = getPosition().distanceTo(camPos);
|
||||
}
|
||||
// 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 ) );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue