mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
clamp rendering cover points to 50 units
changes from az render cover points
This commit is contained in:
parent
b9193072c1
commit
78a553a74f
|
|
@ -31,6 +31,7 @@
|
|||
#include "gfx/gfxDrawUtil.h"
|
||||
#include "renderInstance/renderPassManager.h"
|
||||
#include "console/engineAPI.h"
|
||||
#include "T3D/gameBase/gameConnection.h"
|
||||
|
||||
extern bool gEditingMission;
|
||||
|
||||
|
|
@ -285,14 +286,22 @@ void CoverPoint::prepRenderImage(SceneRenderState *state)
|
|||
|
||||
void CoverPoint::render(ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat)
|
||||
{
|
||||
initGFXResources();
|
||||
if (!state->isDiffusePass()) return;
|
||||
|
||||
if(overrideMat)
|
||||
GameConnection* conn = GameConnection::getConnectionToServer();
|
||||
MatrixF camTrans;
|
||||
conn->getControlCameraTransform(0, &camTrans);
|
||||
|
||||
if ((getPosition() - camTrans.getPosition()).lenSquared() > 2500) return; //50 unit clamp
|
||||
|
||||
if (overrideMat)
|
||||
return;
|
||||
|
||||
initGFXResources();
|
||||
|
||||
if(smVertexBuffer[mSize].isNull())
|
||||
return;
|
||||
|
||||
|
||||
PROFILE_SCOPE(CoverPoint_Render);
|
||||
|
||||
// Set up a GFX debug event (this helps with debugging rendering events in external tools)
|
||||
|
|
|
|||
|
|
@ -427,6 +427,8 @@ void duDebugDrawTorque::clearCache()
|
|||
|
||||
void duDebugDrawTorque::render(SceneRenderState* state)
|
||||
{
|
||||
if (!state->isDiffusePass()) return;
|
||||
|
||||
const Frustum& frustum = state->getCameraFrustum();
|
||||
|
||||
for (U32 i = 0; i < mDrawCache.size(); ++i)
|
||||
|
|
|
|||
Loading…
Reference in a new issue