mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-24 05:45:40 +00:00
Merge pull request #1018 from eightyeight/ghost-scoping
Add the option to limit ghost scoping range
This commit is contained in:
commit
8a104a5222
9 changed files with 63 additions and 5 deletions
|
|
@ -40,7 +40,6 @@
|
|||
// For player object bounds workaround.
|
||||
#include "T3D/player.h"
|
||||
|
||||
|
||||
extern bool gEditingMission;
|
||||
|
||||
|
||||
|
|
@ -113,6 +112,7 @@ SceneManager::SceneManager( bool isClient )
|
|||
mDisplayTargetResolution( 0, 0 ),
|
||||
mDefaultRenderPass( NULL ),
|
||||
mVisibleDistance( 500.f ),
|
||||
mVisibleGhostDistance( 0 ),
|
||||
mNearClip( 0.1f ),
|
||||
mAmbientLightColor( ColorF( 0.1f, 0.1f, 0.1f, 1.0f ) ),
|
||||
mZoneManager( NULL )
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@ class SceneManager
|
|||
|
||||
F32 mVisibleDistance;
|
||||
|
||||
F32 mVisibleGhostDistance;
|
||||
F32 mNearClip;
|
||||
|
||||
FogData mFogData;
|
||||
|
|
@ -317,6 +318,9 @@ class SceneManager
|
|||
/// Returns the default visible distance for the scene.
|
||||
F32 getVisibleDistance() { return mVisibleDistance; }
|
||||
|
||||
void setVisibleGhostDistance( F32 dist ) { mVisibleGhostDistance = dist; }
|
||||
F32 getVisibleGhostDistance() { return mVisibleGhostDistance;}
|
||||
|
||||
/// Used by LevelInfo to set the default near clip plane
|
||||
/// for rendering the scene.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "math/mathIO.h"
|
||||
#include "math/mTransform.h"
|
||||
#include "T3D/gameBase/gameProcess.h"
|
||||
#include "T3D/gameBase/gameConnection.h"
|
||||
|
||||
IMPLEMENT_CONOBJECT(SceneObject);
|
||||
|
||||
|
|
@ -664,6 +665,12 @@ static void scopeCallback( SceneObject* obj, void* conPtr )
|
|||
|
||||
void SceneObject::onCameraScopeQuery( NetConnection* connection, CameraScopeQuery* query )
|
||||
{
|
||||
SceneManager* sceneManager = getSceneManager();
|
||||
GameConnection* conn = dynamic_cast<GameConnection*> (connection);
|
||||
if (conn && (query->visibleDistance = conn->getVisibleGhostDistance()) == 0.0f)
|
||||
if ((query->visibleDistance = sceneManager->getVisibleGhostDistance()) == 0.0f)
|
||||
query->visibleDistance = sceneManager->getVisibleDistance();
|
||||
|
||||
// Object itself is in scope.
|
||||
|
||||
if( this->isScopeable() )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue