SceneManager

Engine/source/scene/sceneManager.h

An object that manages the SceneObjects belonging to a scene.

More...

Lighting

bool

Deactivates the previous light manager and activates the new one.

bool
setLightManager(const char * lmName)

Finds the light manager by name and activates it.

Return the current global ambient light color.

Set the time it takes for a new ambient light color to take full effect.

Set the interpolation curve to use for blending from one global ambient light color to a different one.

Light manager that is active for the scene.

Global ambient light level in the scene.

AmbientLightInterpolator 

Rendering

_renderScene(SceneRenderState * state, U32 objectMask, SceneZoneSpace * baseObject, U32 baseZone)

Render scene using the given state.

Callback for the container query.

Return the default RenderPassManager for the scene.

Set the default render pass for the scene.

renderScene(ScenePassType passType, U32 objectMask)

Render the scene with the default render pass.

renderScene(SceneRenderState * state, U32 objectMask, SceneZoneSpace * baseObject, U32 baseZone)

Render the scene with a custom rendering pass.

renderSceneNoLights(SceneRenderState * state, U32 objectMask, SceneZoneSpace * baseObject, U32 baseZone)

Render the scene with a custom rendering pass and no lighting set up.

Returns the currently active scene state or NULL if no state is currently active.

SceneObject Management

bool

Add the given object to the scene.

Remove the given object from the scene.

Let the scene manager know that the given object has changed its transform or sizing state.

Networking

scopeScene(CameraScopeQuery * query, NetConnection * netConnection)

Set the scoping states of the objects in the scene.

Fog/Visibility Management

setPostEffectFog(bool enable)

Accessor for the FogData structure.

Sets the FogData structure.

Accessor for the WaterFogData structure.

Sets the WaterFogData structure.

Used by LevelInfo to set the default visible distance for rendering the scene.

Returns the default visible distance for the scene.

setNearClip(F32 nearClip)

Used by LevelInfo to set the default near clip plane for rendering the scene.

Returns the default near clip distance for the scene.

dtr Display Target Resolution

Some rendering must be targeted at a specific display resolution.

This display resolution is distinct from the current RT's size (such as when rendering a reflection to a texture, for instance) so we store the size at which we're going to display the results of the current render.

Public Types

RenderSignal 

A signal used to notify of render passes.

Public Static Attributes

bool

If true use the last stored locked frustum for culling the diffuse render pass.

bool

If true, render the AABBs of objects for debugging.

Public Attributes

Protected Attributes

The currently active render state or NULL if we're not in the process of rendering.

bool

Whether this is the client-side scene.

Manager for the zones in this scene.

Protected Static Attributes

The stored last diffuse pass frustum for locking the cull.

Public Functions

Detailed Description

An object that manages the SceneObjects belonging to a scene.

Lighting

_setLightManager(LightManager * lm)

Deactivates the previous light manager and activates the new one.

setLightManager(const char * lmName)

Finds the light manager by name and activates it.

getAmbientLightColor()

Return the current global ambient light color.

setAmbientLightTransitionTime(SimTime time)

Set the time it takes for a new ambient light color to take full effect.

setAmbientLightTransitionCurve(const EaseF & ease)

Set the interpolation curve to use for blending from one global ambient light color to a different one.

LightManager * mLightManager 

Light manager that is active for the scene.

AmbientLightInterpolator mAmbientLightColor 

Global ambient light level in the scene.

typedef InterpolatedChangeProperty< LinearColorF > AmbientLightInterpolator 

Rendering

_renderScene(SceneRenderState * state, U32 objectMask, SceneZoneSpace * baseObject, U32 baseZone)

Render scene using the given state.

Parameters:

state

SceneManager render state.

objectMask

Object type mask with which to filter scene objects.

baseObject

Zone manager to start traversal in. If null, the zone manager that contains state's camera position will be used.

baseZone

Zone in zone manager in which to start traversal. Ignored if baseObject is NULL.

_batchObjectCallback(SceneObject * object, void * key)

Callback for the container query.

getDefaultRenderPass()

Return the default RenderPassManager for the scene.

setDefaultRenderPass(RenderPassManager * rpm)

Set the default render pass for the scene.

renderScene(ScenePassType passType, U32 objectMask)

Render the scene with the default render pass.

note:

This uses the current GFX state (transforms, viewport, frustum) to initialize the render state.

renderScene(SceneRenderState * state, U32 objectMask, SceneZoneSpace * baseObject, U32 baseZone)

Render the scene with a custom rendering pass.

renderSceneNoLights(SceneRenderState * state, U32 objectMask, SceneZoneSpace * baseObject, U32 baseZone)

Render the scene with a custom rendering pass and no lighting set up.

getCurrentRenderState()

Returns the currently active scene state or NULL if no state is currently active.

getPreRenderSignal()

getPostRenderSignal()

RenderPassManager * mDefaultRenderPass 

RenderPassManager for the default render pass.

This is set up in script and looked up by getDefaultRenderPass().

Vector< SceneObject * > mBatchQueryList 

SceneObject Management

addObjectToScene(SceneObject * object)

Add the given object to the scene.

removeObjectFromScene(SceneObject * object)

Remove the given object from the scene.

notifyObjectDirty(SceneObject * object)

Let the scene manager know that the given object has changed its transform or sizing state.

Networking

scopeScene(CameraScopeQuery * query, NetConnection * netConnection)

Set the scoping states of the objects in the scene.

Fog/Visibility Management

setPostEffectFog(bool enable)

usePostEffectFog()

getFogData()

Accessor for the FogData structure.

setFogData(const FogData & data)

Sets the FogData structure.

getWaterFogData()

Accessor for the WaterFogData structure.

setWaterFogData(const WaterFogData & data)

Sets the WaterFogData structure.

setVisibleDistance(F32 dist)

Used by LevelInfo to set the default visible distance for rendering the scene.

Note this should not be used to alter culling which is controlled by the active frustum when a SceneRenderState is created.

getVisibleDistance()

Returns the default visible distance for the scene.

setVisibleGhostDistance(F32 dist)

getVisibleGhostDistance()

setNearClip(F32 nearClip)

Used by LevelInfo to set the default near clip plane for rendering the scene.

getNearClip()

Returns the default near clip distance for the scene.

dtr Display Target Resolution

Some rendering must be targeted at a specific display resolution.

This display resolution is distinct from the current RT's size (such as when rendering a reflection to a texture, for instance) so we store the size at which we're going to display the results of the current render.

setDisplayTargetResolution(const Point2I & size)

getDisplayTargetResolution()

Public Types

typedef Signal< void(SceneManager *, const SceneRenderState *) > RenderSignal 

A signal used to notify of render passes.

Public Static Attributes

bool smLockDiffuseFrustum 

If true use the last stored locked frustum for culling the diffuse render pass.

see:

smLockedDiffuseFrustum

bool smRenderBoundingBoxes 

If true, render the AABBs of objects for debugging.

Public Attributes

Vector< SceneObject * > mRenderedObjectsList 

Protected Attributes

SceneRenderState * mCurrentRenderState 

The currently active render state or NULL if we're not in the process of rendering.

Point2I mDisplayTargetResolution 

FogData mFogData 
bool mIsClient 

Whether this is the client-side scene.

F32 mNearClip 
MatrixF mNonClipProj 
bool mUsePostEffectFog 
F32 mVisibleDistance 
F32 mVisibleGhostDistance 
WaterFogData mWaterFogData 
SceneZoneSpaceManager * mZoneManager 

Manager for the zones in this scene.

Protected Static Attributes

SceneCameraState smLockedDiffuseCamera 

The stored last diffuse pass frustum for locking the cull.

Public Functions

SceneManager(bool isClient)

~SceneManager()

getContainer()

Return the SceneContainer for this scene.

getNonClipProjection()

getZoneManager()

getZoneManager()

Return the manager for the zones in this scene.

note:

Only client scenes have a zone manager as for the server, no zoning data is kept.

setNonClipProjection(const MatrixF & proj)