mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 09:04:38 +00:00
clamp rendering cover points to 50 units
changes from az render cover points
This commit is contained in:
parent
b9193072c1
commit
78a553a74f
2 changed files with 14 additions and 3 deletions
|
|
@ -31,6 +31,7 @@
|
||||||
#include "gfx/gfxDrawUtil.h"
|
#include "gfx/gfxDrawUtil.h"
|
||||||
#include "renderInstance/renderPassManager.h"
|
#include "renderInstance/renderPassManager.h"
|
||||||
#include "console/engineAPI.h"
|
#include "console/engineAPI.h"
|
||||||
|
#include "T3D/gameBase/gameConnection.h"
|
||||||
|
|
||||||
extern bool gEditingMission;
|
extern bool gEditingMission;
|
||||||
|
|
||||||
|
|
@ -285,11 +286,19 @@ void CoverPoint::prepRenderImage(SceneRenderState *state)
|
||||||
|
|
||||||
void CoverPoint::render(ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat)
|
void CoverPoint::render(ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat)
|
||||||
{
|
{
|
||||||
initGFXResources();
|
if (!state->isDiffusePass()) return;
|
||||||
|
|
||||||
|
GameConnection* conn = GameConnection::getConnectionToServer();
|
||||||
|
MatrixF camTrans;
|
||||||
|
conn->getControlCameraTransform(0, &camTrans);
|
||||||
|
|
||||||
|
if ((getPosition() - camTrans.getPosition()).lenSquared() > 2500) return; //50 unit clamp
|
||||||
|
|
||||||
if (overrideMat)
|
if (overrideMat)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
initGFXResources();
|
||||||
|
|
||||||
if(smVertexBuffer[mSize].isNull())
|
if(smVertexBuffer[mSize].isNull())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -427,6 +427,8 @@ void duDebugDrawTorque::clearCache()
|
||||||
|
|
||||||
void duDebugDrawTorque::render(SceneRenderState* state)
|
void duDebugDrawTorque::render(SceneRenderState* state)
|
||||||
{
|
{
|
||||||
|
if (!state->isDiffusePass()) return;
|
||||||
|
|
||||||
const Frustum& frustum = state->getCameraFrustum();
|
const Frustum& frustum = state->getCameraFrustum();
|
||||||
|
|
||||||
for (U32 i = 0; i < mDrawCache.size(); ++i)
|
for (U32 i = 0; i < mDrawCache.size(); ++i)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue