# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::CScene Class Reference

A CScene, which own a list of Render Traversals, and a render() method. More...

#include <scene.h>

Inheritance diagram for NL3D::CScene:

NL3D::CMOT List of all members.

Private

typedef std::list< CSkeletonModel * > TSkeletonModelList
typedef TSkeletonModelList::iterator ItSkeletonModelList
ItSkeletonModelList appendSkeletonModelToList (CSkeletonModel *skel)
 Private. More...

void eraseSkeletonModelToList (ItSkeletonModelList it)
ItSkeletonModelList getSkeletonModelListBegin ()
ItSkeletonModelList getSkeletonModelListEnd ()

LoadBalancing mgt.

enum  TPolygonBalancingMode { PolygonBalancingOff = 0, PolygonBalancingOn, PolygonBalancingClamp, CountPolygonBalancing }
 The mode of polygon balancing. More...

float getNbFaceAsked () const
 Get the last face count asked from the instances before reduction. More...

void setGroupLoadMaxPolygon (const std::string &group, uint nFaces)
 Set the number of faces wanted for a LoadBlancingGroup. More...

uint getGroupLoadMaxPolygon (const std::string &group)
 Get the number of faces wanted for a LoadBlancingGroup. More...

float getGroupNbFaceAsked (const std::string &group) const
 Get the last face count asked from the instances before reduction. More...

void setPolygonBalancingMode (TPolygonBalancingMode polBalMode)
 Set the PolygonBalancingMode. More...

TPolygonBalancingMode getPolygonBalancingMode () const
 Get the PolygonBalancingMode. More...

void setMaxSkeletonsInNotCLodForm (uint m)
 LoadBalancing for CLod and Skeletons. More...

uint getMaxSkeletonsInNotCLodForm () const

Shape/Instances.

typedef std::multimap< std::string,
CTransformShape ** > 
TWaitingInstancesMMap
CShapeBank_ShapeBank
TWaitingInstancesMMap _WaitingInstances
CInstanceGroup_GlobalInstanceGroup

Public Types


Public Methods

void updateWaitingInstances (double systemTimeEllapsed)
 Particle system handling (remove the resources of those which are too far, as their clusters may not have been parsed). More...

CInstanceGroupgetGlobalInstanceGroup ()
TGlobalAnimationTime getCurrentTime (void) const
 get the current time of the scene, in second. It start from 0 (at the firt call of animate). More...

TAnimationTime getEllapsedTime (void) const
 get the ellapsed time (in second) between the last 2 calls of animate. More...

double getCurrentSystemTime () const
 System time is a time that always run (independent from the animation time that run only on animate()) It is updated at beginning of render(). More...

double getEllapsedSystemTime () const
 get the ellapsed time (in second) between the last 2 calls of render(). More...

uint64 getNumRender () const
 get the number of time render has been called. More...

CParticleSystemManagergetParticleSystemManager ()
 Get a ref. to the particle system manager. You shouldn't call this (has methods for private processing). More...

void setAutomaticAnimationSet (CAnimationSet *as)
 set the automatic animation set used by this scene. It is stored as a smart pointer. More...

CAnimationSetgetAutomaticAnimationSet () const
 Get a reference to the set of automatic animations. More...

CAsyncTextureManagergetAsyncTextureManager () const
 Get the async texture manager. NULL if was not setuped. More...

void setAsyncTextureManager (CAsyncTextureManager *mgr)
 Set the async texture manager. More...

Construction / destruction.
 CScene ()
 Constructor. More...

 ~CScene ()
 Destructor. release(). More...

void initDefaultTravs ()
 Create / register the 5 basic traversals:CHrcTrav, CClipTrav, CLightTrav, CAnimDetailTrav, CLoadBalancingTrav, CRenderTravInit. More...

void initDefaultRoots ()
 Create/setRoot the defaults models roots: a CTransform and a CLightGroup. More...

void initGlobalnstanceGroup ()
 Create the world instance group (with only one cluster). More...

void initCoarseMeshManager ()
 Create coarse meshes manager. More...

void initQuadGridClipManager ()
 init QuadGridClipManager. More...

void setDriver (IDriver *drv)
 Set the driver to render Traversal. More...

IDrivergetDriver () const
 Get the driver of render Traversal. More...

void addTrav (ITrav *v)
 Add a ITrav or a ITravScene to the scene. More...

virtual void release ()
 Release all relative to the scene (Models, traversals...)... More...

Render
void render (bool doHrcPass=true)
 Render the scene, via the registered ITravScene, from the CurrentCamera view. More...

Camera/Viewport.
void setCam (CCamera *cam)
 Set/Get the current camera/Viewport. More...

CCameragetCam ()
void setViewport (const class CViewport &viewport)
CViewport getViewport ()
Instance Mgt.
void setShapeBank (CShapeBank *pShapeBank)
 Set the shape bank. More...

CShapeBankgetShapeBank (void)
 Get the shape bank. More...

const CShapeBankgetShapeBank (void) const
 Get the shape bank (const version). More...

virtual CTransformShapecreateInstance (const std::string &shapeName)
 Create a model, instance of the shape "shapename". More...

void createInstanceAsync (const std::string &shapeName, CTransformShape **pInstance)
 Create an instance, if the shape is not present, load the shape asynchronously. More...

void deleteInstance (CTransformShape *model)
 Delete an instance via his pointer. More...

Light Mgt.
void loadLightmapAutoAnim (const std::string &)
void setAutoAnim (CAnimation *pAnim)
void animate (TGlobalAnimationTime atTime)
void addInstanceGroupForLightAnimation (CInstanceGroup *ig)
 Add an IG for auto PointLight Factor animation. called by CInstanceGroup::addToScene(). More...

