|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CSceneUser Class Reference<Class description>.
More...
#include <scene_user.h>
Inheritance diagram for NL3D::CSceneUser:
List of all members.
Public Methods |
|
| CSceneUser (CDriverUser *drv) |
virtual | ~CSceneUser () |
|
virtual void | render () |
| Render the scene from the CurrentCamera view (setCam()), and the current Viewport. More...
|
virtual void | updateWaitingInstances (double ellapsedTime) |
| Update waiting instances and igs that are loaded asynchronously NB: this is called by render(). More...
|
virtual void | animate (TGlobalAnimationTime time) |
| Set the animation time for lightmap and Particle System animation. More...
|
|
virtual void | setCam (UCamera *cam) |
| Set the current camera for this scene. nlError if NULL, or if the camera was not created by this UScene. More...
|
virtual UCamera * | getCam () |
| Get the current camera. More...
|
virtual void | setViewport (const class CViewport &viewport) |
| Set the current Viewport. More...
|
virtual CViewport | getViewport () |
| Get the current Viewport. More...
|
|
virtual UCamera * | createCamera () |
| Create a camera. Usefull for this scene only. More...
|
virtual void | deleteCamera (UCamera *cam) |
| Delete a camera. More...
|
virtual UInstance * | createInstance (const std::string &shapeName) |
| Create an instance of the shape "shapename". More...
|
virtual void | createInstanceAsync (const std::string &shapeName, UInstance **ppInstance) |
| Same as createInstance but the instance is loaded asynchronously. More...
|
virtual void | deleteInstance (UInstance *inst) |
| Delete an instance via his pointer. More...
|
virtual void | createInstanceGroupAndAddToSceneAsync (const std::string &instanceGroup, UInstanceGroup **pIG, const NLMISC::CVector &offset) |
| create an instance group asynchronously, and add it to a scene asynchronously once it has been loaded. More...
|
virtual void | stopCreatingAndAddingIG (UInstanceGroup **pIG) |
| Stop loading and adding an ig to the scene. More...
|
void | updateWaitingIG () |
| should be called at each render. More...
|
virtual UTransform * | createTransform () |
| Create a dummy object. More...
|
virtual void | deleteTransform (UTransform *tr) |
| Delete a dummy object. More...
|
virtual USkeleton * | createSkeleton (const std::string &shapeName) |
| Create a skeleton instance of the skeleton shape "shapename". More...
|
virtual void | deleteSkeleton (USkeleton *skel) |
| Delete a skeleton instance via his pointer. More...
|
virtual ULandscape * | createLandscape () |
| Create a landscape. There could be many Landscape per Scene (Driver? :). But never tested :). More...
|
virtual void | deleteLandscape (ULandscape *land) |
| delete a landscape. More...
|
virtual UCloudScape * | createCloudScape () |
| Create a landscape. There could be many Landscape per Scene (Driver? :). But never tested :). More...
|
virtual void | deleteCloudScape (UCloudScape *cs) |
| delete a landscape. More...
|
virtual void | setToGlobalInstanceGroup (UInstanceGroup *pIG) |
| Assign the Instance Group to the root cluster. More...
|
virtual UPointLight * | createPointLight () |
| Create a dynamic PointLight. Usefull for this scene only. More...
|
virtual void | deletePointLight (UPointLight *light) |
| Delete a dynamic PointLight. More...
|
|
virtual UAnimationSet * | createAnimationSet () |
| Create an empty AnimationSet. More...
|
virtual UAnimationSet * | createAnimationSet (const std::string &animationSetFile) |
| Create a new AnimationSet, load it from a file. Use CPath to search the animation set. exception EPathNotFound if not found. More...
|
virtual void | deleteAnimationSet (UAnimationSet *animationSet) |
| Delete a AnimationSet. More...
|
virtual void | setAutomaticAnimationSet (UAnimationSet *as) |
| Set the automatic animation set used by the scene. More...
|
virtual UPlayListManager * | createPlayListManager () |
| Create a new PlayListManager. More...
|
virtual void | deletePlayListManager (UPlayListManager *playListManager) |
| Delete a PlayListManager. More...
|
|
virtual UVisualCollisionManager * | createVisualCollisionManager () |
virtual void | deleteVisualCollisionManager (UVisualCollisionManager *mgr) |
|
virtual void | setPolygonBalancingMode (TPolygonBalancingMode polBalMode) |
| Set the PolygonBalancingMode. More...
|
virtual TPolygonBalancingMode | getPolygonBalancingMode () const |
| Get the PolygonBalancingMode. More...
|
virtual float | getNbFaceAsked () const |
| Get the last face count asked from the instances before reduction. More...
|
virtual void | setGroupLoadMaxPolygon (const std::string &group, uint nFaces) |
| Set the number of faces wanted for a LoadBlancingGroup. More...
|
virtual uint | getGroupLoadMaxPolygon (const std::string &group) |
| Get the number of faces wanted for a LoadBlancingGroup. More...
|
virtual float | getGroupNbFaceAsked (const std::string &group) const |
| Get the last face count asked from the instances before reduction. More...
|
virtual void | setMaxSkeletonsInNotCLodForm (uint m) |
| LoadBalancing for CLod and Skeletons. More...
|
virtual uint | getMaxSkeletonsInNotCLodForm () const |
| see setMaxSkeletonsInNotCLodForm(). More...
|
|
virtual void | setStaticCoarseMeshManagerTexture (const char *sPath) |
| Set the static coarse meshes's common texture. More...
|
virtual void | setDynamicCoarseMeshManagerTexture (const char *sPath) |
| Set the dynamic coarse meshes's common texture. More...
|
virtual void | setCoarseMeshLightingUpdate (uint8 period) |
| Each coarseMesh lighting will be updated every "period" frame. More...
|
virtual uint8 | getCoarseMeshLightingUpdate () const |
| see setCoarseMeshLightingUpdate(). More...
|
|
virtual void | setLayersRenderingOrder (bool directOrder=true) |
| Set the order or rendering of layers containing transparent objects. More...
|
virtual bool | getLayersRenderingOrder () const |
|
virtual void | enableLightingSystem (bool enable) |
| Enable Scene Lighting system. More...
|
virtual void | setAmbientGlobal (NLMISC::CRGBA ambient) |
| set the global Ambient used for the scene. Default to (50, 50, 50). More...
|
virtual void | setSunAmbient (NLMISC::CRGBA ambient) |
| set the Ambient of the Sun used for the scene. More...
|
virtual void | setSunDiffuse (NLMISC::CRGBA diffuse) |
| set the Diffuse of the Sun used for the scene. More...
|
virtual void | setSunSpecular (NLMISC::CRGBA specular) |
| set the Specular of the Sun used for the scene. More...
|
virtual void | setSunDirection (const NLMISC::CVector &direction) |
| set the Direction of the Sun used for the scene. More...
|
virtual NLMISC::CRGBA | getAmbientGlobal () const |
| get the global Ambient used for the scene. Default to (50, 50, 50). More...
|
virtual NLMISC::CRGBA | getSunAmbient () const |
| get the Ambient of the Sun used for the scene. More...
|
virtual NLMISC::CRGBA | getSunDiffuse () const |
| get the Diffuse of the Sun used for the scene. More...
|
virtual NLMISC::CRGBA | getSunSpecular () const |
| get the Specular of the Sun used for the scene. More...
|
virtual NLMISC::CVector | getSunDirection () const |
| get the Direction of the Sun used for the scene. More...
|
virtual void | setMaxLightContribution (uint nlights) |
| setup the max number of point light that can influence a model. More...
|
virtual uint | getMaxLightContribution () const |
| -
See also:
-
setMaxLightContribution().
More...
|
virtual void | setLightTransitionThreshold (float lightTransitionThreshold) |
| Advanced. More...
|
virtual float | getLightTransitionThreshold () const |
| -
See also:
-
getLightTransitionThreshold().
More...
|
|
virtual void | setGlobalWindPower (float gwp) |
| Set the current windPower for all the scene. 0-1. More...
|
virtual float | getGlobalWindPower () const |
| get the current windPower. More...
|
virtual void | setGlobalWindDirection (const NLMISC::CVector &gwd) |
| Set the current windDirection for all the scene. dir.z set to 0 and vector normalized. More...
|
virtual const NLMISC::CVector & | getGlobalWindDirection () const |
| get the current windDirection. More...
|
|
virtual void | resetCLodManager () |
| reset the manager. More...
|
virtual uint32 | loadCLodShapeBank (const std::string &fileName) |
| Load a Shape Bank. More...
|
virtual void | deleteCLodShapeBank (uint32 bankId) |
| delete a Shape Bank. No-op if bad id. More...
|
virtual sint32 | getCLodShapeIdByName (const std::string &name) const |
| Get a shapeId by its name. More...
|
virtual sint32 | getCLodAnimIdByName (uint32 shapeId, const std::string &name) const |
| Get a AnimId of a shape by its name. More...
|
|
CScene & | getScene () |
Protected Types |
typedef CPtrSet< CTransformUser > | TTransformSet |
typedef CPtrSet< CLandscapeUser > | TLandscapeSet |
typedef CPtrSet< CCloudScapeUser > | TCloudScapeSet |
typedef CPtrSet< CInstanceGroupUser > | TInstanceGroupSet |
typedef CPtrSet< CVisualCollisionManagerUser > | TVisualCollisionManagerSet |
typedef CPtrSet< CAnimationSetUser > | TAnimationSetSet |
typedef CPtrSet< CPlayListManagerUser > | TPlayListManagerSet |
typedef std::list< CWaitingIG > | TWaitingIGList |
Protected Attributes |
CDriverUser * | _DriverUser |
| The driver which owns this scene. More...
|
CScene | _Scene |
| The Scene. More...
|
CCameraUser * | _CurrentCamera |
| The Current camera. More...
|
TTransformSet | _Transforms |
TLandscapeSet | _Landscapes |
TCloudScapeSet | _CloudScapes |
TInstanceGroupSet | _InstanceGroups |
TVisualCollisionManagerSet | _VisualCollisionManagers |
TAnimationSetSet | _AnimationSets |
TPlayListManagerSet | _PlayListManagers |
std::map< UInstance **, CTransformShape * > | _WaitingInstances |
TWaitingIGList | _WaitingIGs |
Private Methods |
virtual void | updateWaitingInstances () |
| update async loading during a call to render. More...
|
Detailed Description
<Class description>.
-
Author:
-
Lionel Berenguier , Nevrax France
-
Date:
-
2001
Definition at line 62 of file scene_user.h.
Member Typedef Documentation
Constructor & Destructor Documentation
NL3D::CSceneUser::~CSceneUser |
( |
|
) |
[virtual] |
|
Member Function Documentation
UAnimationSet * NL3D::CSceneUser::createAnimationSet |
( |
const std::string & |
animationSetFile |
) |
[virtual] |
|
UAnimationSet * NL3D::CSceneUser::createAnimationSet |
( |
|
) |
[virtual] |
|
UCamera * NL3D::CSceneUser::createCamera |
( |
|
) |
[virtual] |
|
UCloudScape * NL3D::CSceneUser::createCloudScape |
( |
|
) |
[virtual] |
|
UInstance * NL3D::CSceneUser::createInstance |
( |
const std::string & |
shapeName |
) |
[virtual] |
|
void NL3D::CSceneUser::createInstanceAsync |
( |
const std::string & |
shapeName, |
|
|
UInstance ** |
ppInstance |
|
) |
[virtual] |
|
void NL3D::CSceneUser::createInstanceGroupAndAddToSceneAsync |
( |
const std::string & |
instanceGroup, |
|
|
UInstanceGroup ** |
pIG, |
|
|
const NLMISC::CVector & |
offset |
|
) |
[virtual] |
|
|
create an instance group asynchronously, and add it to a scene asynchronously once it has been loaded.
The instance groups that must be added to the scene are checked at each render. The pIG pointer is filled once the instance group has been loaded and add to the scene
Implements NL3D::UScene.
Definition at line 733 of file scene_user.cpp.
References _WaitingIGs, NL3D_HAUTO_ASYNC_IG, NL3D_MEM_IG, and offset. |
ULandscape * NL3D::CSceneUser::createLandscape |
( |
|
) |
[virtual] |
|
UPointLight * NL3D::CSceneUser::createPointLight |
( |
|
) |
[virtual] |
|
USkeleton * NL3D::CSceneUser::createSkeleton |
( |
const std::string & |
shapeName |
) |
[virtual] |
|
UTransform * NL3D::CSceneUser::createTransform |
( |
|
) |
[virtual] |
|
void NL3D::CSceneUser::deleteAnimationSet |
( |
UAnimationSet * |
animationSet |
) |
[virtual] |
|
void NL3D::CSceneUser::deleteCamera |
( |
UCamera * |
cam |
) |
[virtual] |
|
void NL3D::CSceneUser::deleteCLodShapeBank |
( |
uint32 |
bankId |
) |
[virtual] |
|
void NL3D::CSceneUser::deleteCloudScape |
( |
UCloudScape * |
cs |
) |
[virtual] |
|
void NL3D::CSceneUser::deleteInstance |
( |
UInstance * |
inst |
) |
[virtual] |
|
void NL3D::CSceneUser::deleteLandscape |
( |
ULandscape * |
land |
) |
[virtual] |
|
void NL3D::CSceneUser::deletePlayListManager |
( |
UPlayListManager * |
playListManager |
) |
[virtual] |
|
void NL3D::CSceneUser::deletePointLight |
( |
UPointLight * |
light |
) |
[virtual] |
|
void NL3D::CSceneUser::deleteSkeleton |
( |
USkeleton * |
skel |
) |
[virtual] |
|
void NL3D::CSceneUser::deleteTransform |
( |
UTransform * |
tr |
) |
[virtual] |
|
void NL3D::CSceneUser::enableLightingSystem |
( |
bool |
enable |
) |
[virtual] |
|
NLMISC::CRGBA NL3D::CSceneUser::getAmbientGlobal |
( |
|
) |
const [virtual] |
|
UCamera * NL3D::CSceneUser::getCam |
( |
|
) |
[virtual] |
|
sint32 NL3D::CSceneUser::getCLodAnimIdByName |
( |
uint32 |
shapeId, |
|
|
const std::string & |
name |
|
) |
const [virtual] |
|
sint32 NL3D::CSceneUser::getCLodShapeIdByName |
( |
const std::string & |
name |
) |
const [virtual] |
|
uint8 NL3D::CSceneUser::getCoarseMeshLightingUpdate |
( |
|
) |
const [virtual] |
|
const CVector & NL3D::CSceneUser::getGlobalWindDirection |
( |
|
) |
const [virtual] |
|
float NL3D::CSceneUser::getGlobalWindPower |
( |
|
) |
const [virtual] |
|
uint NL3D::CSceneUser::getGroupLoadMaxPolygon |
( |
const std::string & |
group |
) |
[virtual] |
|
float NL3D::CSceneUser::getGroupNbFaceAsked |
( |
const std::string & |
group |
) |
const [virtual] |
|
virtual bool NL3D::CSceneUser::getLayersRenderingOrder |
( |
|
) |
const [inline, virtual] |
|
float NL3D::CSceneUser::getLightTransitionThreshold |
( |
|
) |
const [virtual] |
|
uint NL3D::CSceneUser::getMaxLightContribution |
( |
|
) |
const [virtual] |
|
uint NL3D::CSceneUser::getMaxSkeletonsInNotCLodForm |
( |
|
) |
const [virtual] |
|
float NL3D::CSceneUser::getNbFaceAsked |
( |
|
) |
const [virtual] |
|
CScene& NL3D::CSceneUser::getScene |
( |
void |
|
) |
[inline] |
|
NLMISC::CRGBA NL3D::CSceneUser::getSunAmbient |
( |
|
) |
const [virtual] |
|
NLMISC::CRGBA NL3D::CSceneUser::getSunDiffuse |
( |
|
) |
const [virtual] |
|
NLMISC::CRGBA NL3D::CSceneUser::getSunSpecular |
( |
|
) |
const [virtual] |
|
CViewport NL3D::CSceneUser::getViewport |
( |
|
) |
[virtual] |
|
uint32 NL3D::CSceneUser::loadCLodShapeBank |
( |
const std::string & |
fileName |
) |
[virtual] |
|
|
Load a Shape Bank.
The ShapeMap is rebuilded. Hence slow call. NB: a vector of ShapeBank is maintained internally, hence, not so many shapeBank should be created at same Time. trhow exception if failed to load the file -
Parameters:
-
fileName |
is a .clodbank file, to be loaded. CPath::lookup is used. |
-
Returns:
-
id of the shape Bank.
Implements NL3D::UScene.
Definition at line 474 of file scene_user.cpp.
References _Scene, file, NL3D_HAUTO_LOAD_LOD, NL3D_MEM_LOD, and nlassert. |
void NL3D::CSceneUser::render |
( |
|
) |
[virtual] |
|
void NL3D::CSceneUser::resetCLodManager |
( |
|
) |
[virtual] |
|
void NL3D::CSceneUser::setAmbientGlobal |
( |
NLMISC::CRGBA |
ambient |
) |
[virtual] |
|
void NL3D::CSceneUser::setAutomaticAnimationSet |
( |
UAnimationSet * |
as |
) |
[virtual] |
|
void NL3D::CSceneUser::setCam |
( |
UCamera * |
cam |
) |
[virtual] |
|
void NL3D::CSceneUser::setCoarseMeshLightingUpdate |
( |
uint8 |
period |
) |
[virtual] |
|
void NL3D::CSceneUser::setDynamicCoarseMeshManagerTexture |
( |
const char * |
sPath |
) |
[virtual] |
|
void NL3D::CSceneUser::setGlobalWindDirection |
( |
const NLMISC::CVector & |
gwd |
) |
[virtual] |
|
|
Set the current windDirection for all the scene. dir.z set to 0 and vector normalized.
Implements NL3D::UScene.
Definition at line 404 of file scene_user.cpp.
References _Scene. |
void NL3D::CSceneUser::setGlobalWindPower |
( |
float |
gwp |
) |
[virtual] |
|
void NL3D::CSceneUser::setGroupLoadMaxPolygon |
( |
const std::string & |
group, |
|
|
uint |
nFaces |
|
) |
[virtual] |
|
virtual void NL3D::CSceneUser::setLayersRenderingOrder |
( |
bool |
directOrder = true |
) |
[inline, virtual] |
|
|
Set the order or rendering of layers containing transparent objects.
In real case, with direct order, we have:
- Underwater is rendered.
- Water is rendered.
- Objects above water are rendered.
Implements NL3D::UScene.
Definition at line 230 of file scene_user.h.
References _Scene. |
void NL3D::CSceneUser::setLightTransitionThreshold |
( |
float |
lightTransitionThreshold |
) |
[virtual] |
|
|
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);
Implements NL3D::UScene.
Definition at line 346 of file scene_user.cpp.
References _Scene, NL3D_HAUTO_UI_SCENE, and NL3D_MEM_LIGHT. |
void NL3D::CSceneUser::setMaxLightContribution |
( |
uint |
nlights |
) |
[virtual] |
|
void NL3D::CSceneUser::setMaxSkeletonsInNotCLodForm |
( |
uint |
m |
) |
[virtual] |
|
|
LoadBalancing for CLod and Skeletons.
Setup the max number of skeletons displayed in std way (ie not CLod). Default is 20.
Implements NL3D::UScene.
Definition at line 967 of file scene_user.cpp.
References _Scene. |
void NL3D::CSceneUser::setStaticCoarseMeshManagerTexture |
( |
const char * |
sPath |
) |
[virtual] |
|
void NL3D::CSceneUser::setSunAmbient |
( |
NLMISC::CRGBA |
ambient |
) |
[virtual] |
|
void NL3D::CSceneUser::setSunDiffuse |
( |
NLMISC::CRGBA |
diffuse |
) |
[virtual] |
|
void NL3D::CSceneUser::setSunDirection |
( |
const NLMISC::CVector & |
direction |
) |
[virtual] |
|
void NL3D::CSceneUser::setSunSpecular |
( |
NLMISC::CRGBA |
specular |
) |
[virtual] |
|
void NL3D::CSceneUser::setToGlobalInstanceGroup |
( |
UInstanceGroup * |
pIG |
) |
[virtual] |
|
void NL3D::CSceneUser::setViewport |
( |
const class CViewport & |
viewport |
) |
[virtual] |
|
void NL3D::CSceneUser::stopCreatingAndAddingIG |
( |
UInstanceGroup ** |
pIG |
) |
[virtual] |
|
void NL3D::CSceneUser::updateWaitingIG |
( |
|
) |
|
|
void NL3D::CSceneUser::updateWaitingInstances |
( |
double |
ellapsedTime |
) |
[virtual] |
|
void NL3D::CSceneUser::updateWaitingInstances |
( |
|
) |
[private, virtual] |
|
Member Data Documentation
CCameraUser* NL3D::CSceneUser::_CurrentCamera [protected]
|
|
CScene NL3D::CSceneUser::_Scene [protected]
|
|
|
The Scene.
Definition at line 71 of file scene_user.h.
Referenced by animate, createCamera, createCloudScape, createInstance, createInstanceAsync, createLandscape, createPointLight, createSkeleton, createTransform, CSceneUser, deleteCLodShapeBank, enableLightingSystem, getAmbientGlobal, getCLodAnimIdByName, getCLodShapeIdByName, getCoarseMeshLightingUpdate, getGlobalWindDirection, getGlobalWindPower, getGroupLoadMaxPolygon, getGroupNbFaceAsked, getLayersRenderingOrder, getLightTransitionThreshold, getMaxLightContribution, getMaxSkeletonsInNotCLodForm, getNbFaceAsked, getPolygonBalancingMode, getScene, getSunAmbient, getSunDiffuse, getSunDirection, getSunSpecular, getViewport, loadCLodShapeBank, render, resetCLodManager, setAmbientGlobal, setAutomaticAnimationSet, setCam, setCoarseMeshLightingUpdate, setDynamicCoarseMeshManagerTexture, setGlobalWindDirection, setGlobalWindPower, setGroupLoadMaxPolygon, setLayersRenderingOrder, setLightTransitionThreshold, setMaxLightContribution, setMaxSkeletonsInNotCLodForm, setPolygonBalancingMode, setStaticCoarseMeshManagerTexture, setSunAmbient, setSunDiffuse, setSunDirection, setSunSpecular, setToGlobalInstanceGroup, setViewport, updateWaitingInstances, and ~CSceneUser. |
|
Definition at line 84 of file scene_user.h.
Referenced by createCamera, createInstance, createPointLight, createSkeleton, createTransform, deleteCamera, deleteInstance, deletePointLight, deleteSkeleton, deleteTransform, updateWaitingInstances, and ~CSceneUser. |
The documentation for this class was generated from the following files:
|
|