#include <mesh_mrm_skinned.h>
Inheritance diagram for NL3D::CMeshMRMSkinned:
To build a CMeshMRMSkinned, you should:
NB: internally, build() use CMRMBuilder, a builder of MRM.
Nevrax France
Definition at line 659 of file mesh_mrm_skinned.h.
Public Member Functions | |
void | build (CMeshBase::CMeshBaseBuild &m, const CMeshMRMSkinnedGeom &mgeom) |
void | build (CMeshBase::CMeshBaseBuild &mBase, CMesh::CMeshBuild &m, const CMRMParameters ¶ms=CMRMParameters()) |
void | changeMRMDistanceSetup (float distanceFinest, float distanceMiddle, float distanceCoarsest) |
CMeshMRMSkinned () | |
Constructor. | |
void | computeBonesId (CSkeletonModel *skeleton) |
Compute skinning id. | |
void | flushTextures (IDriver &driver, uint selectedTexture) |
Flush textures. | |
virtual std::string | getClassName ()=0 |
float | getDistMax () const |
const sint & | getRefCount () const |
bool | isLightable () const |
Is this mesh lightable? true if one of his materials is not a lightmap. NB: result stored in file. | |
void | optimizeMaterialUsage (std::vector< sint > &remap) |
void | serialMeshBase (NLMISC::IStream &f) throw (NLMISC::EStream) |
serial the base Part of this mesh. | |
void | setDistMax (float distMax) |
void | updateSkeletonUsage (CSkeletonModel *sm, bool increment) |
update Skeleton Usage. increment or decrement. | |
virtual bool | useLightingLocalAttenuation () const |
tells if the shape wants LocalAttenuation for RealTime lighting. Default is false | |
From IShape | |
virtual bool | clip (const std::vector< CPlane > &pyramid, const CMatrix &worldMatrix) |
clip this mesh in a driver. | |
virtual CTransformShape * | createInstance (CScene &scene) |
Create a CMeshInstance, which contains materials. | |
virtual void | getAABBox (NLMISC::CAABBox &bbox) const |
Get bbox. | |
virtual float | getNumTriangles (float distance) |
get an approximation of the number of triangles this instance will render for a fixed distance. | |
NLMISC_DECLARE_CLASS (CMeshMRMSkinned) | |
clip this mesh in a driver. | |
virtual void | profileSceneRender (CRenderTrav *rdrTrav, CTransformShape *trans, bool opaquePass) |
profiling | |
virtual void | render (IDriver *drv, CTransformShape *trans, bool passOpaque) |
render() this mesh in a driver. | |
virtual void | serial (NLMISC::IStream &f) |
serial this mesh. | |
Geometry accessors | |
const NLMISC::CAABBoxExt & | getBoundingBox () const |
get the extended axis aligned bounding box of the mesh | |
const CMeshMRMSkinnedGeom & | getMeshGeom () const |
Get the mesh geom. | |
uint | getNbLod () const |
uint | getNbRdrPass (uint lodId) const |
uint32 | getRdrPassMaterial (uint lodId, uint renderingPassIndex) const |
void | getRdrPassPrimitiveBlock (uint lodId, uint renderingPassIndex, CPrimitiveBlock &block) const |
void | getVertexBuffer (CVertexBuffer &output) const |
get the vertex buffer used by the mrm mesh. NB: this VB store all Vertices used by All LODs. | |
Mesh Block Render Interface | |
virtual IMeshGeom * | supportMeshBlockRendering (CTransformShape *trans, float &polygonCount) const |
Static Public Member Functions | |
bool | isCompatible (const CMesh::CMeshBuild &m) |
Data Fields | |
TLightMapInfo | _LightInfos |
sint | crefs |
CPtrInfo * | pinfo |
Static Public Attributes | |
CPtrInfo | NullPtrInfo |
Protected Types | |
typedef std::map< uint32, CMaterialBase > | TAnimatedMaterialMap |
Animated Material mgt. | |
Protected Member Functions | |
void | applyMaterialUsageOptim (const std::vector< bool > &materialUsed, std::vector< sint > &remap) |
void | buildMeshBase (CMeshBaseBuild &m) |
Just copy informations from a CMeshBaseBuild. | |
void | instanciateMeshBase (CMeshBaseInstance *mi, CScene *ownerScene) |
instanciate MeshBase part to an instance (a CMeshBaseInstance). | |
Protected Attributes | |
TAnimatedMaterialMap | _AnimatedMaterials |
std::vector< CMorphBase > | _AnimatedMorph |
bool | _AutoAnim |
CTrackDefaultRGBA | _DefaultLMFactor |
CTrackDefaultVector | _DefaultPivot |
CTrackDefaultVector | _DefaultPos |
Transform default tracks. Those default tracks are instancied, ie, CInstanceMesh will have the same and can't specialize it. | |
CTrackDefaultVector | _DefaultRotEuler |
CTrackDefaultQuat | _DefaultRotQuat |
CTrackDefaultVector | _DefaultScale |
float | _DistMax |
Default to -1. | |
bool | _IsLightable |
Is this mesh lightable?? | |
std::vector< CMaterial > | _Materials |
The Materials. | |
bool | _UseLightingLocalAttenuation |
Is this mesh Use Lighting Local Attenuation ?? | |
Private Attributes | |
CMeshMRMSkinnedGeom | _MeshMRMGeom |
Friends | |
struct | CPtrInfo |
|
Animated Material mgt.
Definition at line 239 of file mesh_base.h. |
|
Definition at line 76 of file mesh_base.h. Referenced by NL3D::CMeshBase::serialMeshBase(). |
|
Definition at line 111 of file mesh_base.h. |
|
Constructor.
Definition at line 1360 of file mesh_mrm_skinned.cpp.
01361 { 01362 } |
|
delete any material not used, and build remap table (old to new). _AnimatedMaterials are reseted resetLodCharacterTexture(); is called Definition at line 333 of file mesh_base.cpp. References NL3D::CMeshBase::_AnimatedMaterials, NL3D::CMeshBase::_LightInfos, count, nlassert, NL3D::CMeshBase::resetLodCharacterTexture(), sint, NL3D::CMeshBase::CLightMapInfoList::StageList, and uint.
00334 { 00335 nlassert(_Materials.size()==materialUsed.size()); 00336 00337 // security reset 00338 resetLodCharacterTexture(); 00339 _AnimatedMaterials.clear(); 00340 00341 // init all ids to "Not Used" 00342 remap.clear(); 00343 remap.resize(_Materials.size(), -1); 00344 00345 // remove unused materials and build remap 00346 vector<CMaterial>::iterator itMat= _Materials.begin(); 00347 uint dstIdx= 0; 00348 uint i; 00349 for(i=0;i<materialUsed.size();i++) 00350 { 00351 // if used, still use it, and remap. 00352 if(materialUsed[i]) 00353 { 00354 remap[i]= dstIdx; 00355 itMat++; 00356 dstIdx++; 00357 } 00358 // remove from the array 00359 else 00360 { 00361 itMat= _Materials.erase(itMat); 00362 } 00363 } 00364 00365 // apply the remap to LightMaps infos 00366 const uint count = _LightInfos.size (); 00367 for (i=0; i<count; i++) 00368 { 00369 CLightMapInfoList &mapInfoList = _LightInfos[i]; 00370 std::list<CMeshBase::CLightMapInfoList::CMatStage>::iterator ite = mapInfoList.StageList.begin (); 00371 while (ite != mapInfoList.StageList.end ()) 00372 { 00373 sint newId= remap[ite->MatId]; 00374 // If material used 00375 if(newId>=0) 00376 { 00377 // apply remap on the material id 00378 ite->MatId= newId; 00379 ite++; 00380 } 00381 else 00382 { 00383 // remove it from list of light infos 00384 ite= mapInfoList.StageList.erase(ite); 00385 } 00386 } 00387 } 00388 } |
|
Build a mesh, replacing old. build from a CMeshBaseBuild (materials info) and a previously builded CMeshMRMSkinnedGeom. WARNING: This has a side effect of deleting AnimatedMaterials. this is much slower than CMesh::build(), because it computes the MRM.
Definition at line 1404 of file mesh_mrm_skinned.cpp.
01405 { 01407 CMeshBase::buildMeshBase(m); 01408 01409 // Then copy the geom. 01410 _MeshMRMGeom= mgeom; 01411 } |
|
Build a mesh, replacing old. WARNING: This has a side effect of deleting AnimatedMaterials. Call isCompatible() before this method. this is much slower than CMesh::build(), because it computes the MRM.
Definition at line 1392 of file mesh_mrm_skinned.cpp. References NL3D::CMeshMRMSkinnedGeom::build(), isCompatible(), NL3D::CMeshBase::CMeshBaseBuild::Materials, nlassert, and params.
01394 { 01395 nlassert (isCompatible(m)); 01396 01398 CMeshBase::buildMeshBase (mBase); 01399 01400 // Then build the geom. 01401 _MeshMRMGeom.build (m, mBase.Materials.size(), params); 01402 } |
|
|
Change MRM Distance setup. NB: no-op if distanceFinest<0, distanceMiddle<=distanceFinest or if distanceCoarsest<=distanceMiddle.
Definition at line 1526 of file mesh_mrm_skinned.cpp. References NL3D::CMeshMRMSkinnedGeom::changeMRMDistanceSetup(). Referenced by NL3D::CMeshMRMSkinnedInstance::changeMRMDistanceSetup().
01527 { 01528 _MeshMRMGeom.changeMRMDistanceSetup(distanceFinest, distanceMiddle, distanceCoarsest); 01529 } |
|
clip this mesh in a driver.
Reimplemented from NL3D::IShape. Definition at line 1461 of file mesh_mrm_skinned.cpp. References NL3D::CMeshMRMSkinnedGeom::clip().
01462 { 01463 return _MeshMRMGeom.clip(pyramid, worldMatrix); 01464 } |
|
Compute skinning id.
Definition at line 1514 of file mesh_mrm_skinned.cpp. References NL3D::CMeshMRMSkinnedGeom::computeBonesId(). Referenced by NL3D::CMeshMRMSkinnedInstance::getSkinBoneSphere(), NL3D::CMeshMRMSkinnedInstance::getSkinBoneUsage(), and NL3D::CMeshMRMSkinnedInstance::setApplySkin().
01515 { 01516 _MeshMRMGeom.computeBonesId (skeleton); 01517 } |
|
Create a CMeshInstance, which contains materials.
Reimplemented from NL3D::IShape. Definition at line 1439 of file mesh_mrm_skinned.cpp. References NL3D::CScene::createModel(), NL3D::CMeshMRMSkinnedGeom::initInstance(), NL3D::CMeshMRMSkinnedInstance::initRenderFilterType(), and NL3D::CTransformShape::Shape.
01440 { 01441 // Create a CMeshMRMSkinnedInstance, an instance of a mesh. 01442 //=============================================== 01443 CMeshMRMSkinnedInstance *mi= (CMeshMRMSkinnedInstance*)scene.createModel(NL3D::MeshMRMSkinnedInstanceId); 01444 mi->Shape= this; 01445 01446 // instanciate the material part of the MeshMRM, ie the CMeshBase. 01447 CMeshBase::instanciateMeshBase(mi, &scene); 01448 01449 01450 // do some instance init for MeshGeom 01451 _MeshMRMGeom.initInstance(mi); 01452 01453 // init the FilterType 01454 mi->initRenderFilterType(); 01455 01456 return mi; 01457 } |
|
Flush textures. Flush material textures Implements NL3D::IShape. Definition at line 392 of file mesh_base.cpp. References uint.
00393 { 00394 // Mat count 00395 uint matCount=_Materials.size(); 00396 00397 // Flush each material textures 00398 for (uint mat=0; mat<matCount; mat++) 00399 { 00401 _Materials[mat].flushTextures (driver, selectedTexture); 00402 } 00403 } |
|
Get bbox.
Reimplemented from NL3D::IShape. Definition at line 726 of file mesh_mrm_skinned.h. References NLMISC::CAABBoxExt::getAABBox(), and getBoundingBox().
00726 {bbox= getBoundingBox().getAABBox();} |
|
return NULL if this material is NOT animated. (or if material do not exist)
Definition at line 90 of file mesh_base.cpp. References NL3D::CMeshBase::_AnimatedMaterials, and uint.
00091 { 00092 TAnimatedMaterialMap::iterator it; 00093 it= _AnimatedMaterials.find(id); 00094 if(it!=_AnimatedMaterials.end()) 00095 return &it->second; 00096 else 00097 return NULL; 00098 } |
|
Definition at line 212 of file mesh_base.h. References NL3D::CMeshBase::_AutoAnim. Referenced by NL3D::CScene::createInstance(), and NL3D::CMeshBaseInstance::traverseHrc().
00212 { return _AutoAnim; } |
|
get the extended axis aligned bounding box of the mesh
Definition at line 738 of file mesh_mrm_skinned.h. References NL3D::CMeshMRMSkinnedGeom::getBoundingBox(). Referenced by getAABBox().
00739 { 00740 return _MeshMRMGeom.getBoundingBox(); 00741 } |
|
Implemented in NLAIAGENT::CNumericIndex, NLAIC::IPointerGestion, NLAIC::CIdentType, and CAutomataDesc. Referenced by NLMISC::CClassRegistry::checkObject(), and NL3D::GetTextureSize(). |
|
Definition at line 166 of file mesh_base.h. References NL3D::CMeshBase::_DefaultLMFactor.
00166 {return &_DefaultLMFactor;} |
|
Definition at line 162 of file mesh_base.h. References NL3D::CMeshBase::_DefaultPivot. Referenced by NL3D::CMeshBaseInstance::getDefaultTrack().
00162 {return &_DefaultPivot;} |
|
Definition at line 161 of file mesh_base.h. Referenced by NL3D::CMeshBaseInstance::getDefaultTrack().
00161 {return &_DefaultPos;} |
|
Definition at line 163 of file mesh_base.h. References NL3D::CMeshBase::_DefaultRotEuler. Referenced by NL3D::CMeshBaseInstance::getDefaultTrack().
00163 {return &_DefaultRotEuler;} |
|
Definition at line 164 of file mesh_base.h. References NL3D::CMeshBase::_DefaultRotQuat. Referenced by NL3D::CMeshBaseInstance::getDefaultTrack().
00164 {return &_DefaultRotQuat;} |
|
Definition at line 165 of file mesh_base.h. References NL3D::CMeshBase::_DefaultScale. Referenced by NL3D::CMeshBaseInstance::getDefaultTrack().
00165 {return &_DefaultScale;} |
|
return the DistMax where the shape is no more displayed. Default is to return -1, meaning DistMax = infinite. Definition at line 112 of file shape.h.
00112 {return _DistMax;} |
|
get the lod texture info. see CSkeletonModel Lod system. NULL per default. NB: serialised
Definition at line 223 of file mesh_base.h. References NL3D::CMeshBase::_LodCharacterTexture. Referenced by NL3D::CSkeletonModel::computeLodTexture().
00223 {return _LodCharacterTexture;}
|
|
Get a material, const version.
Definition at line 184 of file mesh_base.h. References uint.
00185 { 00186 return _Materials[id]; 00187 } |
|
Get a material.
Definition at line 179 of file mesh_base.h. References uint. Referenced by NL3D::CZoneLighter::addTriangles(), NL3D::CCoarseMeshBuild::buildBitmap(), NL3D::CPSConstraintMesh::CMeshDisplayShare::buildRdrPassSet(), NL3D::CheckForLightableFacesInMesh(), NL3D::CheckForOpaqueAndTransparentFacesInMesh(), NL3D::CShapeBank::processWaitingShapes(), NL3D::CCoarseMeshBuild::remapCoordinates(), NL3D::CAsyncFileManager3D::CMeshLoad::run(), and NL3D::CMeshBaseInstance::selectTextureSet().
00180 { 00181 return _Materials[id]; 00182 } |
|
|
get the number of LOD. Definition at line 749 of file mesh_mrm_skinned.h. References NL3D::CMeshMRMSkinnedGeom::getNbLod(), and uint. Referenced by optimizeMaterialUsage().
00749 { return _MeshMRMGeom.getNbLod() ; } |
|
Get the number of materials in the mesh.
Definition at line 173 of file mesh_base.h. References uint. Referenced by NL3D::CShapeBank::processWaitingShapes(), NL3D::CAsyncFileManager3D::CMeshLoad::run(), and NL3D::CMeshBaseInstance::selectTextureSet().
00174 { 00175 return _Materials.size(); 00176 } |
|
get the number of rendering pass of a LOD.
Definition at line 755 of file mesh_mrm_skinned.h. References NL3D::CMeshMRMSkinnedGeom::getNbRdrPass(), and uint. Referenced by optimizeMaterialUsage().
00755 { return _MeshMRMGeom.getNbRdrPass(lodId) ; } |
|
get an approximation of the number of triangles this instance will render for a fixed distance.
Implements NL3D::IShape. Definition at line 1500 of file mesh_mrm_skinned.cpp. References NL3D::CMeshMRMSkinnedGeom::getNumTriangles().
01501 { 01502 return _MeshMRMGeom.getNumTriangles (distance); 01503 } |
|
get the material ID associated with a rendering pass of a LOD.
Definition at line 772 of file mesh_mrm_skinned.h. References NL3D::CMeshMRMSkinnedGeom::getRdrPassMaterial(), uint, and uint32. Referenced by optimizeMaterialUsage().
00773 { 00774 return _MeshMRMGeom.getRdrPassMaterial(lodId, renderingPassIndex) ; 00775 } |
|
get the primitive block associated with a rendering pass of a LOD.
Definition at line 762 of file mesh_mrm_skinned.h. References NL3D::CMeshMRMSkinnedGeom::getRdrPassPrimitiveBlock(), and uint.
00763 { 00764 _MeshMRMGeom.getRdrPassPrimitiveBlock(lodId, renderingPassIndex, block); 00765 } |
|
Definition at line 70 of file smart_ptr.h. References NLMISC::CRefCount::crefs, and sint.
00071 { 00072 return crefs; 00073 } |
|
get the vertex buffer used by the mrm mesh. NB: this VB store all Vertices used by All LODs.
Definition at line 744 of file mesh_mrm_skinned.h. References NL3D::CMeshMRMSkinnedGeom::getVertexBuffer().
00744 { _MeshMRMGeom.getVertexBuffer(output); } |
|
instanciate MeshBase part to an instance (a CMeshBaseInstance).
Definition at line 261 of file mesh_base.cpp. References NL3D::CMeshBase::_AnimatedMaterials, NL3D::CMeshBaseInstance::_AnimatedMaterials, NL3D::CMeshBase::_AnimatedMorph, NL3D::CMeshBaseInstance::_AnimatedMorphFactor, NL3D::CMeshBase::_DefaultPivot, NL3D::CMeshBase::_DefaultRotQuat, NL3D::CMeshBase::_DefaultScale, NL3D::CMeshBaseInstance::AsyncTextures, NL3D::CAnimatedValueQuat, NL3D::CAnimatedValueVector, NL3D::CTrackDefaultBlendable< CQuat >::getValue(), NL3D::CTrackDefaultBlendable< CVector >::getValue(), NL3D::CMeshBaseInstance::Materials, nlassert, NL3D::CMeshBaseInstance::selectTextureSet(), NL3D::IAnimatable::setFather(), NL3D::CTransform::setIsBigLightable(), NL3D::CTransform::setIsLightable(), NL3D::CAnimatedMaterial::setMaterial(), NL3D::CTransform::setOpacity(), NL3D::CTransform::setTransparency(), and uint32.
00262 { 00263 uint32 i; 00264 00265 00266 // setup animated blendShapes 00267 //=========================== 00268 mi->_AnimatedMorphFactor.reserve(_AnimatedMorph.size()); 00269 for(i = 0; i < _AnimatedMorph.size(); ++i) 00270 { 00271 CAnimatedMorph am(&_AnimatedMorph[i]); 00272 mi->_AnimatedMorphFactor.push_back (am); 00273 } 00274 00275 // setup materials. 00276 //================= 00277 // Copy material. Textures are referenced only 00278 mi->Materials= _Materials; 00279 00280 // Instanciate selectable textures (use default set) 00281 mi->selectTextureSet(0); 00282 00283 // prepare possible AsyncTextures 00284 mi->AsyncTextures.resize(_Materials.size()); 00285 00286 // setup animated materials. 00287 //========================== 00288 TAnimatedMaterialMap::iterator it; 00289 mi->_AnimatedMaterials.reserve(_AnimatedMaterials.size()); 00290 for(it= _AnimatedMaterials.begin(); it!= _AnimatedMaterials.end(); it++) 00291 { 00292 CAnimatedMaterial aniMat(&it->second); 00293 00294 // set the target instance material. 00295 nlassert(it->first < mi->Materials.size()); 00296 aniMat.setMaterial(&mi->Materials[it->first]); 00297 00298 // Must set the Animatable father of the animated material (the mesh_base_instance!). 00299 aniMat.setFather(mi, CMeshBaseInstance::OwnerBit); 00300 00301 // Append this animated material. 00302 mi->_AnimatedMaterials.push_back(aniMat); 00303 } 00304 00305 // Misc 00306 //========================== 00307 00308 // Setup position with the default value 00309 mi->ITransformable::setPos( ((CAnimatedValueVector&)_DefaultPos.getValue()).Value ); 00310 mi->ITransformable::setRotQuat( ((CAnimatedValueQuat&)_DefaultRotQuat.getValue()).Value ); 00311 mi->ITransformable::setScale( ((CAnimatedValueVector&)_DefaultScale.getValue()).Value ); 00312 mi->ITransformable::setPivot( ((CAnimatedValueVector&)_DefaultPivot.getValue()).Value ); 00313 00314 // Check materials for transparency 00315 mi->setTransparency( false ); 00316 mi->setOpacity( false ); 00317 for( i = 0; i < mi->Materials.size(); ++i ) 00318 if( mi->Materials[i].getBlend() ) 00319 mi->setTransparency( true ); 00320 else 00321 mi->setOpacity( true ); 00322 00323 // if the mesh is lightable, then the instance is 00324 mi->setIsLightable(this->isLightable()); 00325 00326 // a mesh is considered big for lightable if it uses localAttenuation 00327 mi->setIsBigLightable(this->useLightingLocalAttenuation()); 00328 00329 } |
|
Return true if the CMesh::CMeshBuild is compatible with the CMeshMRMSkinned. If not, build a CMeshMRM. You must test this before call build(). Definition at line 1366 of file mesh_mrm_skinned.cpp. References NL3D::CMesh::CMeshBuild::BlendShapes, NL3D_MESH_MRM_SKINNED_VERTEX_FORMAT, NL3D_MESH_SKIN_MANAGER_MAXVERTICES, NL3D::CMesh::CMeshBuild::NumCoords, NL3D::CMesh::CMeshBuild::VertexFlags, and NL3D::CMesh::CMeshBuild::Vertices. Referenced by build().
01367 { 01368 /* Optimised shape for skinned object with MRM, 1 UV coordinates, 1 to 4 skinning weight and 256 matrices 01369 Tangeant space, vertex program, mesh block rendering and vertex buffer hard are not available. */ 01370 01371 // Vertex format 01372 if (m.VertexFlags != NL3D_MESH_MRM_SKINNED_VERTEX_FORMAT) 01373 return false; 01374 01375 // No W 01376 if (m.NumCoords[0] != 2) 01377 return false; 01378 01379 // No blend shape 01380 if (!m.BlendShapes.empty()) 01381 return false; 01382 01383 // Check number of vertices 01384 if (m.Vertices.size() > NL3D_MESH_SKIN_MANAGER_MAXVERTICES) 01385 return false; 01386 01387 // Ok 01388 return true; 01389 } |
|
Is this mesh lightable? true if one of his materials is not a lightmap. NB: result stored in file.
Definition at line 198 of file mesh_base.h. References NL3D::CMeshBase::_IsLightable. Referenced by NL3D::CInstanceLighter::light().
00198 {return _IsLightable;} |
|
clip this mesh in a driver.
|
|
Optimize material use. If a material in CMeshBase is not used by any renderPasses, it is removed, and ids are updated. WARNING: This has a side effect of deleting AnimatedMaterials.
Definition at line 1415 of file mesh_mrm_skinned.cpp. References NL3D::CMeshMRMSkinnedGeom::applyMaterialRemap(), getNbLod(), getNbRdrPass(), getRdrPassMaterial(), size, and uint.
01416 { 01417 // For each material, count usage. 01418 vector<bool> materialUsed; 01419 materialUsed.resize(CMeshBase::_Materials.size(), false); 01420 for(uint lod=0;lod<getNbLod();lod++) 01421 { 01422 for(uint rp=0;rp<getNbRdrPass(lod);rp++) 01423 { 01424 uint matId= getRdrPassMaterial(lod, rp); 01425 // flag as used. 01426 materialUsed[matId]= true; 01427 } 01428 } 01429 01430 // Apply it to meshBase 01431 CMeshBase::applyMaterialUsageOptim(materialUsed, remap); 01432 01433 // Apply lut to meshGeom. 01434 _MeshMRMGeom.applyMaterialRemap(remap); 01435 } |
|
profiling
Reimplemented from NL3D::IShape. Definition at line 1538 of file mesh_mrm_skinned.cpp. References NL3D::CTransformShape::getNumTrianglesAfterLoadBalancing(), NL3D::CMeshMRMSkinnedGeom::profileSceneRender(), and uint32.
01539 { 01540 // 0 or 0xFFFFFFFF 01541 uint32 mask= (0-(uint32)passOpaque); 01542 uint32 rdrFlags; 01543 // select rdrFlags, without ifs. 01544 rdrFlags= mask & (IMeshGeom::RenderOpaqueMaterial | IMeshGeom::RenderPassOpaque); 01545 rdrFlags|= ~mask & (IMeshGeom::RenderTransparentMaterial); 01546 // profile the mesh 01547 _MeshMRMGeom.profileSceneRender(rdrTrav, trans, trans->getNumTrianglesAfterLoadBalancing(), rdrFlags); 01548 } |
|
render() this mesh in a driver.
Implements NL3D::IShape. Definition at line 1468 of file mesh_mrm_skinned.cpp. References NL3D::CTransformShape::getNumTrianglesAfterLoadBalancing(), NL3D::CMeshMRMSkinnedGeom::render(), and uint32.
01469 { 01470 // 0 or 0xFFFFFFFF 01471 uint32 mask= (0-(uint32)passOpaque); 01472 uint32 rdrFlags; 01473 // select rdrFlags, without ifs. 01474 rdrFlags= mask & (IMeshGeom::RenderOpaqueMaterial | IMeshGeom::RenderPassOpaque); 01475 rdrFlags|= ~mask & (IMeshGeom::RenderTransparentMaterial); 01476 // render the mesh 01477 _MeshMRMGeom.render(drv, trans, trans->getNumTrianglesAfterLoadBalancing(), rdrFlags, 1); 01478 } |
|
reset the lod texture info. see CSkeletonModel Lod system.
Definition at line 436 of file mesh_base.cpp. References NL3D::CMeshBase::_LodCharacterTexture. Referenced by NL3D::CMeshBase::applyMaterialUsageOptim(), NL3D::CMeshBase::setupLodCharacterTexture(), and NL3D::CMeshBase::~CMeshBase().
00437 { 00438 if(_LodCharacterTexture) 00439 { 00440 delete _LodCharacterTexture; 00441 _LodCharacterTexture= NULL; 00442 } 00443 } |
|
serial this mesh.
Implements NLMISC::IStreamable. Definition at line 1482 of file mesh_mrm_skinned.cpp. References NL3D::CMeshMRMSkinnedGeom::serial(), and NLMISC::IStream::serialVersion().
01483 { 01484 /* 01485 Version 0: 01486 - base version. 01487 */ 01488 (void)f.serialVersion(0); 01489 01490 // serial Materials infos contained in CMeshBase. 01491 CMeshBase::serialMeshBase(f); 01492 01493 01494 // serial the geometry. 01495 _MeshMRMGeom.serial(f); 01496 } |
|
serial the base Part of this mesh.
Definition at line 149 of file mesh_base.cpp. References NL3D::CMeshBase::_AnimatedMaterials, NL3D::CMeshBase::_AnimatedMorph, NL3D::CMeshBase::_AutoAnim, NL3D::CMeshBase::_DefaultPivot, NL3D::CMeshBase::_DefaultRotEuler, NL3D::CMeshBase::_DefaultRotQuat, NL3D::CMeshBase::_DefaultScale, NL3D::CMeshBase::_IsLightable, NL3D::CMeshBase::_LightInfos, NL3D::CMeshBase::_LodCharacterTexture, NL3D::CMeshBase::_UseLightingLocalAttenuation, NL3D::CMeshBase::computeIsLightable(), sint, and NL3D::CMeshBase::TLightInfoMapV7.
00150 { 00151 /* 00152 Version 8: 00153 - new format for CLightMapInfoList 00154 Version 7: 00155 - _LodCharacterTexture 00156 Version 6: 00157 - _DistMax 00158 Version 5: 00159 - _AutoAnim 00160 Version 4: 00161 - _UseLightingLocalAttenuation 00162 Version 3: 00163 - _IsLightable 00164 Version 2: 00165 - Added Blend Shapes factors 00166 Version 1: 00167 - Cut in version because of badly coded ITexture* serialisation. throw an exception if 00168 find a version < 1. 00169 Version 0: 00170 - 1st version. 00171 */ 00172 sint ver = f.serialVersion(8); 00173 00174 if (ver >= 2) 00175 { 00176 f.serialCont (_AnimatedMorph); 00177 } 00178 00179 if(ver<1) 00180 throw NLMISC::EStream(f, "Mesh in Stream is too old (MeshBase version < 1)"); 00181 00182 f.serial (_DefaultPos); 00183 f.serial (_DefaultPivot); 00184 f.serial (_DefaultRotEuler); 00185 f.serial (_DefaultRotQuat); 00186 f.serial (_DefaultScale); 00187 00188 f.serialCont(_Materials); 00189 f.serialCont(_AnimatedMaterials); 00190 00191 if(ver >= 8) 00192 f.serialCont(_LightInfos); 00193 else 00194 { 00195 TLightInfoMapV7 temp; 00196 f.serialCont(temp); 00197 } 00198 00199 if(ver>=3) 00200 // read/write _IsLightable flag. 00201 f.serial(_IsLightable); 00202 else if( f.isReading() ) 00203 // update _IsLightable flag. 00204 computeIsLightable(); 00205 00206 if(ver>=4) 00207 f.serial(_UseLightingLocalAttenuation); 00208 else if( f.isReading() ) 00209 _UseLightingLocalAttenuation= false; 00210 00211 if (ver >= 5) 00212 { 00213 f.serial(_AutoAnim); 00214 } 00215 00216 if(ver >= 6) 00217 f.serial(_DistMax); 00218 00219 if(ver >= 7) 00220 f.serialPtr(_LodCharacterTexture); 00221 00222 } |
|
setup a material as animated. Material must exist or else no-op.
Definition at line 77 of file mesh_base.cpp. References NL3D::CMeshBase::_AnimatedMaterials, nlassert, and uint.
00078 { 00079 nlassert(!matName.empty()); 00080 if(id<_Materials.size()) 00081 { 00082 // add / replace animated material. 00083 _AnimatedMaterials[id].Name= matName; 00084 // copy Material default. 00085 _AnimatedMaterials[id].copyFromMaterial(&_Materials[id]); 00086 } 00087 } |
|
Tells that the model instanciated from this shape should be automatically animated. If so the scene will search for an automatic anim that has the same name than this shape and will bind it. This state is serialized. NB: This is a clue to scene::createInstance, a call to createInstance of this object won't make the animation binding. Definition at line 210 of file mesh_base.h. References NL3D::CMeshBase::_AutoAnim.
00210 { _AutoAnim = on; } |
|
setup the DistMax where the shape is no more displayed. Take effect only for the next created instances. setting <0 means -1 and so means DistMax = infinite. Definition at line 66 of file shape.cpp. Referenced by NL3D::CFlareShape::CFlareShape().
|
|
setup the lod texture info. see CSkeletonModel Lod system
Definition at line 446 of file mesh_base.cpp. References NL3D::CMeshBase::_LodCharacterTexture, and NL3D::CMeshBase::resetLodCharacterTexture().
00447 { 00448 // delete old 00449 resetLodCharacterTexture(); 00450 // seutp new 00451 _LodCharacterTexture= new CLodCharacterTexture; 00452 *_LodCharacterTexture= lodText; 00453 } |
|
return !NULL if this shape can support MeshBlock rendering for a special instance. NB: Mesh Block render cannot occurs if the Mesh is Skinned/MeshMorphed. NB: Mesh Block render can occurs only in Opaque pass NB: Mesh block render can occurs only for CMeshBase meshes.
Reimplemented from NL3D::IShape. Definition at line 1532 of file mesh_mrm_skinned.cpp.
01533 {
01534 return NULL;
01535 }
|
|
update Skeleton Usage. increment or decrement.
Definition at line 1520 of file mesh_mrm_skinned.cpp. References NL3D::CMeshMRMSkinnedGeom::updateSkeletonUsage(). Referenced by NL3D::CMeshMRMSkinnedInstance::setApplySkin().
01521 { 01522 _MeshMRMGeom.updateSkeletonUsage(skeleton, increment); 01523 } |
|
tells if the shape wants LocalAttenuation for RealTime lighting. Default is false
Reimplemented from NL3D::IShape. Definition at line 429 of file mesh_base.cpp. References NL3D::CMeshBase::_UseLightingLocalAttenuation.
00430 { 00431 return _UseLightingLocalAttenuation; 00432 } |
|
Definition at line 67 of file smart_ptr.h. |
|
Definition at line 240 of file mesh_base.h. Referenced by NL3D::CMeshBase::applyMaterialUsageOptim(), NL3D::CMeshBase::buildMeshBase(), NL3D::CMeshBase::getAnimatedMaterial(), NL3D::CMeshBase::instanciateMeshBase(), NL3D::CMeshBase::serialMeshBase(), and NL3D::CMeshBase::setAnimatedMaterial(). |
|
Definition at line 251 of file mesh_base.h. Referenced by NL3D::CMeshBase::buildMeshBase(), NL3D::CMeshBase::instanciateMeshBase(), and NL3D::CMeshBase::serialMeshBase(). |
|
Definition at line 258 of file mesh_base.h. Referenced by NL3D::CMeshBase::CMeshBase(), NL3D::CMeshBase::getAutoAnim(), NL3D::CMeshBase::serialMeshBase(), and NL3D::CMeshBase::setAutoAnim(). |
|
Definition at line 249 of file mesh_base.h. Referenced by NL3D::CMeshBase::CMeshBase(), and NL3D::CMeshBase::getDefaultLMFactor(). |
|
Definition at line 245 of file mesh_base.h. Referenced by NL3D::CMeshBase::buildMeshBase(), NL3D::CMeshBase::CMeshBase(), NL3D::CMeshBase::getDefaultPivot(), NL3D::CMeshBase::instanciateMeshBase(), and NL3D::CMeshBase::serialMeshBase(). |
|
Transform default tracks. Those default tracks are instancied, ie, CInstanceMesh will have the same and can't specialize it.
Definition at line 244 of file mesh_base.h. |
|
Definition at line 246 of file mesh_base.h. Referenced by NL3D::CMeshBase::buildMeshBase(), NL3D::CMeshBase::CMeshBase(), NL3D::CMeshBase::getDefaultRotEuler(), and NL3D::CMeshBase::serialMeshBase(). |
|
Definition at line 247 of file mesh_base.h. Referenced by NL3D::CMeshBase::buildMeshBase(), NL3D::CMeshBase::CMeshBase(), NL3D::CMeshBase::getDefaultRotQuat(), NL3D::CMeshBase::instanciateMeshBase(), and NL3D::CMeshBase::serialMeshBase(). |
|
Definition at line 248 of file mesh_base.h. Referenced by NL3D::CMeshBase::buildMeshBase(), NL3D::CMeshBase::CMeshBase(), NL3D::CMeshBase::getDefaultScale(), NL3D::CMeshBase::instanciateMeshBase(), and NL3D::CMeshBase::serialMeshBase(). |
|
Default to -1.
|
|
Is this mesh lightable??
Definition at line 254 of file mesh_base.h. Referenced by NL3D::CMeshBase::computeIsLightable(), NL3D::CMeshBase::isLightable(), and NL3D::CMeshBase::serialMeshBase(). |
|
|
The Materials.
Definition at line 230 of file mesh_base.h. |
|
Definition at line 792 of file mesh_mrm_skinned.h. |
|
Is this mesh Use Lighting Local Attenuation ??
Definition at line 256 of file mesh_base.h. Referenced by NL3D::CMeshBase::buildMeshBase(), NL3D::CMeshBase::CMeshBase(), NL3D::CMeshBase::serialMeshBase(), and NL3D::CMeshBase::useLightingLocalAttenuation(). |
|
Definition at line 79 of file smart_ptr.h. Referenced by NLMISC::CRefCount::CRefCount(), NLMISC::CRefCount::getRefCount(), and NLMISC::CRefCount::~CRefCount(). |
|
Referenced by NLMISC::CRefCount::CRefCount(). |
|
Definition at line 80 of file smart_ptr.h. Referenced by NLMISC::CRefCount::CRefCount(), and NLMISC::CRefCount::~CRefCount(). |