NL3D::IMeshGeom Class Reference

#include <mesh_geom.h>

Inheritance diagram for NL3D::IMeshGeom:

NLMISC::IStreamable NLMISC::IClassable NL3D::CMeshGeom NL3D::CMeshMRMGeom NL3D::CMeshMRMSkinnedGeom

Detailed Description

Interface for MeshGeom.
Author:
Lionel Berenguier

Nevrax France

Date:
2001

Definition at line 77 of file mesh_geom.h.

Mesh Block Render Interface

virtual void activeInstance (CMeshGeomRenderContext &rdrCtx, CMeshBaseInstance *inst, float polygonCount, void *vbDst)=0
virtual void beginMesh (CMeshGeomRenderContext &rdrCtx)=0
virtual void computeMeshVBHeap (void *dst, uint indexStart)
virtual void endMesh (CMeshGeomRenderContext &rdrCtx)=0
virtual uint getNumRdrPassesForInstance (CMeshBaseInstance *inst) const=0
virtual uint getNumRdrPassesForMesh () const=0
virtual bool getVBHeapInfo (uint &vertexFormat, uint &numVertices)
virtual bool isActiveInstanceNeedVBFill () const
bool isMeshInVBHeap () const
virtual void renderPass (CMeshGeomRenderContext &rdrCtx, CMeshBaseInstance *inst, float polygonCount, uint rdrPass)=0
virtual bool sortPerMaterial () const=0
virtual bool supportMeshBlockRendering () const=0

Mesh Block Render access

CMeshBlockManager_MeshBlockManager
 The manager which owns our VBHeap data. NULL means manager must try to setup VBHeap.

uint _MeshVBHeapId
 This is the Heap Id setuped in CMeshBlockManager::allocateMeshVBHeap().

uint _MeshVBHeapIndexStart
 Delta of index for mesh into VBHeap.

uint _MeshVBHeapNumVertices
 Number of vertices for mesh into VBHeap.

sint32 _RootInstanceId
 This is the head of the list of instances to render in the CMeshBlockManager. -1 if NULL.

class CMeshBlockManager
 The manager which owns our VBHeap data. NULL means manager must try to setup VBHeap.


Public Types

enum  TRenderFlag {
  RenderOpaqueMaterial = 1, RenderTransparentMaterial = 2, RenderPassOpaque = 4, RenderGlobalAlpha = 8,
  RenderGADisableZWrite = 16
}
 Render Flags, used in render. More...


Public Member Functions

virtual bool clip (const std::vector< CPlane > &pyramid, const CMatrix &worldMatrix)
virtual std::string getClassName ()=0
virtual bool hasMeshVertexProgram () const
 True if this mesh has a vertexProgram.

 IMeshGeom ()
 Constructor.

virtual void initInstance (CMeshBaseInstance *mbi)=0
virtual void profileSceneRender (CRenderTrav *rdrTrav, CTransformShape *trans, float polygonCount, uint32 rdrFlags)=0
virtual void render (IDriver *drv, CTransformShape *trans, float polygonCount, uint32 rdrFlags, float globalAlpha)=0
virtual void renderSkin (CTransformShape *trans, float alphaMRM)=0
virtual void serial (IStream &f)=0
virtual ~IMeshGeom ()
 dtor

Load balancing methods
virtual const NLMISC::CAABBoxExtgetBoundingBox () const=0
virtual float getNumTriangles (float distance)=0


Member Enumeration Documentation

enum NL3D::IMeshGeom::TRenderFlag
 

Render Flags, used in render.

Enumeration values:
RenderOpaqueMaterial 
RenderTransparentMaterial 
RenderPassOpaque 
RenderGlobalAlpha 
RenderGADisableZWrite 

Definition at line 82 of file mesh_geom.h.