void removeInstanceGroupForLightAnimation (CInstanceGroup *ig)
 Remove an IG for auto PointLight Factor animation. called by CInstanceGroup::removeFromScene(). More...

Coarse meshes managers.
CCoarseMeshManagergetStaticCoarseMeshManager ()
CCoarseMeshManagergetDynamicCoarseMeshManager ()
void setCoarseMeshLightingUpdate (uint8 period)
 Each coarseMesh lighting will be updated every "period" frame. More...

uint8 getCoarseMeshLightingUpdate () const
 see setCoarseMeshLightingUpdate(). More...

CLodCharacterManagergetLodCharacterManager () const
 Get the LodCharacterManager. NULL if user did not set it. (done in DriverUser). More...

void setLodCharacterManager (CLodCharacterManager *m)
 set the LodCharacterManager. More...

transparent Layer mgt
void setLayersRenderingOrder (bool directOrder=true)
 Set the order or rendering for transparent objects. More...

bool getLayersRenderingOrder () const
Sun Light mgt
void enableLightingSystem (bool enable)
 Enable Scene Lighting system. More...

bool isLightingSystemEnabled () const
 see enableLightingSystem. More...

void setAmbientGlobal (NLMISC::CRGBA ambient)
 set the global Ambient used for the scene. Default to (50, 50, 50). More...

void setSunAmbient (NLMISC::CRGBA ambient)
 set the Ambient of the Sun used for the scene. More...

void setSunDiffuse (NLMISC::CRGBA diffuse)
 set the Diffuse of the Sun used for the scene. More...

void setSunSpecular (NLMISC::CRGBA specular)
 set the Specular of the Sun used for the scene. More...

void setSunDirection (const NLMISC::CVector &direction)
 set the Direction of the Sun used for the scene. More...

NLMISC::CRGBA getAmbientGlobal () const
 get the global Ambient used for the scene. Default to (50, 50, 50). More...

NLMISC::CRGBA getSunAmbient () const
 get the Ambient of the Sun used for the scene. More...

NLMISC::CRGBA getSunDiffuse () const
 get the Diffuse of the Sun used for the scene. More...

NLMISC::CRGBA getSunSpecular () const
 get the Specular of the Sun used for the scene. More...

NLMISC::CVector getSunDirection () const
 get the Direction of the Sun used for the scene. More...

void setMaxLightContribution (uint nlights)
 setup the max number of point light that can influence a model. More...

uint getMaxLightContribution () const
 
See also:
setMaxLightContribution().
More...


void setLightTransitionThreshold (float lightTransitionThreshold)
 Advanced. More...

float getLightTransitionThreshold () const
 
See also:
getLightTransitionThreshold().
More...


Weather mgt
void setGlobalWindPower (float gwp)
 Weather mgt. More...

float getGlobalWindPower () const
 get the current windPower. More...

void setGlobalWindDirection (const CVector &gwd)
 Set the current windDirection for all the scene. dir.z set to 0 and vector normalized. More...

const CVector & getGlobalWindDirection () const
 get the current windDirection. More...

Trav accessor. Use it with caution. (used for mesh rendering)
CHrcTravgetHrcTrav () const
CClipTravgetClipTrav () const
CLightTravgetLightTrav () const
CAnimDetailTravgetAnimDetailTrav () const
CLoadBalancingTravgetLoadBalancingTrav () const
CRenderTravgetRenderTrav () const
CSkipModelgetSkipModelRoot () const

Static Public Methods

Basic registration.
void registerBasics ()
 Register Basic models and observers. More...


Private Types

typedef std::map< sint, ITravScene * > TTravMap
typedef std::set< CInstanceGroup * > TAnimatedIgSet
typedef TAnimatedIgSet::iterator ItAnimatedIgSet

Private Attributes

TTravMap RenderTraversals
CRefPtr< CCameraCurrentCamera
 The camera / Viewport. More...

CViewport _Viewport
TGlobalAnimationTime _CurrentTime
TGlobalAnimationTime _RealTime
bool _FirstAnimateCall
TAnimationTime _EllapsedTime
double _DeltaSystemTimeBetweenRender
double _GlobalSystemTime
uint64 _NumRender
CTransformRoot
CSkipModelSkipModelRoot
CRootModelSonsOfAncestorSkeletonModelGroup
CRootModelLightModelRoot
CAnimationSet _LightmapAnimations
std::set< CAnimatedLightmap * > _AnimatedLightmap
CPlayListManager _LMAnimsAuto
TAnimatedIgSet _AnimatedIgSet
bool _LightingSystemEnabled
uint8 _CoarseMeshLightingUpdate
 set setCoarseMeshLightingUpdate. More...

NLMISC::CSmartPtr< CAnimationSet_AutomaticAnimationSet
CAsyncTextureManager_AsyncTextureManager
TSkeletonModelList _SkeletonModelList
uint _MaxSkeletonsInNotCLodForm
The 5 default traversals, created / linked by CScene::initDefaultTraversals().
CHrcTravHrcTrav
CClipTravClipTrav
CLightTravLightTrav
CAnimDetailTravAnimDetailTrav
CLoadBalancingTravLoadBalancingTrav
CRenderTravRenderTrav
Coarse meshes managers.
CRefPtr< CCoarseMeshManager_StaticCoarseMeshManager
CRefPtr< CCoarseMeshManager_DynamicCoarseMeshManager
CLodCharacterManager_LodCharacterManager
Clip features
CQuadGridClipManager _QuadGridClipManager
Particle systems specific
CParticleSystemManager _ParticleSystemManager
Weather mgt
float _GlobalWindPower
CVector _GlobalWindDirection

Detailed Description

A CScene, which own a list of Render Traversals, and a render() method.

USER RULES:

CScene own those Traversals and those Root and kill them at ~CScene().

Coordinate System: right hand cordinates with: X to the right, Y to the far, Z to the top.

Z ^ | > Y | / | / |/ -------> X

Shape System:\n The scene has an instance Managagement:

  • IShape design the object that is instancied (a mesh as example).
  • ITransformShape is the instance, which smart_point to a IShape.
  • user can add shape manually in the scene CShapeBank with CShapeBank::add (), or remove them with CShapeBank::release ().
  • user create instance of a shape with CScene::createInstance(string shapeName); This create/load auto the shape if needed (searching in CPath, shapename must be a valid file name), and then create the instance, with help of IShape::createInstance().
Author:
Lionel Berenguier , Nevrax France
Date:
2000

Definition at line 127 of file scene.h.


Member Typedef Documentation

typedef TAnimatedIgSet::iterator NL3D::CScene::ItAnimatedIgSet [private]
 

Definition at line 526 of file scene.h.

Referenced by animate, and removeInstanceGroupForLightAnimation.

typedef TSkeletonModelList::iterator NL3D::CScene::ItSkeletonModelList
 

Definition at line 467 of file scene.h.

Referenced by getSkeletonModelListBegin, and getSkeletonModelListEnd.

typedef std::set<CInstanceGroup*> NL3D::CScene::TAnimatedIgSet [private]
 

Definition at line 525 of file scene.h.

typedef std::list<CSkeletonModel*> NL3D::CScene::TSkeletonModelList
 

Definition at line 466 of file scene.h.

typedef std::map<sint, ITravScene*> NL3D::CScene::TTravMap [private]
 

Definition at line 476 of file scene.h.

typedef std::multimap<std::string,CTransformShape**> NL3D::CScene::TWaitingInstancesMMap [private]
 

Definition at line 533 of file scene.h.


Member Enumeration Documentation

enum NL3D::CScene::TPolygonBalancingMode
 

The mode of polygon balancing.

PolygonBalancingOff => Models will be rendered with the number of faces they want to render. PolygonBalancingOn => Models will be rendered with the number of faces the LoadBalancing want. PolygonBalancingClamp => Same as PolygonBalancingOn, but factor <= 1, ie models won't be rendered with more face they want to render.

Enumeration values:
PolygonBalancingOff 
PolygonBalancingOn 
PolygonBalancingClamp 
CountPolygonBalancing 

Definition at line 301 of file scene.h.


Constructor & Destructor Documentation

NL3D::CScene::CScene  
 

Constructor.

Definition at line 124 of file scene.cpp.

References _AsyncTextureManager, _CoarseMeshLightingUpdate, _CurrentTime, _DynamicCoarseMeshManager, _EllapsedTime, _FirstAnimateCall, _GlobalWindDirection, _GlobalWindPower, _LightingSystemEnabled, _LodCharacterManager, _MaxSkeletonsInNotCLodForm, _NumRender, _RealTime, _ShapeBank, _StaticCoarseMeshManager, AnimDetailTrav, ClipTrav, HrcTrav, LightModelRoot, LightTrav, LoadBalancingTrav, RenderTrav, Root, SkipModelRoot, and SonsOfAncestorSkeletonModelGroup.

NL3D::CScene::~CScene  
 

Destructor. release().

Definition at line 236 of file scene.cpp.

References release.


Member Function Documentation

void NL3D::CScene::addInstanceGroupForLightAnimation CInstanceGroup   ig
 

Add an IG for auto PointLight Factor animation. called by CInstanceGroup::addToScene().

Definition at line 915 of file scene.cpp.

References _AnimatedIgSet, and nlassert.

void NL3D::CScene::addTrav ITrav   v
 

Add a ITrav or a ITravScene to the scene.

If not a ITravScene (tested with help of dynamic_cast) or if trav->getRenderOrder()==0, The traversal is not added to the "render traversal list", else it is. Such a traversal will be traverse() -ed in the order given. The getRenderOrder() is called only in the addTrav() method (so this is a static information).

Reimplemented from NL3D::CMOT.

Definition at line 353 of file scene.cpp.

References nlassert, RenderTraversals, and v.

Referenced by initDefaultTravs.

void NL3D::CScene::animate TGlobalAnimationTime    atTime
 

Definition at line 710 of file scene.cpp.

References _AnimatedIgSet, _AnimatedLightmap, _CurrentTime, _EllapsedTime, _FirstAnimateCall, _LMAnimsAuto, _ParticleSystemManager, _RealTime, ItAnimatedIgSet, and NL3D::TGlobalAnimationTime.

CScene::ItSkeletonModelList NL3D::CScene::appendSkeletonModelToList CSkeletonModel   skel
 

Private.

Definition at line 966 of file scene.cpp.

References _SkeletonModelList.

virtual CTransformShape* NL3D::CScene::createInstance const std::string &    shapeName [virtual]
 

Create a model, instance of the shape "shapename".

If not present, try to load "shapename" via the CPath. If fails, return NULL.

void NL3D::CScene::createInstanceAsync const std::string &    shapeName,
CTransformShape **    pInstance
 

Create an instance, if the shape is not present, load the shape asynchronously.

The instance is really created when we process it in the rendering.

void NL3D::CScene::deleteInstance CTransformShape   model
 

Delete an instance via his pointer.

An instance is an entity which reference a shape.

Definition at line 612 of file scene.cpp.

References _ShapeBank, and NL3D::CMOT::deleteModel.

void NL3D::CScene::enableLightingSystem bool    enable
 

Enable Scene Lighting system.

For backward compatibility, false by default. If false, all objects will take last driver 's light setup

Definition at line 838 of file scene.cpp.

References _LightingSystemEnabled, LightTrav, and RenderTrav.

void NL3D::CScene::eraseSkeletonModelToList ItSkeletonModelList    it
 

Definition at line 973 of file scene.cpp.

References _SkeletonModelList.

NLMISC::CRGBA NL3D::CScene::getAmbientGlobal   const
 

get the global Ambient used for the scene. Default to (50, 50, 50).

Definition at line 872 of file scene.cpp.

References RenderTrav.

CAnimDetailTrav* NL3D::CScene::getAnimDetailTrav   const [inline]
 

Definition at line 437 of file scene.h.

References AnimDetailTrav.

CAsyncTextureManager* NL3D::CScene::getAsyncTextureManager   const [inline]
 

Get the async texture manager. NULL if was not setuped.

Definition at line 459 of file scene.h.

References _AsyncTextureManager.

CAnimationSet* NL3D::CScene::getAutomaticAnimationSet   const [inline]
 

Get a reference to the set of automatic animations.

Definition at line 455 of file scene.h.

References _AutomaticAnimationSet.

CCamera* NL3D::CScene::getCam   [inline]
 

Definition at line 196 of file scene.h.

References CurrentCamera.

CClipTrav* NL3D::CScene::getClipTrav   const [inline]
 

Definition at line 435 of file scene.h.

References ClipTrav.

uint8 NL3D::CScene::getCoarseMeshLightingUpdate   const [inline]
 

see setCoarseMeshLightingUpdate().

Definition at line 334 of file scene.h.

References _CoarseMeshLightingUpdate.

double NL3D::CScene::getCurrentSystemTime   const [inline]
 

System time is a time that always run (independent from the animation time that run only on animate()) It is updated at beginning of render().

Definition at line 263 of file scene.h.

References _GlobalSystemTime.

TGlobalAnimationTime NL3D::CScene::getCurrentTime void    const [inline]
 

get the current time of the scene, in second. It start from 0 (at the firt call of animate).

Definition at line 255 of file scene.h.

References _CurrentTime, and NL3D::TGlobalAnimationTime.

IDriver * NL3D::CScene::getDriver   const
 

Get the driver of render Traversal.

Definition at line 491 of file scene.cpp.

References RenderTrav.

CCoarseMeshManager* NL3D::CScene::getDynamicCoarseMeshManager   [inline]
 

Definition at line 323 of file scene.h.

References _DynamicCoarseMeshManager.

double NL3D::CScene::getEllapsedSystemTime   const [inline]
 

get the ellapsed time (in second) between the last 2 calls of render().

Definition at line 266 of file scene.h.

References _DeltaSystemTimeBetweenRender.

TAnimationTime NL3D::CScene::getEllapsedTime void    const [inline]
 

get the ellapsed time (in second) between the last 2 calls of animate.

Definition at line 258 of file scene.h.

References _EllapsedTime, and NL3D::TAnimationTime.

CInstanceGroup* NL3D::CScene::getGlobalInstanceGroup   [inline]
 

Definition at line 234 of file scene.h.

References _GlobalInstanceGroup.

const CVector& NL3D::CScene::getGlobalWindDirection   const [inline]
 

get the current windDirection.

Definition at line 427 of file scene.h.

References _GlobalWindDirection.

float NL3D::CScene::getGlobalWindPower   const [inline]
 

get the current windPower.

Definition at line 422 of file scene.h.

References _GlobalWindPower.

uint NL3D::CScene::getGroupLoadMaxPolygon const std::string &    group
 

Get the number of faces wanted for a LoadBlancingGroup.

The Group is created if did not exist.

Definition at line 780 of file scene.cpp.

References LoadBalancingTrav, and nlassert.

float NL3D::CScene::getGroupNbFaceAsked const std::string &    group const
 

Get the last face count asked from the instances before reduction.

only for the given group return 0 if the Group does not exist.

Definition at line 786 of file scene.cpp.

References LoadBalancingTrav, and nlassert.

CHrcTrav* NL3D::CScene::getHrcTrav   const [inline]
 

Definition at line 434 of file scene.h.

References HrcTrav.

bool NL3D::CScene::getLayersRenderingOrder   const
 

Definition at line 817 of file scene.cpp.

References nlassert, and RenderTrav.

float NL3D::CScene::getLightTransitionThreshold   const
 

See also:
getLightTransitionThreshold().

Definition at line 908 of file scene.cpp.

References LightTrav.

CLightTrav* NL3D::CScene::getLightTrav   const [inline]
 

Definition at line 436 of file scene.h.

References LightTrav.

CLoadBalancingTrav* NL3D::CScene::getLoadBalancingTrav   const [inline]
 

Definition at line 438 of file scene.h.

References LoadBalancingTrav.

CLodCharacterManager* NL3D::CScene::getLodCharacterManager   const [inline]
 

Get the LodCharacterManager. NULL if user did not set it. (done in DriverUser).

Definition at line 337 of file scene.h.

References _LodCharacterManager.

uint NL3D::CScene::getMaxLightContribution   const
 

See also:
setMaxLightContribution().

Definition at line 899 of file scene.cpp.

References LightTrav.

uint NL3D::CScene::getMaxSkeletonsInNotCLodForm   const [inline]
 

Definition at line 313 of file scene.h.

References _MaxSkeletonsInNotCLodForm.

float NL3D::CScene::getNbFaceAsked   const
 

Get the last face count asked from the instances before reduction.

It gets the sum of All groups.

Definition at line 765 of file scene.cpp.

References LoadBalancingTrav, and nlassert.

uint64 NL3D::CScene::getNumRender   const [inline]
 

get the number of time render has been called.

Definition at line 269 of file scene.h.

References _NumRender.

CParticleSystemManager & NL3D::CScene::getParticleSystemManager  
 

Get a ref. to the particle system manager. You shouldn't call this (has methods for private processing).

Definition at line 824 of file scene.cpp.

References _ParticleSystemManager.

CScene::TPolygonBalancingMode NL3D::CScene::getPolygonBalancingMode   const
 

Get the PolygonBalancingMode.

Definition at line 803 of file scene.cpp.

References LoadBalancingTrav, and nlassert.

CRenderTrav* NL3D::CScene::getRenderTrav   const [inline]
 

Definition at line 439 of file scene.h.

References RenderTrav.

const CShapeBank* NL3D::CScene::getShapeBank void    const [inline]
 

Get the shape bank (const version).

Definition at line 217 of file scene.h.

References _ShapeBank.

CShapeBank* NL3D::CScene::getShapeBank void    [inline]
 

Get the shape bank.

Definition at line 214 of file scene.h.

References _ShapeBank.

ItSkeletonModelList NL3D::CScene::getSkeletonModelListBegin   [inline]
 

Definition at line 471 of file scene.h.

References _SkeletonModelList, and ItSkeletonModelList.

ItSkeletonModelList NL3D::CScene::getSkeletonModelListEnd   [inline]
 

Definition at line 472 of file scene.h.

References _SkeletonModelList, and ItSkeletonModelList.

CSkipModel* NL3D::CScene::getSkipModelRoot   const [inline]
 

Definition at line 442 of file scene.h.

References SkipModelRoot.

CCoarseMeshManager* NL3D::CScene::getStaticCoarseMeshManager   [inline]
 

Definition at line 319 of file scene.h.

References _StaticCoarseMeshManager.

NLMISC::CRGBA NL3D::CScene::getSunAmbient   const
 

get the Ambient of the Sun used for the scene.

Definition at line 876 of file scene.cpp.

References RenderTrav.

NLMISC::CRGBA NL3D::CScene::getSunDiffuse   const
 

get the Diffuse of the Sun used for the scene.

Definition at line 880 of file scene.cpp.

References RenderTrav.

NLMISC::CVector NL3D::CScene::getSunDirection   const
 

get the Direction of the Sun used for the scene.

Definition at line 888 of file scene.cpp.

References RenderTrav.

NLMISC::CRGBA NL3D::CScene::getSunSpecular   const
 

get the Specular of the Sun used for the scene.

Definition at line 884 of file scene.cpp.

References RenderTrav.

CViewport NL3D::CScene::getViewport   [inline]
 

Definition at line 201 of file scene.h.

References _Viewport.

void NL3D::CScene::initCoarseMeshManager  
 

Create coarse meshes manager.

Definition at line 312 of file scene.cpp.

References _DynamicCoarseMeshManager, _StaticCoarseMeshManager, NL3D::CoarseMeshManagerId, NL3D::CMOT::createModel, NL3D_SCENE_DYNAMIC_COARSE_MANAGER_TEXTURE, and NL3D_SCENE_STATIC_COARSE_MANAGER_TEXTURE.

void NL3D::CScene::initDefaultRoots  
 

Create/setRoot the defaults models roots: a CTransform and a CLightGroup.

Definition at line 262 of file scene.cpp.

References AnimDetailTrav, ClipTrav, NL3D::CMOT::createModel, HrcTrav, LightModelRoot, LightTrav, LoadBalancingTrav, RenderTrav, Root, NL3D::RootModelId, NL3D::SkipModelId, SkipModelRoot, SonsOfAncestorSkeletonModelGroup, and NL3D::TransformId.

void NL3D::CScene::initDefaultTravs  
 

Create / register the 5 basic traversals:CHrcTrav, CClipTrav, CLightTrav, CAnimDetailTrav, CLoadBalancingTrav, CRenderTravInit.

Definition at line 241 of file scene.cpp.

References addTrav, AnimDetailTrav, ClipTrav, HrcTrav, LightTrav, LoadBalancingTrav, NL3D_MEM_MOT, and RenderTrav.

void NL3D::CScene::initGlobalnstanceGroup  
 

Create the world instance group (with only one cluster).

Definition at line 323 of file scene.cpp.

References _GlobalInstanceGroup, NL3D::ClipTravId, NL3D::ClusterId, NL3D::CMOT::createModel, and NL3D::CMOT::getTrav.

void NL3D::CScene::initQuadGridClipManager  
 

init QuadGridClipManager.

Definition at line 340 of file scene.cpp.

References _QuadGridClipManager, NL3D_QuadGridClipManagerMaxDist, NL3D_QuadGridClipManagerRadiusMax, NL3D_SCENE_QUADGRID_CLIP_CLUSTER_SIZE, and NL3D_SCENE_QUADGRID_CLIP_NUM_MAXDIST.

bool NL3D::CScene::isLightingSystemEnabled   const [inline]
 

see enableLightingSystem.

Definition at line 366 of file scene.h.

References _LightingSystemEnabled.

