|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CInstanceGroup Class ReferenceA CInstanceGroup is a group of mesh instance and so composed by A reference to a mesh (refered by the name) The transformations to get it to the world The parent.
More...
#include <scene_group.h>
List of all members.
PointLight part |
void | buildPointLightList (const std::vector< CPointLightNamed > &pointLightList, std::vector< uint > &plRemap) |
| Build the list of light. NB: sort by LightGroupName the array, and return index remap. More...
|
bool | _RealTimeSunContribution |
| RealTimeSunContribution. Used for ig_lighter and zone_ig_lighter. More...
|
CPointLightNamedArray | _PointLightArray |
| Array of pointLights. More...
|
CIGSurfaceLight | _IGSurfaceLight |
| The object used to light dynamic models in town and buildings. More...
|
Public Types |
typedef std::vector< CInstance > | TInstanceArray |
| A vector of instance. More...
|
enum | { NumStaticLightPerInstance = 2
} |
| Should Never be changed. More...
|
enum | TState { StateNotAdded = 0,
StateAdding,
StateAdded
} |
Public Methods |
uint | getNumInstance () const |
| Get number of instance in this group. More...
|
const std::string & | getShapeName (uint instanceNb) const |
| Get the name of the mesh referenced. More...
|
const std::string & | getInstanceName (uint instanceNb) const |
| Get the instance name. More...
|
const NLMISC::CVector & | getInstancePos (uint instanceNb) const |
| Get an instance position. More...
|
const NLMISC::CQuat & | getInstanceRot (uint instanceNb) const |
| Get an instance rotation. More...
|
const NLMISC::CVector & | getInstanceScale (uint instanceNb) const |
void | getInstanceMatrix (uint instanceNb, NLMISC::CMatrix &dest) const |
const sint32 | getInstanceParent (uint instanceNb) const |
const CInstance & | getInstance (uint instanceNb) const |
CInstance & | getInstance (uint instanceNb) |
const NLMISC::CVector & | getGlobalPos () const |
CTransformShape * | getTransformShape (uint instanceNb) const |
| Get the instance added to the scene. More...
|
| CInstanceGroup () |
| Construct, serialize and link to scene. More...
|
| ~CInstanceGroup () |
void | build (const CVector &vGlobalPos, const TInstanceArray &array, const std::vector< CCluster > &Portals, const std::vector< CPortal > &Clusters) |
| Build the group Build with an empty list of light. More...
|
void | build (const CVector &vGlobalPos, const TInstanceArray &array, const std::vector< CCluster > &Portals, const std::vector< CPortal > &Clusters, const std::vector< CPointLightNamed > &pointLightList, const CIGSurfaceLight::TRetrieverGridMap *retrieverGridMap=NULL, float igSurfaceLightCellSize=0) |
| Build the group Build also the list of light. More...
|
void | retrieve (CVector &vGlobalPos, TInstanceArray &array, std::vector< CCluster > &Portals, std::vector< CPortal > &Clusters, std::vector< CPointLightNamed > &pointLightList) const |
| Retreive group information. More...
|
void | serial (NLMISC::IStream &f) |
| Serial the group. More...
|
void | createRoot (CScene &scene) |
| Add all the instances to the scene. More...
|
void | setTransformNameCallback (ITransformName *pTN) |
| Setup the callback in charge of changing name at the addToScene moment. More...
|
void | setAddRemoveInstanceCallback (IAddRemoveInstance *callback) |
| Set a callback to know when an instance has been added / removed. More...
|
void | setIGAddBeginCallback (IIGAddBegin *callback) |
| Set a callback to know when an instance group is being created, and how many instances it contains. More...
|
bool | addToScene (CScene &scene, IDriver *driver=NULL) |
| Add all the instances to the scene. More...
|
bool | addToSceneAsync (CScene &scene, IDriver *driver=NULL) |
void | stopAddToSceneAsync () |
TState | getAddToSceneState () |
bool | removeFromScene (CScene &scene) |
| Remove all the instances from the scene. More...
|
void | getLights (std::set< std::string > &LightNames) |
| Get all lights (lightmaps) from an instance group. More...
|
void | setLightFactor (const std::string &LightName, NLMISC::CRGBA nFactor) |
| Set the lightmap factor for the whole instance group. More...
|
void | getBlendShapes (std::set< std::string > &BlendShapeNames) |
| Get all the blendshapes from an instance group. More...
|
void | setBlendShapeFactor (const std::string &BlendShapeName, float rFactor) |
| Set the blendshape factor for the whole instance group (0 -> 100). More...
|
void | addCluster (CCluster *pCluster) |
| To construct the cluster system by hand. More...
|
void | setClusterSystem (CInstanceGroup *pIG) |
| Set the cluster system to test for instances that are not in a cluster. More...
|
void | getDynamicPortals (std::vector< std::string > &names) |
| Get all dynamic portals of an instance group. More...
|
void | setDynamicPortal (std::string &name, bool opened) |
| Set the state of a dynamic portal (true=opened, false=closed). More...
|
bool | getDynamicPortal (std::string &name) |
| Get the state of a dynamic portal (true=opened, false=closed). More...
|
void | linkRoot (CScene &scene, CTransform *father) |
| link the root of the ig to a node. No-op if not added to scene. Pass NULL to reset by default. More...
|
void | setPos (const CVector &pos) |
| Set the position of the IG. More...
|
void | setRotQuat (const CQuat &quat) |
| Set the rotation of the IG. More...
|
CVector | getPos () |
| Get the position of the IG. More...
|
CQuat | getRotQuat () |
| Get the rotation of the IG. More...
|
void | freezeHRC () |
| see CTransform::freezeHRC(). Do it for all instances (not clusters), and for the root of the IG. More...
|
void | unfreezeHRC () |
| see CTransform::unfreezeHRC(). Do it for all instances (not clusters), and for the root of the IG. More...
|
bool | linkToParent (CInstanceGroup *pFather) |
| Look through all hierarchy our clusters that must be linked to our parent. More...
|
|
const std::vector< CPointLightNamed > & | getPointLightList () const |
| get the list of light. NB: the array is sorted by LightGroupName. More...
|
uint | getNumPointLights () const |
| Get the number of point lights. More...
|
CPointLightNamed & | getPointLightNamed (uint index) |
| Get a mutable ref on a point light named. More...
|
void | setPointLightFactor (const std::string &lightGroupName, NLMISC::CRGBA nFactor) |
| set the Light factor for all pointLights "lightGroupName". More...
|
bool | getStaticLightSetup (const std::string &retrieverIdentifier, sint surfaceId, const CVector &localPos, std::vector< CPointLightInfluence > &pointLightList, uint8 &sunContribution, NLMISC::CRGBA &localAmbient) |
| See CIGSurfaceLight::getStaticLightSetup(). More...
|
void | enableRealTimeSunContribution (bool enable) |
| Setuped at export, tells if the ig is touched by the sun. true by default. More...
|
bool | getRealTimeSunContribution () const |
Public Attributes |
TInstanceArray | _InstancesInfos |
std::vector< CTransformShape * > | _Instances |
std::vector< CPortal > | _Portals |
std::vector< CCluster > | _ClusterInfos |
std::vector< CCluster * > | _ClusterInstances |
CTransform * | _Root |
CClipTrav * | _ClipTrav |
CInstanceGroup * | _ClusterSystem |
NLMISC::CVector | _GlobalPos |
Private Methods |
bool | addToSceneWhenAllShapesLoaded (CScene &scene, IDriver *driver) |
Private Attributes |
ITransformName * | _TransformName |
IAddRemoveInstance * | _AddRemoveInstance |
IIGAddBegin * | _IGAddBeginCallback |
|
bool | _AddToSceneSignal |
TState | _AddToSceneState |
CScene * | _AddToSceneTempScene |
IDriver * | _AddToSceneTempDriver |
Detailed Description
A CInstanceGroup is a group of mesh instance and so composed by A reference to a mesh (refered by the name) The transformations to get it to the world The parent.
- * - * - This class can initialize a scene and be serialized.
-
Author:
-
Matthieu Besson , Nevrax France
-
Date:
-
2001
Definition at line 70 of file scene_group.h.
Member Typedef Documentation
typedef std::vector<CInstance> NL3D::CInstanceGroup::TInstanceArray
|
|
Member Enumeration Documentation
|
Should Never be changed.
-
Enumeration values:
-
NumStaticLightPerInstance |
|
Definition at line 75 of file scene_group.h. |
enum NL3D::CInstanceGroup::TState
|
|
|
-
Enumeration values:
-
StateNotAdded |
|
StateAdding |
|
StateAdded |
|
Definition at line 76 of file scene_group.h. |
Constructor & Destructor Documentation
NL3D::CInstanceGroup::CInstanceGroup |
( |
|
) |
|
|
|
Construct, serialize and link to scene.
Definition at line 222 of file scene_group.cpp.
References _AddRemoveInstance, _AddToSceneState, _ClusterSystem, _GlobalPos, _IGAddBeginCallback, _IGSurfaceLight, _RealTimeSunContribution, _Root, _TransformName, and StateNotAdded. |
NL3D::CInstanceGroup::~CInstanceGroup |
( |
|
) |
|
|
Member Function Documentation
void NL3D::CInstanceGroup::addCluster |
( |
CCluster * |
pCluster |
) |
|
|
bool NL3D::CInstanceGroup::addToScene |
( |
CScene & |
scene, |
|
|
IDriver * |
driver = NULL |
|
) |
|
|
bool NL3D::CInstanceGroup::addToSceneAsync |
( |
CScene & |
scene, |
|
|
IDriver * |
driver = NULL |
|
) |
|
|
bool NL3D::CInstanceGroup::addToSceneWhenAllShapesLoaded |
( |
CScene & |
scene, |
|
|
IDriver * |
driver |
|
) |
[private] |
|
|
Definition at line 549 of file scene_group.cpp.
References _AddRemoveInstance, _AddToSceneState, _ClipTrav, _ClusterInfos, _ClusterInstances, _ClusterSystem, _Instances, _InstancesInfos, _PointLightArray, _Portals, _Root, NL3D::ClipTravId, NL3D::ClusterId, createRoot, freezeHRC, NL3D::HrcTravId, linkToParent, min, NL3D_MAX_LIGHT_CONTRIBUTION, and StateAdded.
Referenced by addToScene. |
void NL3D::CInstanceGroup::build |
( |
const CVector & |
vGlobalPos, |
|
|
const TInstanceArray & |
array, |
|
|
const std::vector< CCluster > & |
Portals, |
|
|
const std::vector< CPortal > & |
Clusters |
|
) |
|
|
|
Build the group Build with an empty list of light.
Definition at line 317 of file scene_group.cpp. |
void NL3D::CInstanceGroup::buildPointLightList |
( |
const std::vector< CPointLightNamed > & |
pointLightList, |
|
|
std::vector< uint > & |
plRemap |
|
) |
[private] |
|
void NL3D::CInstanceGroup::createRoot |
( |
CScene & |
scene |
) |
|
|
void NL3D::CInstanceGroup::enableRealTimeSunContribution |
( |
bool |
enable |
) |
|
|
void NL3D::CInstanceGroup::freezeHRC |
( |
|
) |
|
|
void NL3D::CInstanceGroup::getBlendShapes |
( |
std::set< std::string > & |
BlendShapeNames |
) |
|
|
|
Get all the blendshapes from an instance group.
|
bool NL3D::CInstanceGroup::getDynamicPortal |
( |
std::string & |
name |
) |
|
|
void NL3D::CInstanceGroup::getDynamicPortals |
( |
std::vector< std::string > & |
names |
) |
|
|
const NLMISC::CVector& NL3D::CInstanceGroup::getGlobalPos |
( |
|
) |
const [inline] |
|
const string & NL3D::CInstanceGroup::getInstanceName |
( |
uint |
instanceNb |
) |
const |
|
const sint32 NL3D::CInstanceGroup::getInstanceParent |
( |
uint |
instanceNb |
) |
const |
|
const CVector & NL3D::CInstanceGroup::getInstancePos |
( |
uint |
instanceNb |
) |
const |
|
const CQuat & NL3D::CInstanceGroup::getInstanceRot |
( |
uint |
instanceNb |
) |
const |
|
const CVector & NL3D::CInstanceGroup::getInstanceScale |
( |
uint |
instanceNb |
) |
const |
|
void NL3D::CInstanceGroup::getLights |
( |
std::set< std::string > & |
LightNames |
) |
|
|
|
Get all lights (lightmaps) from an instance group.
|
uint NL3D::CInstanceGroup::getNumInstance |
( |
|
) |
const |
|
uint NL3D::CInstanceGroup::getNumPointLights |
( |
|
) |
const [inline] |
|
const std::vector<CPointLightNamed>& NL3D::CInstanceGroup::getPointLightList |
( |
|
) |
const [inline] |
|
CVector NL3D::CInstanceGroup::getPos |
( |
|
) |
|
|
bool NL3D::CInstanceGroup::getRealTimeSunContribution |
( |
|
) |
const [inline] |
|
CQuat NL3D::CInstanceGroup::getRotQuat |
( |
|
) |
|
|
const string & NL3D::CInstanceGroup::getShapeName |
( |
uint |
instanceNb |
) |
const |
|
bool NL3D::CInstanceGroup::getStaticLightSetup |
( |
const std::string & |
retrieverIdentifier, |
|
|
sint |
surfaceId, |
|
|
const CVector & |
localPos, |
|
|
std::vector< CPointLightInfluence > & |
pointLightList, |
|
|
uint8 & |
sunContribution, |
|
|
NLMISC::CRGBA & |
localAmbient |
|
) |
[inline] |
|
|
Get the instance added to the scene.
NULL if instanceNb too big, if addToScene not called, or if instance is DontAddToScene
Definition at line 214 of file scene_group.cpp.
References _Instances. |
bool NL3D::CInstanceGroup::linkToParent |
( |
CInstanceGroup * |
pFather |
) |
|
|
bool NL3D::CInstanceGroup::removeFromScene |
( |
CScene & |
scene |
) |
|
|
|
Serial the group.
Definition at line 354 of file scene_group.cpp.
References _ClusterInfos, _GlobalPos, _IGSurfaceLight, _InstancesInfos, _PointLightArray, _Portals, _RealTimeSunContribution, NLMISC::IStream::isReading, NLMISC::IStream::serial, NLMISC::IStream::serialCheck, NLMISC::IStream::serialCont, and NLMISC::IStream::serialVersion. |
void NL3D::CInstanceGroup::setBlendShapeFactor |
( |
const std::string & |
BlendShapeName, |
|
|
float |
rFactor |
|
) |
|
|
|
Set the blendshape factor for the whole instance group (0 -> 100).
|
void NL3D::CInstanceGroup::setClusterSystem |
( |
CInstanceGroup * |
pIG |
) |
|
|
void NL3D::CInstanceGroup::setDynamicPortal |
( |
std::string & |
name, |
|
|
bool |
opened |
|
) |
|
|
void NL3D::CInstanceGroup::setIGAddBeginCallback |
( |
IIGAddBegin * |
callback |
) |
|
|
void NL3D::CInstanceGroup::setLightFactor |
( |
const std::string & |
LightName, |
|
|
NLMISC::CRGBA |
nFactor |
|
) |
|
|
|
Set the lightmap factor for the whole instance group.
|
void NL3D::CInstanceGroup::setPointLightFactor |
( |
const std::string & |
lightGroupName, |
|
|
NLMISC::CRGBA |
nFactor |
|
) |
|
|
void NL3D::CInstanceGroup::setPos |
( |
const CVector & |
pos |
) |
|
|
void NL3D::CInstanceGroup::setRotQuat |
( |
const CQuat & |
quat |
) |
|
|
void NL3D::CInstanceGroup::setTransformNameCallback |
( |
ITransformName * |
pTN |
) |
|
|
void NL3D::CInstanceGroup::stopAddToSceneAsync |
( |
|
) |
|
|
void NL3D::CInstanceGroup::unfreezeHRC |
( |
|
) |
|
|
Member Data Documentation
bool NL3D::CInstanceGroup::_AddToSceneSignal [private]
|
|
TState NL3D::CInstanceGroup::_AddToSceneState [private]
|
|
IDriver* NL3D::CInstanceGroup::_AddToSceneTempDriver [private]
|
|
CScene* NL3D::CInstanceGroup::_AddToSceneTempScene [private]
|
|
std::vector<CCluster> NL3D::CInstanceGroup::_ClusterInfos
|
|
std::vector<CCluster*> NL3D::CInstanceGroup::_ClusterInstances
|
|
CInstanceGroup* NL3D::CInstanceGroup::_ClusterSystem
|
|
IIGAddBegin* NL3D::CInstanceGroup::_IGAddBeginCallback [private]
|
|
|
Definition at line 352 of file scene_group.h.
Referenced by addToScene, addToSceneAsync, addToSceneWhenAllShapesLoaded, build, buildPointLightList, getInstance, getInstanceName, getInstanceParent, getInstancePos, getInstanceRot, getInstanceScale, getNumInstance, getShapeName, removeFromScene, retrieve, serial, setClusterSystem, and stopAddToSceneAsync. |
std::vector<CPortal> NL3D::CInstanceGroup::_Portals
|
|
bool NL3D::CInstanceGroup::_RealTimeSunContribution [private]
|
|
|
Definition at line 359 of file scene_group.h.
Referenced by addToSceneWhenAllShapesLoaded, CInstanceGroup, createRoot, freezeHRC, getPos, getRotQuat, linkRoot, removeFromScene, setPos, setRotQuat, and unfreezeHRC. |
The documentation for this class was generated from the following files:
|
|