eng::World::Locus Class Reference

The Locus is a subset of Quadrants that are populated. More...

#include <eng_world.hh>

List of all members.

Public Types

typedef World::Qidx Qidx
typedef vector
< SafePtr
< World::Quadrant > > 
PopulateQueue

Public Member Functions

 Locus (void)
 ~Locus ()
FN_MAIN_THREAD void Init (const Int3 &dim)
FN_MAIN_THREAD void Update (void)
FN_MAIN_THREAD void Draw (void)
FN_LOCKED uint GetObjectCnt (void)

Private Types

typedef vector< QidxQuadrantContainer
typedef
QuadrantContainer::iterator 
QuadrantIterator

Private Member Functions

FN_MAIN_THREAD void Move (SafePtr< World::Quadrant > centerQuadrant)
FN_MAIN_THREAD uint MakeQuadrant (const Int3 t, vector< PopulateQueue * > &populateQueues, uint populateQueueIdx)
FN_MAIN_THREAD void DestroyZombieQuadrants (void)
FN_MAIN_THREAD bool ShrinkQuadrant (SafePtr< World::Quadrant > quadrant)
FN_LOCKED SafePtr
< World::Quadrant
GetCenterQuadrant (void)
FN_LOCKED World::Qidx GetQuadrantIdx (const Int3 &triplet)

Private Attributes

SlowLock mLock
QuadrantContainer mQuadrants
Int3 mDim
Int3 mDimHalf
Int3 mCenterTriplet
Int3 mPrevQuadrantTriplet
QuadrantContainer mPrevQuadrants
set< QidxmZombieQuadrants

Friends

class LocusIdleFunctor

Classes

class  LocusIdleFunctor


Detailed Description

The Locus is a subset of Quadrants that are populated.

Member Typedef Documentation

typedef World::Qidx eng::World::Locus::Qidx

typedef vector< SafePtr<World::Quadrant> > eng::World::Locus::PopulateQueue

typedef vector<Qidx> eng::World::Locus::QuadrantContainer [private]

typedef QuadrantContainer::iterator eng::World::Locus::QuadrantIterator [private]


Constructor & Destructor Documentation

eng::World::Locus::Locus ( void   ) 

Overhead view of a 3x3x1 Locus of Quadrants.

+------+------+------+ | | | | | | | | +------+------+------+ | | . | | | | eye | | +------+------+------+ | | | | | | | | +------+------+------+ Init() is actual ctor

eng::World::Locus::~Locus (  ) 


Member Function Documentation

void eng::World::Locus::Init ( const Int3 dim  ) 

Construct Locus.

Parameters:
dim Dimensions now can be even (historically was limited to odd).

void eng::World::Locus::Update ( void   ) 

Move Locus to where the Eye is. Update the Locus of Quadrants to the position of the viewpoint. To save memory, Quadrants outside the Locus will be shrunk. A Quadrant is shrunk by deleting those Objects that are reproducible. When the Locus is moved over shrunk quadrants, Quadrant::Populate() is called to reconstruct the deleted objects.

void eng::World::Locus::Draw ( void   ) 

Draw the Locus. See Engine::Draw().

uint eng::World::Locus::GetObjectCnt ( void   ) 

Returns:
Amount of Objects in Locus.

FN_MAIN_THREAD void eng::World::Locus::Move ( SafePtr< World::Quadrant centerQuadrant  )  [private]

uint eng::World::Locus::MakeQuadrant ( const Int3  t,
vector< PopulateQueue * > &  populateQueues,
uint  populateQueueIdx 
) [private]

void eng::World::Locus::DestroyZombieQuadrants ( void   )  [private]

FN_MAIN_THREAD bool eng::World::Locus::ShrinkQuadrant ( SafePtr< World::Quadrant quadrant  )  [private]

SafePtr< World::Quadrant > eng::World::Locus::GetCenterQuadrant ( void   )  [private]

Returns:
Center Quadrant in the Locus.

World::Qidx eng::World::Locus::GetQuadrantIdx ( const Int3 triplet  )  [private]

Returns:
Flat index for Locus::mQuadrants[] equivalent to Locus::mQuadrants[x,y,z]. NOTE: Unlike World's counterpart, this will FAIL if passed an invalid triplet.


Friends And Related Function Documentation

friend class LocusIdleFunctor [friend]


Member Data Documentation

SlowLock eng::World::Locus::mLock [private]

QuadrantContainer eng::World::Locus::mQuadrants [private]

Int3 eng::World::Locus::mDim [private]

Int3 eng::World::Locus::mDimHalf [private]

Int3 eng::World::Locus::mCenterTriplet [private]

Int3 eng::World::Locus::mPrevQuadrantTriplet [private]

QuadrantContainer eng::World::Locus::mPrevQuadrants [private]

set<Qidx> eng::World::Locus::mZombieQuadrants [private]


The documentation for this class was generated from the following files: Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:25 2007