void NL3D::CScene::loadLightmapAutoAnim const std::string &   
 

Definition at line 693 of file scene.cpp.

References setAutoAnim.

void NL3D::CScene::registerBasics   [static]
 

Register Basic models and observers.

Definition at line 93 of file scene.cpp.

void NL3D::CScene::release   [virtual]
 

Release all relative to the scene (Models, traversals...)...

Destroy the Basic traversals too. The Lod Character Manager is reset() ed, but not deleted (at dtor only).

Reimplemented from NL3D::CMOT.

Definition at line 164 of file scene.cpp.

References _LodCharacterManager, _QuadGridClipManager, _ShapeBank, AnimDetailTrav, ClipTrav, CurrentCamera, NL3D::CMOT::getNumTrav, NL3D::CMOT::getTrav, HrcTrav, LightModelRoot, LightTrav, LoadBalancingTrav, RenderTrav, RenderTraversals, Root, SkipModelRoot, and SonsOfAncestorSkeletonModelGroup.

Referenced by ~CScene.

void NL3D::CScene::removeInstanceGroupForLightAnimation CInstanceGroup   ig
 

Remove an IG for auto PointLight Factor animation. called by CInstanceGroup::removeFromScene().

Definition at line 923 of file scene.cpp.

References _AnimatedIgSet, ItAnimatedIgSet, and nlassert.

void NL3D::CScene::render bool    doHrcPass = true
 

Render the scene, via the registered ITravScene, from the CurrentCamera view.

This also update waiting instance that are loaded asynchronously (by calling updateWaitingInstances) NB: no Driver clear buffers (color or ZBuffer) are done.... This call t->traverse() function to registered render traversal following their order given.

Parameters:
doHrcPass  set it to false to indicate that the CHrcTrav have not to be traversed. UseFull to optimize if you know that NONE of your models have moved (a good example is a shoot of the scene from different cameras).

Definition at line 374 of file scene.cpp.

References _DeltaSystemTimeBetweenRender, _GlobalSystemTime, _NumRender, _ParticleSystemManager, _QuadGridClipManager, _Viewport, AnimDetailTrav, NLMISC::clamp, ClipTrav, CurrentCamera, NLMISC::CTime::getPerformanceTime, HrcTrav, NL3D::HrcTravId, LightTrav, LoadBalancingTrav, nlassert, RenderTrav, RenderTraversals, NLMISC::CTime::ticksToSecond, and updateWaitingInstances.

void NL3D::CScene::setAmbientGlobal NLMISC::CRGBA    ambient
 

set the global Ambient used for the scene. Default to (50, 50, 50).

Definition at line 849 of file scene.cpp.

References RenderTrav.

void NL3D::CScene::setAsyncTextureManager CAsyncTextureManager   mgr [inline]
 

Set the async texture manager.

Definition at line 461 of file scene.h.

References _AsyncTextureManager.

void NL3D::CScene::setAutoAnim CAnimation   pAnim
 

Definition at line 632 of file scene.cpp.

References _AnimatedLightmap, _LightmapAnimations, and _LMAnimsAuto.

Referenced by loadLightmapAutoAnim.

void NL3D::CScene::setAutomaticAnimationSet CAnimationSet   as [inline]
 

set the automatic animation set used by this scene. It is stored as a smart pointer.

Definition at line 452 of file scene.h.

References _AutomaticAnimationSet.

void NL3D::CScene::setCam CCamera   cam [inline]
 

Set/Get the current camera/Viewport.

Definition at line 195 of file scene.h.

References CurrentCamera.

void NL3D::CScene::setCoarseMeshLightingUpdate uint8    period
 

Each coarseMesh lighting will be updated every "period" frame.

clamped to 1,255

Definition at line 933 of file scene.cpp.

References _CoarseMeshLightingUpdate.

void NL3D::CScene::setDriver IDriver   drv
 

Set the driver to render Traversal.

Definition at line 484 of file scene.cpp.

References RenderTrav.

void NL3D::CScene::setGlobalWindDirection const CVector &    gwd
 

Set the current windDirection for all the scene. dir.z set to 0 and vector normalized.

Definition at line 951 of file scene.cpp.

References _GlobalWindDirection.

void NL3D::CScene::setGlobalWindPower float    gwp
 

Weather mgt.

Definition at line 946 of file scene.cpp.

References _GlobalWindPower.

void NL3D::CScene::setGroupLoadMaxPolygon const std::string &    group,
uint    nFaces
 

Set the number of faces wanted for a LoadBlancingGroup.

The Group is created if did not exist.

Definition at line 773 of file scene.cpp.

References LoadBalancingTrav, and nlassert.

void NL3D::CScene::setLayersRenderingOrder bool    directOrder = true
 

Set the order or rendering for transparent objects.

In real case, with direct order, we have:

  • Underwater is rendered.
  • Water is rendered.
  • Objects above water are rendered.

Definition at line 810 of file scene.cpp.

References nlassert, and RenderTrav.

void NL3D::CScene::setLightTransitionThreshold float    lightTransitionThreshold
 

Advanced.

When a model is influenced by more light than allowed, or when it reach the limits of the light (attenuationEnd), the light can be darkened according to some threshold. The resultLightColor begin to fade when distModelToLight== attEnd- threshold*(attEnd-attBegin). when distModelToLight== 0, resultLightColor==Black. By default, this value is 0.1f. Setting higher values will smooth transition but will generally darken the global effects of lights. NB: clamp(value, 0, 1);

Definition at line 904 of file scene.cpp.

References LightTrav.

