NL3D::CAnimDetailTrav Class Reference

#include <anim_detail_trav.h>

Inheritance diagram for NL3D::CAnimDetailTrav:

NL3D::CTraversal

Detailed Description

The AnimDetail traversal. There is no AnimDetail graph. traverse() use the clipTrav VisibilityList to traverse all models.

NB: see CScene for 3d conventions (orthonormal basis...)

Author:
Lionel Berenguier

Nevrax France

Date:
2000

Definition at line 57 of file anim_detail_trav.h.

Public Member Functions

void addVisibleModel (CTransform *model)
 CAnimDetailTrav ()
 Constructor.

void clearVisibleList ()
void reserveVisibleList (uint numModels)
ITrav/ITravScene Implementation.
void traverse ()

Data Fields

sint64 CurrentDate
CSceneScene

Private Member Functions

void traverseHrcRecurs (CTransform *model)
 traverse the model recusrively, followin Hrc hierarchy


Private Attributes

uint32 _CurrentNumVisibleModels
std::vector< CTransform * > _VisibleList


Constructor & Destructor Documentation

NL3D::CAnimDetailTrav::CAnimDetailTrav  ) 
 

Constructor.

Definition at line 44 of file anim_detail_trav.cpp.

References _CurrentNumVisibleModels, _VisibleList, and CurrentDate.

00045 {
00046         CurrentDate=0;
00047         // prepare some space
00048         _VisibleList.resize(1024);
00049         _CurrentNumVisibleModels= 0;
00050 }


Member Function Documentation

void NL3D::CAnimDetailTrav::addVisibleModel CTransform model  )  [inline]
 

Definition at line 84 of file anim_detail_trav.h.

References _CurrentNumVisibleModels, and _VisibleList.

Referenced by NL3D::CClipTrav::clipSkeletonShadowMaps(), NL3D::CParticleSystemModel::insertInVisibleList(), and NL3D::CTransform::traverseClip().

00085         {
00086                 _VisibleList[_CurrentNumVisibleModels]= model;
00087                 _CurrentNumVisibleModels++;
00088         }

void NL3D::CAnimDetailTrav::clearVisibleList  ) 
 

Definition at line 53 of file anim_detail_trav.cpp.

References _CurrentNumVisibleModels.

Referenced by NL3D::CClipTrav::traverse().

00054 {
00055         _CurrentNumVisibleModels= 0;
00056 }

void NL3D::CAnimDetailTrav::reserveVisibleList uint  numModels  ) 
 

Definition at line 113 of file anim_detail_trav.cpp.

References _VisibleList, and uint.

Referenced by NL3D::CScene::createModel().

00114 {
00115         // enlarge only.
00116         if(numModels>_VisibleList.size())
00117                 _VisibleList.resize(numModels);
00118 }

void NL3D::CAnimDetailTrav::traverse  ) 
 

render after Clip and before light. This order is important for possibles lights sticked to bones of skeletons.

Definition at line 60 of file anim_detail_trav.cpp.

References NL3D::CTransform::_AncestorSkeletonModel, _CurrentNumVisibleModels, _VisibleList, CurrentDate, H_AUTO, NL3D::CTransform::isSkeleton(), NL3D::CTransform::traverseAnimDetail(), traverseHrcRecurs(), and uint.

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

00061 {
00062         H_AUTO( NL3D_TravAnimDetail );
00063 
00064         // Inc the date.
00065         CurrentDate++;
00066 
00067         // Traverse all nodes of the visibility list.
00068         for(uint i=0; i<_CurrentNumVisibleModels; i++)
00069         {
00070                 CTransform              *model= _VisibleList[i];
00071                 // If this object has an ancestorSkeletonModel
00072                 if(model->_AncestorSkeletonModel)
00073                 {
00074                         // then just skip it! because it will be parsed hierarchically by the first 
00075                         // skeletonModel whith _AncestorSkeletonModel==NULL. (only if this one is visible)
00076                         continue;
00077                 }
00078                 else
00079                 {
00080                         // If this is a skeleton model, and because _AncestorSkeletonModel==NULL,
00081                         // then it means that it is the Root of a hierarchy of transform that have 
00082                         // _AncestorSkeletonModel!=NULL.
00083                         if( model->isSkeleton() )
00084                         {
00085                                 // Then I must update hierarchically me and the sons (according to HRC hierarchy graph) of this model.
00086                                 traverseHrcRecurs(model);
00087                         }
00088                         else
00089                         {
00090                                 // else, just traverse AnimDetail, an do nothing for Hrc sons
00091                                 model->traverseAnimDetail();
00092                         }
00093                 }
00094         }
00095 }

void NL3D::CAnimDetailTrav::traverseHrcRecurs CTransform model  )  [private]
 

traverse the model recusrively, followin Hrc hierarchy

Definition at line 99 of file anim_detail_trav.cpp.

References NL3D::CTransform::hrcGetChild(), NL3D::CTransform::hrcGetNumChildren(), num, NL3D::CTransform::traverseAnimDetail(), and uint.

Referenced by traverse().

00100 {
00101         // first, just doIt me
00102         model->traverseAnimDetail();
00103 
00104 
00105         // then doIt my sons in Hrc.
00106         uint    num= model->hrcGetNumChildren();
00107         for(uint i=0;i<num;i++)
00108                 traverseHrcRecurs(model->hrcGetChild(i));
00109 }


Field Documentation

uint32 NL3D::CAnimDetailTrav::_CurrentNumVisibleModels [private]
 

Definition at line 101 of file anim_detail_trav.h.

Referenced by addVisibleModel(), CAnimDetailTrav(), clearVisibleList(), and traverse().

std::vector<CTransform*> NL3D::CAnimDetailTrav::_VisibleList [private]
 

Definition at line 100 of file anim_detail_trav.h.

Referenced by addVisibleModel(), CAnimDetailTrav(), reserveVisibleList(), and traverse().

sint64 NL3D::CAnimDetailTrav::CurrentDate
 

Definition at line 77 of file anim_detail_trav.h.

Referenced by CAnimDetailTrav(), and traverse().

CScene* NL3D::CTraversal::Scene [inherited]
 

Definition at line 55 of file trav_scene.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 06:44:29 2004 for NeL by doxygen 1.3.6