00083         {
00084                 RenderOpaqueMaterial= 1,                // set when the mesh geom must render opaque material
00085                 RenderTransparentMaterial= 2,   // set when the mesh geom must render transparent material
00086                 RenderPassOpaque=4,                             // set when the current traversal rdrPass is the opaque pass
00087                 RenderGlobalAlpha= 8,                   // set when the caller wants to draw material with global alpha
00088                 RenderGADisableZWrite= 16,              // only when globalAlpha is used. set if must disable ZWrite
00089         };


Constructor & Destructor Documentation

NL3D::IMeshGeom::IMeshGeom  ) 
 

Constructor.

Definition at line 37 of file mesh_geom.cpp.

References _MeshBlockManager, _MeshVBHeapId, _MeshVBHeapNumVertices, and _RootInstanceId.

00038 {
00039         _RootInstanceId= -1;
00040         _MeshBlockManager= NULL;
00041         _MeshVBHeapId= 0;
00042         _MeshVBHeapNumVertices= 0;
00043 }

NL3D::IMeshGeom::~IMeshGeom  )  [virtual]
 

dtor

Definition at line 46 of file mesh_geom.cpp.

References _MeshBlockManager, _MeshVBHeapId, NL3D::CMeshBlockManager::freeMeshVBHeap(), and nlassert.

00047 {
00048         // If still have a VBHeap data in the manager, must free it.
00049         if(_MeshVBHeapId)
00050         {
00051                 nlassert(_MeshBlockManager);
00052                 _MeshBlockManager->freeMeshVBHeap(this);
00053         }
00054 }


Member Function Documentation

virtual void NL3D::IMeshGeom::activeInstance CMeshGeomRenderContext rdrCtx,
CMeshBaseInstance inst,
float  polygonCount,
void *  vbDst
[pure virtual]
 

The framework call this method any time a change of instance occurs.

Implemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

Referenced by NL3D::CMeshBlockManager::render().

virtual void NL3D::IMeshGeom::beginMesh CMeshGeomRenderContext rdrCtx  )  [pure virtual]
 

The framework call this method when he will render instances of this meshGeom soon.

Implemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

Referenced by NL3D::CMeshBlockManager::render().

virtual bool NL3D::IMeshGeom::clip const std::vector< CPlane > &  pyramid,
const CMatrix worldMatrix
[inline, virtual]
 

clip this shape with a pyramid. the pyramid is given in world space.The world matrix of the object is given.

Parameters:
pyramid the clipping polytope, planes are normalized.
worldMatrix the world matrix of the instance.
Returns:
true if the object is visible, false otherwise. The default behavior is to return true (never clipped).

Reimplemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

Definition at line 110 of file mesh_geom.h.

Referenced by NL3D::CMeshMultiLod::clip().

00110 {return true;}

virtual void NL3D::IMeshGeom::computeMeshVBHeap void *  dst,
uint  indexStart
[inline, virtual]
 

When the framework succes to allocate a VBHeap space, it call this method to fill this space and compute shifted Primitive block.

Parameters:
the dest VertexBuffer. NB: start to fill at dst[0]
indexStart used to shift primitive block.

Reimplemented in NL3D::CMeshGeom, and NL3D::CMeshMRMGeom.

Definition at line 207 of file mesh_geom.h.

References uint.

Referenced by NL3D::CMeshBlockManager::allocateMeshVBHeap().

00207 {}

virtual void NL3D::IMeshGeom::endMesh CMeshGeomRenderContext rdrCtx  )  [pure virtual]
 

The framework call this method when it has done with this meshGeom

Implemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

Referenced by NL3D::CMeshBlockManager::render().

virtual const NLMISC::CAABBoxExt& NL3D::IMeshGeom::getBoundingBox  )  const [pure virtual]
 

get the extended axis aligned bounding box of the mesh

Implemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

virtual std::string NLMISC::IClassable::getClassName  )  [pure virtual, inherited]
 

Implemented in NLAIAGENT::CNumericIndex, NLAIC::IPointerGestion, NLAIC::CIdentType, and CAutomataDesc.

Referenced by NLMISC::CClassRegistry::checkObject(), and NL3D::GetTextureSize().

virtual uint NL3D::IMeshGeom::getNumRdrPassesForInstance CMeshBaseInstance inst  )  const [pure virtual]
 

return the number of renderPasses for this instance. Called after activateInstance() Used only if sortPerMaterial()) is false

Implemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

Referenced by NL3D::CMeshBlockManager::render().

virtual uint NL3D::IMeshGeom::getNumRdrPassesForMesh  )  const [pure virtual]
 

return the number of renderPasses for this mesh. Used only if sortPerMaterial()) is true

Implemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

Referenced by NL3D::CMeshBlockManager::render().

virtual float NL3D::IMeshGeom::getNumTriangles float  distance  )  [pure virtual]
 

get an approximation of the number of triangles this instance will render for a fixed distance.

Parameters:
distance is the distance of the shape from the eye.
Returns:
the approximate number of triangles this instance will render at this distance. This number can be a float. The function MUST be decreasing or constant with the distance but don't have to be continus.

Implemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

Referenced by NL3D::CMeshMultiLodInstance::traverseLoadBalancing().

virtual bool NL3D::IMeshGeom::getVBHeapInfo uint vertexFormat,
uint numVertices
[inline, virtual]
 

The framework call this method to know if the mesh can fit in VBHeap. if yes, deriver must return mesh vertexFormat and num of vertices.

Reimplemented in NL3D::CMeshGeom, and NL3D::CMeshMRMGeom.

Definition at line 200 of file mesh_geom.h.

References uint.

Referenced by NL3D::CMeshBlockManager::allocateMeshVBHeap().

00200 {return false;}

virtual bool NL3D::IMeshGeom::hasMeshVertexProgram  )  const [inline, virtual]
 

True if this mesh has a vertexProgram.

Reimplemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

Definition at line 124 of file mesh_geom.h.

Referenced by NL3D::CMeshMultiLodInstance::initRenderFilterType().

00124 {return false;}

virtual void NL3D::IMeshGeom::initInstance CMeshBaseInstance mbi  )  [pure virtual]
 

store usefull information for this meshGeom in the instance. Used for IMeshVertexProgram as example

Implemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

virtual bool NL3D::IMeshGeom::isActiveInstanceNeedVBFill  )  const [inline, virtual]
 

Return true if the meshGeom has to Fill some Vertices at activeInstance() time if VBHeap enabled at this time, then vbDst in activeInstance(,,,vbDst) will contains the vb to write to.

Reimplemented in NL3D::CMeshMRMGeom.

Definition at line 212 of file mesh_geom.h.

Referenced by NL3D::CMeshBlockManager::render().

00212 {return false;}

bool NL3D::IMeshGeom::isMeshInVBHeap  )  const [inline]
 

Return true if the meshGeom has to Fill some Vertices at activeInstance() time if VBHeap enabled at this time, then vbDst in activeInstance(,,,vbDst) will contains the vb to write to.

Definition at line 215 of file mesh_geom.h.

References _MeshVBHeapId.

Referenced by NL3D::CMeshMRMGeom::profileSceneRender(), and NL3D::CMeshGeom::profileSceneRender().

00215 {return _MeshVBHeapId!=0;}

virtual void NL3D::IMeshGeom::profileSceneRender CRenderTrav rdrTrav,
CTransformShape trans,
float  polygonCount,
uint32  rdrFlags
[pure virtual]
 

Profile the render of this meshGeom.

Implemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

Referenced by NL3D::CMeshMultiLod::profileMeshGeom().

virtual void NL3D::IMeshGeom::render IDriver drv,
CTransformShape trans,
float  polygonCount,
uint32  rdrFlags,
float  globalAlpha
[pure virtual]
 

render() this meshGeom in a driver, with the specified TransformShape instance information. NB: the meshGeom is ensured to not be skinned to a skeleton, but CMeshGeom may still have skin information.

Implemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

Referenced by NL3D::CMeshMultiLod::renderMeshGeom().

virtual void NL3D::IMeshGeom::renderPass CMeshGeomRenderContext rdrCtx,
CMeshBaseInstance inst,
float  polygonCount,
uint  rdrPass
[pure virtual]
 

The framework call this method to render the current renderPass, with the current instance NB: if the material is blended, DON'T render it!!

Implemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

Referenced by NL3D::CMeshBlockManager::render().

virtual void NL3D::IMeshGeom::renderSkin CTransformShape trans,
float  alphaMRM
[pure virtual]
 

render this meshGeom as a skin, with the specified TransformShape instance information (which gives the driver) NB: trans->isSkinned() is ensured to be true. All the materials must be rendered.

Implemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

virtual void NLMISC::IStreamable::serial IStream f  )  [pure virtual, inherited]
 

Implemented in NL3D::CFlareShape, NL3D::CTextureCross, NL3D::CMesh, NL3D::CMeshGeom, NL3D::CMeshMRMGeom, NL3D::CMeshMRM, NL3D::CMeshMRMSkinnedGeom, NL3D::CMeshMRMSkinned, NL3D::CMeshMultiLod, NL3D::CMeshVPPerPixelLight, NL3D::CMeshVPWindTree, NL3D::CParticleSystemProcess, NL3D::CParticleSystemShape, NL3D::CPSAttribMaker< T >, NL3D::CPSAttribMakerBinOp< T >, NL3D::CPSAttribMakerT< T, F >, NL3D::CPSAttribMakerMemoryBase< T >, NL3D::CPSAttribMakerMemory< uint32 >, NL3D::CPSAttribMakerMemory< sint32 >, NL3D::CPSAttribMakerMemory< float >, NL3D::CPSDot, NL3D::CPSEmitter, NL3D::CPSEmitterDirectionnal, NL3D::CPSRadialEmitter, NL3D::CPSEmitterOmni, NL3D::CPSEmitterRectangle, NL3D::CPSEmitterConic, NL3D::CPSSphericalEmitter, NL3D::CPSFace, NL3D::CPSFaceLookAt, NL3D::CPSFanLight, NL3D::CPSForce, NL3D::CPSForceIntensityHelper, NL3D::CIsotropicForceT< T >, NL3D::CPSDirectionnalForce, NL3D::CPSGravity, NL3D::CPSCentralGravity, NL3D::CPSSpring, NL3D::CPSCylindricVortex, NL3D::CPSMagneticForce, NL3D::CPSLight, NL3D::CPSLocated, NL3D::CPSLocatedBindable, NL3D::CPSTargetLocatedBindable, NL3D::CPSMesh, NL3D::CPSConstraintMesh, NL3D::CPSParticle, NL3D::CPSPlaneBasisFollowSpeed, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonBase, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, NL3D::CPSSound, NL3D::CPSTailDot, NL3D::CPSZone, NL3D::CPSZonePlane, NL3D::CPSZoneSphere, NL3D::CPSZoneDisc, NL3D::CPSZoneCylinder, NL3D::CPSZoneRectangle, NL3D::CSegRemanenceShape, NL3D::CSkeletonShape, NL3D::ITexture, NL3D::CTextureBlend, NL3D::CTextureBump, NL3D::CTextureCube, NL3D::CTextureDLM, NL3D::CTextureEmboss, NL3D::CTextureFar, NL3D::CTextureFile, NL3D::CTextureFont, NL3D::CTextureGrouped, NL3D::CTextureMem, NL3D::CTextureMultiFile, NL3D::CTextureNear, NL3D::CTrackDefaultBlendable< T >, NL3D::CTrackDefaultNotBlendable< T >, NL3D::ITrackKeyFramer< CKeyT >, NL3D::CTrackSampledQuat, NL3D::CTrackSampledVector, NL3D::CWaterShape, NL3D::CWaveMakerShape, NLAIAGENT::CNumericIndex, NLAIC::IPointerGestion, NLAIC::CIdentType, NLAIC::IBasicInterface, NLAISCRIPT::COperandVoid, NLAISCRIPT::COperandAnyObject, NLAISCRIPT::COperandSimple, NLAISCRIPT::COperandSimpleListOr, NLAISCRIPT::COperandUnknown, NLAISCRIPT::COperationType, NLAISCRIPT::COperationTypeGD, NLAISCRIPT::COperandListType, CAutomataDesc, NL3D::CPSAttribMaker< float >, NL3D::CPSAttribMaker< CPlaneBasis >, NL3D::CPSAttribMaker< NLMISC::CRGBA >, NL3D::CPSAttribMaker< uint32 >, NL3D::CPSAttribMaker< CRGBA >, NL3D::CPSAttribMaker< sint32 >, NL3D::CPSAttribMakerBinOp< float >, NL3D::CPSAttribMakerBinOp< CPlaneBasis >, NL3D::CPSAttribMakerBinOp< uint32 >, NL3D::CPSAttribMakerBinOp< NLMISC::CRGBA >, NL3D::CPSAttribMakerBinOp< sint32 >, NL3D::CPSAttribMakerT< NLMISC::CRGBA, CPSValueGradientFunc< NLMISC::CRGBA > >, NL3D::CPSAttribMakerT< sint32, CPSValueBlendFunc< sint32 > >, NL3D::CPSAttribMakerT< T, CPSValueGradientFunc< T > >, NL3D::CPSAttribMakerT< sint32, CPSValueGradientFunc< sint32 > >, NL3D::CPSAttribMakerT< uint32, CPSValueGradientFunc< uint32 > >, NL3D::CPSAttribMakerT< NLMISC::CRGBA, CPSValueBlendFunc< NLMISC::CRGBA > >, NL3D::CPSAttribMakerT< float, CPSFloatCurveFunctor >, NL3D::CPSAttribMakerT< CPlaneBasis, CPSValueBlendFunc< CPlaneBasis > >, NL3D::CPSAttribMakerT< float, CPSValueGradientFunc< float > >, NL3D::CPSAttribMakerT< float, CPSValueBlendFunc< float > >, NL3D::CPSAttribMakerT< T, CPSValueBlendSampleFunc< T, n > >, NL3D::CPSAttribMakerT< NLMISC::CRGBA, CPSValueBlendSampleFunc< NLMISC::CRGBA, n > >, NL3D::CPSAttribMakerT< CPlaneBasis, CPSValueGradientFunc< CPlaneBasis > >, NL3D::CPSAttribMakerT< CPlaneBasis, CSpinnerFunctor >, NL3D::CPSAttribMakerT< T, CPSValueBlendFunc< T > >, NL3D::CPSAttribMakerT< uint32, CPSValueBlendFunc< uint32 > >, NL3D::CPSAttribMakerMemoryBase< float >, NL3D::CPSAttribMakerMemoryBase< CPlaneBasis >, NL3D::CPSAttribMakerMemoryBase< NLMISC::CRGBA >, NL3D::CPSAttribMakerMemoryBase< uint32 >, NL3D::CPSAttribMakerMemoryBase< sint32 >, NL3D::CIsotropicForceT< CPSTurbulForceFunc >, NL3D::CIsotropicForceT< CPSFluidFrictionFunctor >, NL3D::CTrackDefaultBlendable< float >, NL3D::CTrackDefaultBlendable< NLMISC::CRGBA >, NL3D::CTrackDefaultBlendable< CQuat >, NL3D::CTrackDefaultBlendable< sint32 >, NL3D::CTrackDefaultBlendable< CVector >, NL3D::CTrackDefaultNotBlendable< std::string >, NL3D::CTrackDefaultNotBlendable< bool >, NL3D::ITrackKeyFramer< CKeyBezierVector >, NL3D::ITrackKeyFramer< CKeyTCBVector >, NL3D::ITrackKeyFramer< CKeyVector >, NL3D::ITrackKeyFramer< CKeyTCBQuat >, NL3D::ITrackKeyFramer< CKeyRGBA >, NL3D::ITrackKeyFramer< CKeyInt >, NL3D::ITrackKeyFramer< CKeyBool >, NL3D::ITrackKeyFramer< CKeyFloat >, NL3D::ITrackKeyFramer< CKeyQuat >, NL3D::ITrackKeyFramer< CKeyBezierFloat >, NL3D::ITrackKeyFramer< CKeyTCBFloat >, NL3D::ITrackKeyFramer< CKeyString >, and NL3D::ITrackKeyFramer< CKeyBezierQuat >.

Referenced by NL3D::CMeshMRMGeom::loadHeader().

virtual bool NL3D::IMeshGeom::sortPerMaterial  )  const [pure virtual]
 

true if the sort criterion must be by material. Else, sort per instance.

Implemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

Referenced by NL3D::CMeshBlockManager::render().

virtual bool NL3D::IMeshGeom::supportMeshBlockRendering  )  const [pure virtual]
 

true if this meshGeom support meshBlock rendering. eg: return false if skinned/meshMorphed.

Implemented in NL3D::CMeshGeom, NL3D::CMeshMRMGeom, and NL3D::CMeshMRMSkinnedGeom.

Referenced by NL3D::CMeshMultiLod::supportMeshBlockRendering().


Friends And Related Function Documentation

friend class CMeshBlockManager [friend]
 

The manager which owns our VBHeap data. NULL means manager must try to setup VBHeap.

Definition at line 225 of file mesh_geom.h.


Field Documentation

CMeshBlockManager* NL3D::IMeshGeom::_MeshBlockManager [private]
 

The manager which owns our VBHeap data. NULL means manager must try to setup VBHeap.

Definition at line 231 of file mesh_geom.h.

Referenced by NL3D::CMeshBlockManager::addInstance(), IMeshGeom(), and ~IMeshGeom().

uint NL3D::IMeshGeom::_MeshVBHeapId [private]
 

This is the Heap Id setuped in CMeshBlockManager::allocateMeshVBHeap().

Definition at line 233 of file mesh_geom.h.

Referenced by NL3D::CMeshBlockManager::addInstance(), NL3D::CMeshBlockManager::allocateMeshVBHeap(), NL3D::CMeshBlockManager::freeMeshVBHeap(), IMeshGeom(), isMeshInVBHeap(), and ~IMeshGeom().

uint NL3D::IMeshGeom::_MeshVBHeapIndexStart [private]
 

Delta of index for mesh into VBHeap.

Definition at line 235 of file mesh_geom.h.

Referenced by NL3D::CMeshBlockManager::allocateMeshVBHeap(), NL3D::CMeshBlockManager::freeMeshVBHeap(), and NL3D::CMeshBlockManager::render().

uint NL3D::IMeshGeom::_MeshVBHeapNumVertices [private]
 

Number of vertices for mesh into VBHeap.

Definition at line 237 of file mesh_geom.h.

Referenced by NL3D::CMeshBlockManager::allocateMeshVBHeap(), IMeshGeom(), and NL3D::CMeshBlockManager::render().

sint32 NL3D::IMeshGeom::_RootInstanceId [private]
 

This is the head of the list of instances to render in the CMeshBlockManager. -1 if NULL.

Definition at line 228 of file mesh_geom.h.

Referenced by NL3D::CMeshBlockManager::addInstance(), IMeshGeom(), and NL3D::CMeshBlockManager::render().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 08:38:59 2004 for NeL by doxygen 1.3.6