My Project
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ParaEngine::MetaWorldFragment Class Reference

A MetaWorldFragment is the basic building block of the world. More...

#include <MetaWorldFragment.h>

Inheritance diagram for ParaEngine::MetaWorldFragment:
ParaEngine::CRefCountedOne ParaEngine::CRefCounted

Public Types

typedef std::vector< MetaWorldFragment * > WfList
 
typedef std::vector< MetaWorldFragment * >::iterator WfIter
 
typedef std::vector< MetaWorldFragment * >::const_iterator WfConstIter
 

Public Member Functions

 MetaWorldFragment (const Vector3 &position, int ylevel=0)
 Creates new MetaWorldFragment, it will only create IsoSuface and grid on demand.
 
void addMetaObject (MetaObjectPtr mo)
 Adds MetaObject to mObjs, and to mMoDataGrid.
 
void update (IsoSurfaceBuilder *builder)
 Updates IsoSurface. More...
 
int getNumMetaObjects ()
 
const CShapeAABB getAABB ()
 
const Vector3 getPosition ()
 
const bool empty ()
 
IsoSurfaceRenderablegetIsoSurface ()
 
int getYLevel ()
 
bool IsNeedUpdate ()
 it will only update when needed by draw function call.
 
void SetNeedUpdate (bool bNeedUpdate=true)
 
- Public Member Functions inherited from ParaEngine::CRefCounted
void addref () const
 add reference count of the object. More...
 
bool delref () const
 decrease reference count of the object. More...
 
int GetRefCount () const
 get the reference count
 
virtual int Release ()
 
CRefCountedAddToAutoReleasePool ()
 addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More...
 

Static Public Member Functions

static float getScale ()
 
static float getSize ()
 
static void setScale (float s)
 
static void setSize (float s)
 
static void setMaterialName (const std::string &name)
 
static const std::string & getMaterialName ()
 

Protected Member Functions

void addToWfList (MetaWorldFragment *wf)
 

Protected Attributes

IsoSurfaceRenderablemSurf
 
Vector3 mPosition
 
CShapeAABB mAabb
 
std::vector< MetaObjectPtr > mObjs
 
std::vector< MetaWorldFragment * > mAdjacentFragments
 TODO: currently no merging is supported for adjacent fragments.
 
int mYLevel
 position in y, counted in tile-sizes. More...
 
bool m_bNeedUpdate
 whether the grid is modified and needs update in the next draw call. More...
 
- Protected Attributes inherited from ParaEngine::CRefCounted
int m_refcount
 

Static Protected Attributes

static float mGridScale = 0
 
static float mSize = 0
 
static std::string mMaterialName = ""
 

Detailed Description

A MetaWorldFragment is the basic building block of the world.

it has its own IsoSurface which is used for rendering. When created, an IsoSurface should be created..The MetaWorldFragment will also contain portals to other MetaWorldFragments for visibility culling (todo).

Member Function Documentation

§ update()

void MetaWorldFragment::update ( IsoSurfaceBuilder builder)

Updates IsoSurface.

Zero data grid, then add the fields of objects to it.

Member Data Documentation

§ m_bNeedUpdate

bool ParaEngine::MetaWorldFragment::m_bNeedUpdate
protected

whether the grid is modified and needs update in the next draw call.

§ mYLevel

int ParaEngine::MetaWorldFragment::mYLevel
protected

position in y, counted in tile-sizes.

this value is only useful when we are trying to manage a pool of metaworldfragments nearby according to their Y level. so that we can group by height. This is usefully when doing voxel based terrain.


The documentation for this class was generated from the following files: