|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CLodCharacterManager Class ReferenceA Manager used to display CLodCharacter instances.
More...
#include <lod_character_manager.h>
List of all members.
render process |
void | deleteVertexBuffer () |
CVector | _ManagerMatrixPos |
CMaterial | _Material |
uint | _CurrentVertexId |
uint | _MaxNumVertices |
CVertexBuffer | _VBuffer |
NLMISC::CRefPtr< IDriver > | _Driver |
NLMISC::CRefPtr< IVertexBufferHard > | _VBHard |
bool | _VBHardOk |
uint8 * | _VertexData |
uint | _VertexSize |
bool | _Rendering |
uint | _CurrentTriId |
std::vector< uint32 > | _Triangles |
CMatrix | _LightCorrectionMatrix |
Instance texturing. |
CRGBA * | getTextureInstance (CLodCharacterInstance &instance) |
CSmartPtr< CTextureBlank > | _BigTexture |
std::vector< uint > | _FreeIds |
CLodCharacterTmpBitmap | _TmpBitmaps [256] |
Public Methods |
| CLodCharacterManager () |
| Constructor. More...
|
| ~CLodCharacterManager () |
|
void | reset () |
| reset the manager. More...
|
uint32 | createShapeBank () |
| create a Shape Bank. More...
|
const CLodCharacterShapeBank * | getShapeBank (uint32 bankId) const |
| get a shape Bank. UseFull for serialisation for example. return NULL if not found. More...
|
CLodCharacterShapeBank * | getShapeBank (uint32 bankId) |
| get a shape Bank. UseFull for serialisation for example. return NULL if not found. More...
|
void | deleteShapeBank (uint32 bankId) |
| delete a Shape Bank. No-op if bad id. More...
|
sint32 | getShapeIdByName (const std::string &name) const |
| Get a shapeId by its name. More...
|
const CLodCharacterShape * | getShape (uint32 shapeId) const |
| Get a const ref on a shape. Ptr not valid if shape Banks are modfied. NULL if not found. More...
|
bool | compile () |
| re-compile the shape map. More...
|
|
void | setMaxVertex (uint32 maxVertex) |
| set the max number of vertices the manager can render in one time. More...
|
uint32 | getMaxVertex () const |
| see setMaxVertex(). More...
|
void | beginRender (IDriver *driver, const CVector &managerPos) |
| Start the rendering process, freeing VBuffer. More...
|
bool | addRenderCharacterKey (CLodCharacterInstance &instance, const CMatrix &worldMatrix, CRGBA ambient, CRGBA diffuse, const CVector &lightDir) |
| Add an instance to the render list. More...
|
void | endRender () |
| compile the rendering process, effectively rendering into driver the lods. More...
|
bool | isRendering () const |
| tells if we are beetween a beginRender() and a endRender(). More...
|
void | setupNormalCorrectionMatrix (const CMatrix &normalMatrix) |
| Setup a correction matrix for Lighting. More...
|
|
void | initInstance (CLodCharacterInstance &instance) |
| Init the instance texturing with this manager. A texture space is reserved (if possible), and UVs are generated. More...
|
void | releaseInstance (CLodCharacterInstance &instance) |
| Release a lod instance. Free texture space. More...
|
bool | startTextureCompute (CLodCharacterInstance &instance) |
| reset the textureSpace. Instance must have been inited (nlassert). return false if no more texture space available. More...
|
CLodCharacterTmpBitmap & | getTmpBitmap (uint8 id) |
| get a tmp bitmap for a special slot. caller can fill RGBA texture for the associated material Id in it. More...
|
void | addTextureCompute (CLodCharacterInstance &instance, const CLodCharacterTexture &lodTexture) |
| add a texture from an instance. Texture Lookup are made in _TmpBitmaps. More...
|
void | endTextureCompute (CLodCharacterInstance &instance, uint numBmpToReset) |
| end and compile. reset/free memory of _TmpBitmaps up to numBmpToReset. More...
|
Private Types |
typedef std::map< std::string,
uint32 > | TStrIdMap |
| Map name To Id. More...
|
typedef TStrIdMap::iterator | ItStrIdMap |
typedef TStrIdMap::const_iterator | CstItStrIdMap |
Private Attributes |
std::vector< CLodCharacterShapeBank * > | _ShapeBankArray |
| Array of shapeBank. More...
|
TStrIdMap | _ShapeMap |
| Map of shape id. More...
|
Detailed Description
A Manager used to display CLodCharacter instances.
-
Author:
-
Lionel Berenguier , Nevrax France
-
Date:
-
2002
Definition at line 106 of file lod_character_manager.h.
Member Typedef Documentation
typedef TStrIdMap::const_iterator NL3D::CLodCharacterManager::CstItStrIdMap [private]
|
|
typedef TStrIdMap::iterator NL3D::CLodCharacterManager::ItStrIdMap [private]
|
|
typedef std::map<std::string, uint32> NL3D::CLodCharacterManager::TStrIdMap [private]
|
|
Constructor & Destructor Documentation
NL3D::CLodCharacterManager::CLodCharacterManager |
( |
|
) |
|
|
|
Constructor.
Definition at line 68 of file lod_character_manager.cpp.
References _BigTexture, _Driver, _FreeIds, _LightCorrectionMatrix, _Material, _MaxNumVertices, _Rendering, _VBuffer, NL3D_CLOD_BIGTEXT_HEIGHT, NL3D_CLOD_BIGTEXT_WIDTH, NL3D_CLOD_COLOR_OFF, NL3D_CLOD_TEXT_NUM_IDS, NL3D_CLOD_UV_OFF, NL3D_CLOD_VERTEX_FORMAT, nlassert, and NLMISC::Pi. |
NL3D::CLodCharacterManager::~CLodCharacterManager |
( |
|
) |
|
|
Member Function Documentation
bool NL3D::CLodCharacterManager::addRenderCharacterKey |
( |
CLodCharacterInstance & |
instance, |
|
|
const CMatrix & |
worldMatrix, |
|
|
CRGBA |
ambient, |
|
|
CRGBA |
diffuse, |
|
|
const CVector & |
lightDir |
|
) |
|
|
|
Add an instance to the render list.
nlassert if not isRendering() initInstance() must have been called before (nlassert) -
Parameters:
-
instance |
the lod instance information (with precomputed color/Uvs) |
worldMatrix |
is the world matrix, used to display the mesh |
ambient |
is the ambient used to simulate the lighting on the lod. |
diffuse |
is the diffuse used to simulate the lighting on the lod. |
lightDir |
is the diffuse used to simulate the lighting on the lod (should be the bigger light influence) Don't need to be normalized (must do it internally) |
-
Returns:
-
false if the key can't be added to this pass BECAUSE OF TOO MANY VERTICES reason. If the shapeId or animId are bad id, it return true!! You may call endRender(), then restart a block. Or you may just stop the process if you want.
Definition at line 384 of file lod_character_manager.cpp.
References _CurrentTriId, _CurrentVertexId, _Driver, _LightCorrectionMatrix, _ManagerMatrixPos, _MaxNumVertices, _Triangles, _VertexData, _VertexSize, a00, a01, a02, a10, a20, NL3D::computeLodLighting, getShape, H_AUTO_USE, isRendering, NL3D_CLOD_COLOR_OFF, NL3D_CLOD_UV_OFF, NL3D_CLOD_VERTEX_SIZE, and nlassert. |
void NL3D::CLodCharacterManager::beginRender |
( |
IDriver * |
driver, |
|
|
const CVector & |
managerPos |
|
) |
|
|
|
Start the rendering process, freeing VBuffer.
nlassert if isRendering() NB: VBhard is locked here, so you must call endRender to unlock him (even if 0 meshes are rendered) -
Parameters:
-
managerPos |
is to help ZBuffer Precision (see IDriver::setupViewMatrixEx). This vector is removed from all instance worldMatrixes, and a IDriver::setupModelMatrix() will be done with this position. Hence, whatever value you give, the result will be the same. But if you give a value near the camera position, ZBuffer precision will be enhanced. |
Definition at line 295 of file lod_character_manager.cpp.
References _CurrentTriId, _CurrentVertexId, _Driver, _ManagerMatrixPos, _MaxNumVertices, _Rendering, _Triangles, _VBHard, _VBHardOk, _VBuffer, _VertexData, _VertexSize, deleteVertexBuffer, H_AUTO_USE, isRendering, NL3D_CLOD_VERTEX_SIZE, and nlassert. |
bool NL3D::CLodCharacterManager::compile |
( |
|
) |
|
|
uint32 NL3D::CLodCharacterManager::createShapeBank |
( |
|
) |
|
|
|
create a Shape Bank.
NB: a vector of ShapeBank is maintained internally, hence, not so many shapeBank should be created at same Time. -
Returns:
-
id of the shape Bank.
Definition at line 139 of file lod_character_manager.cpp.
References _ShapeBankArray. |
void NL3D::CLodCharacterManager::deleteShapeBank |
( |
uint32 |
bankId |
) |
|
|
void NL3D::CLodCharacterManager::deleteVertexBuffer |
( |
|
) |
[private] |
|
void NL3D::CLodCharacterManager::endRender |
( |
|
) |
|
|
|
compile the rendering process, effectively rendering into driver the lods.
nlassert if not isRendering(). The VBHard is unlocked here.
Definition at line 562 of file lod_character_manager.cpp.
References _CurrentTriId, _CurrentVertexId, _Driver, _ManagerMatrixPos, _Material, _Rendering, _Triangles, _VBHard, _VBuffer, H_AUTO_USE, isRendering, and nlassert. |
uint32 NL3D::CLodCharacterManager::getMaxVertex |
( |
|
) |
const [inline] |
|
sint32 NL3D::CLodCharacterManager::getShapeIdByName |
( |
const std::string & |
name |
) |
const |
|
bool NL3D::CLodCharacterManager::isRendering |
( |
|
) |
const [inline] |
|
void NL3D::CLodCharacterManager::reset |
( |
|
) |
|
|
void NL3D::CLodCharacterManager::setMaxVertex |
( |
uint32 |
maxVertex |
) |
|
|
void NL3D::CLodCharacterManager::setupNormalCorrectionMatrix |
( |
const CMatrix & |
normalMatrix |
) |
|
|
|
Setup a correction matrix for Lighting.
Normals are multiplied with this matrix before lighting. This is important in Ryzom because models (and so Lods) are building with eye looking in Y<0. But they are animated with eye looking in X>0. The default setup is hence a matrix wich do a RotZ+=90. -
See also:
-
addRenderCharacterKey
Definition at line 600 of file lod_character_manager.cpp.
References _LightCorrectionMatrix. |
Member Data Documentation
CSmartPtr<CTextureBlank> NL3D::CLodCharacterManager::_BigTexture [private]
|
|
uint NL3D::CLodCharacterManager::_CurrentTriId [private]
|
|
uint NL3D::CLodCharacterManager::_CurrentVertexId [private]
|
|
std::vector<uint> NL3D::CLodCharacterManager::_FreeIds [private]
|
|
CMatrix NL3D::CLodCharacterManager::_LightCorrectionMatrix [private]
|
|
CVector NL3D::CLodCharacterManager::_ManagerMatrixPos [private]
|
|
CMaterial NL3D::CLodCharacterManager::_Material [private]
|
|
uint NL3D::CLodCharacterManager::_MaxNumVertices [private]
|
|
bool NL3D::CLodCharacterManager::_Rendering [private]
|
|
TStrIdMap NL3D::CLodCharacterManager::_ShapeMap [private]
|
|
std::vector<uint32> NL3D::CLodCharacterManager::_Triangles [private]
|
|
bool NL3D::CLodCharacterManager::_VBHardOk [private]
|
|
uint8* NL3D::CLodCharacterManager::_VertexData [private]
|
|
uint NL3D::CLodCharacterManager::_VertexSize [private]
|
|
The documentation for this class was generated from the following files:
|
|