void NL3D::CScene::setLodCharacterManager CLodCharacterManager   m [inline]
 

set the LodCharacterManager.

Definition at line 339 of file scene.h.

References _LodCharacterManager.

void NL3D::CScene::setMaxLightContribution uint    nlights
 

setup the max number of point light that can influence a model.

NB: clamped by NL3D_MAX_LIGHT_CONTRIBUTION Default is 3. NB: the sun contribution is not taken into account

Definition at line 895 of file scene.cpp.

References LightTrav.

void NL3D::CScene::setMaxSkeletonsInNotCLodForm uint    m [inline]
 

LoadBalancing for CLod and Skeletons.

Setup the max number of skeletons displayed in std way (ie not CLod). Default is 20.

Definition at line 312 of file scene.h.

References _MaxSkeletonsInNotCLodForm.

void NL3D::CScene::setPolygonBalancingMode TPolygonBalancingMode    polBalMode
 

Set the PolygonBalancingMode.

Definition at line 795 of file scene.cpp.

References LoadBalancingTrav, and nlassert.

void NL3D::CScene::setShapeBank CShapeBank   pShapeBank
 

Set the shape bank.

Definition at line 508 of file scene.cpp.

References _ShapeBank.

void NL3D::CScene::setSunAmbient NLMISC::CRGBA    ambient
 

set the Ambient of the Sun used for the scene.

Definition at line 853 of file scene.cpp.

References RenderTrav.

void NL3D::CScene::setSunDiffuse NLMISC::CRGBA    diffuse
 

set the Diffuse of the Sun used for the scene.

Definition at line 857 of file scene.cpp.

References RenderTrav.

void NL3D::CScene::setSunDirection const NLMISC::CVector   direction
 

set the Direction of the Sun used for the scene.

Definition at line 865 of file scene.cpp.

References RenderTrav.

void NL3D::CScene::setSunSpecular NLMISC::CRGBA    specular
 

set the Specular of the Sun used for the scene.

Definition at line 861 of file scene.cpp.

References RenderTrav.

void NL3D::CScene::setViewport const class CViewport   viewport [inline]
 

Definition at line 197 of file scene.h.

References _Viewport.

void NL3D::CScene::updateWaitingInstances double    systemTimeEllapsed
 

Particle system handling (remove the resources of those which are too far, as their clusters may not have been parsed).

Parameters:
systemTimeEllapsed  : the time between 2 calls to updateWaitingInstances, in seconds

Definition at line 448 of file scene.cpp.

References _ShapeBank, and _WaitingInstances.

Referenced by render.


Member Data Documentation

TAnimatedIgSet NL3D::CScene::_AnimatedIgSet [private]
 

Definition at line 527 of file scene.h.

Referenced by addInstanceGroupForLightAnimation, animate, and removeInstanceGroupForLightAnimation.

std::set<CAnimatedLightmap*> NL3D::CScene::_AnimatedLightmap [private]
 

Definition at line 522 of file scene.h.

Referenced by animate, and setAutoAnim.

CAsyncTextureManager* NL3D::CScene::_AsyncTextureManager [private]
 

Definition at line 577 of file scene.h.

Referenced by CScene, getAsyncTextureManager, and setAsyncTextureManager.

NLMISC::CSmartPtr<CAnimationSet> NL3D::CScene::_AutomaticAnimationSet [private]
 

Definition at line 573 of file scene.h.

Referenced by getAutomaticAnimationSet, and setAutomaticAnimationSet.

uint8 NL3D::CScene::_CoarseMeshLightingUpdate [private]
 

set setCoarseMeshLightingUpdate.

Definition at line 557 of file scene.h.

Referenced by CScene, getCoarseMeshLightingUpdate, and setCoarseMeshLightingUpdate.

TGlobalAnimationTime NL3D::CScene::_CurrentTime [private]
 

Definition at line 484 of file scene.h.

Referenced by animate, CScene, and getCurrentTime.

double NL3D::CScene::_DeltaSystemTimeBetweenRender [private]
 

Definition at line 496 of file scene.h.

Referenced by getEllapsedSystemTime, and render.

CRefPtr<CCoarseMeshManager> NL3D::CScene::_DynamicCoarseMeshManager [private]
 

Definition at line 542 of file scene.h.

Referenced by CScene, getDynamicCoarseMeshManager, and initCoarseMeshManager.

TAnimationTime NL3D::CScene::_EllapsedTime [private]
 

Definition at line 493 of file scene.h.

Referenced by animate, CScene, and getEllapsedTime.

bool NL3D::CScene::_FirstAnimateCall [private]
 

Definition at line 490 of file scene.h.

Referenced by animate, and CScene.

CInstanceGroup* NL3D::CScene::_GlobalInstanceGroup [private]
 

Definition at line 536 of file scene.h.

Referenced by getGlobalInstanceGroup, and initGlobalnstanceGroup.

double NL3D::CScene::_GlobalSystemTime [private]
 

Definition at line 497 of file scene.h.

Referenced by getCurrentSystemTime, and render.

CVector NL3D::CScene::_GlobalWindDirection [private]
 

Definition at line 568 of file scene.h.

Referenced by CScene, getGlobalWindDirection, and setGlobalWindDirection.

float NL3D::CScene::_GlobalWindPower [private]
 

Definition at line 567 of file scene.h.

Referenced by CScene, getGlobalWindPower, and setGlobalWindPower.

bool NL3D::CScene::_LightingSystemEnabled [private]
 

Definition at line 554 of file scene.h.

Referenced by CScene, enableLightingSystem, and isLightingSystemEnabled.

CAnimationSet NL3D::CScene::_LightmapAnimations [private]
 

Definition at line 521 of file scene.h.

Referenced by setAutoAnim.

CPlayListManager NL3D::CScene::_LMAnimsAuto [private]
 

Definition at line 523 of file scene.h.

Referenced by animate, and setAutoAnim.

CLodCharacterManager* NL3D::CScene::_LodCharacterManager [private]
 

Definition at line 544 of file scene.h.

Referenced by CScene, getLodCharacterManager, release, and setLodCharacterManager.

uint NL3D::CScene::_MaxSkeletonsInNotCLodForm [private]
 

Definition at line 583 of file scene.h.

Referenced by CScene, getMaxSkeletonsInNotCLodForm, and setMaxSkeletonsInNotCLodForm.

uint64 NL3D::CScene::_NumRender [private]
 

Definition at line 498 of file scene.h.

Referenced by CScene, getNumRender, and render.

CParticleSystemManager NL3D::CScene::_ParticleSystemManager [private]
 

Definition at line 561 of file scene.h.

Referenced by animate, getParticleSystemManager, and render.

CQuadGridClipManager NL3D::CScene::_QuadGridClipManager [private]
 

Definition at line 549 of file scene.h.

Referenced by initQuadGridClipManager, release, and render.

TGlobalAnimationTime NL3D::CScene::_RealTime [private]
 

Definition at line 487 of file scene.h.

Referenced by animate, and CScene.

CShapeBank* NL3D::CScene::_ShapeBank [private]
 

Definition at line 531 of file scene.h.

Referenced by CScene, deleteInstance, getShapeBank, release, setShapeBank, and updateWaitingInstances.

TSkeletonModelList NL3D::CScene::_SkeletonModelList [private]
 

Definition at line 581 of file scene.h.

Referenced by appendSkeletonModelToList, eraseSkeletonModelToList, getSkeletonModelListBegin, and getSkeletonModelListEnd.

CRefPtr<CCoarseMeshManager> NL3D::CScene::_StaticCoarseMeshManager [private]
 

Definition at line 541 of file scene.h.

Referenced by CScene, getStaticCoarseMeshManager, and initCoarseMeshManager.

CViewport NL3D::CScene::_Viewport [private]
 

Definition at line 481 of file scene.h.

Referenced by getViewport, render, and setViewport.

TWaitingInstancesMMap NL3D::CScene::_WaitingInstances [private]
 

Definition at line 534 of file scene.h.

Referenced by updateWaitingInstances.

CAnimDetailTrav* NL3D::CScene::AnimDetailTrav [private]
 

Definition at line 506 of file scene.h.

Referenced by CScene, getAnimDetailTrav, initDefaultRoots, initDefaultTravs, release, and render.

CClipTrav* NL3D::CScene::ClipTrav [private]
 

Definition at line 504 of file scene.h.

Referenced by CScene, getClipTrav, initDefaultRoots, initDefaultTravs, release, and render.

CRefPtr<CCamera> NL3D::CScene::CurrentCamera [private]
 

The camera / Viewport.

Definition at line 480 of file scene.h.

Referenced by getCam, release, render, and setCam.

CHrcTrav* NL3D::CScene::HrcTrav [private]
 

Definition at line 503 of file scene.h.

Referenced by CScene, getHrcTrav, initDefaultRoots, initDefaultTravs, release, and render.

CRootModel* NL3D::CScene::LightModelRoot [private]
 

Definition at line 517 of file scene.h.

Referenced by CScene, initDefaultRoots, and release.

CLightTrav* NL3D::CScene::LightTrav [private]
 

Definition at line 505 of file scene.h.

Referenced by CScene, enableLightingSystem, getLightTransitionThreshold, getLightTrav, getMaxLightContribution, initDefaultRoots, initDefaultTravs, release, render, setLightTransitionThreshold, and setMaxLightContribution.

CLoadBalancingTrav* NL3D::CScene::LoadBalancingTrav [private]
 

Definition at line 507 of file scene.h.

Referenced by CScene, getGroupLoadMaxPolygon, getGroupNbFaceAsked, getLoadBalancingTrav, getNbFaceAsked, getPolygonBalancingMode, initDefaultRoots, initDefaultTravs, release, render, setGroupLoadMaxPolygon, and setPolygonBalancingMode.

CRenderTrav* NL3D::CScene::RenderTrav [private]
 

Definition at line 508 of file scene.h.

Referenced by CScene, enableLightingSystem, getAmbientGlobal, getDriver, getLayersRenderingOrder, getRenderTrav, getSunAmbient, getSunDiffuse, getSunDirection, getSunSpecular, initDefaultRoots, initDefaultTravs, release, render, setAmbientGlobal, setDriver, setLayersRenderingOrder, setSunAmbient, setSunDiffuse, setSunDirection, and setSunSpecular.

TTravMap NL3D::CScene::RenderTraversals [private]
 

Definition at line 477 of file scene.h.

Referenced by addTrav, release, and render.

CTransform* NL3D::CScene::Root [private]
 

Definition at line 512 of file scene.h.

Referenced by CScene, initDefaultRoots, and release.

CSkipModel* NL3D::CScene::SkipModelRoot [private]
 

Definition at line 513 of file scene.h.

Referenced by CScene, getSkipModelRoot, initDefaultRoots, and release.

CRootModel* NL3D::CScene::SonsOfAncestorSkeletonModelGroup [private]
 

Definition at line 515 of file scene.h.

Referenced by CScene, initDefaultRoots, and release.


The documentation for this class was generated from the following files: