OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MWRender::GlobalMap Class Reference

#include <globalmap.hpp>

Collaboration diagram for MWRender::GlobalMap:

Classes

struct  ImageDest
 

Public Member Functions

 GlobalMap (osg::Group *root)
 
 ~GlobalMap ()
 
void render (Loading::Listener *loadingListener)
 
int getWidth () const
 
int getHeight () const
 
int getCellSize () const
 
void worldPosToImageSpace (float x, float z, float &imageX, float &imageY)
 
void cellTopLeftCornerToImageSpace (int x, int y, float &imageX, float &imageY)
 
void exploreCell (int cellX, int cellY, osg::ref_ptr< osg::Texture2D > localMapTexture)
 
void clear ()
 Clears the overlay. More...
 
void cleanupCameras ()
 
void removeCamera (osg::Camera *cam)
 
void markForRemoval (osg::Camera *camera)
 
void write (ESM::GlobalMap &map)
 
void read (ESM::GlobalMap &map)
 
osg::ref_ptr< osg::Texture2D > getBaseTexture ()
 
osg::ref_ptr< osg::Texture2D > getOverlayTexture ()
 

Private Types

typedef std::vector
< osg::ref_ptr< osg::Camera > > 
CameraVector
 
typedef std::vector< ImageDestImageDestVector
 

Private Member Functions

void requestOverlayTextureUpdate (int x, int y, int width, int height, osg::ref_ptr< osg::Texture2D > texture, bool clear, bool cpuCopy, float srcLeft=0.f, float srcTop=0.f, float srcRight=1.f, float srcBottom=1.f)
 

Private Attributes

int mCellSize
 
osg::ref_ptr< osg::Group > mRoot
 
CameraVector mActiveCameras
 
CameraVector mCamerasPendingRemoval
 
ImageDestVector mPendingImageDest
 
std::vector< std::pair< int,
int > > 
mExploredCells
 
osg::ref_ptr< osg::Texture2D > mBaseTexture
 
osg::ref_ptr< osg::Texture2D > mAlphaTexture
 
osg::ref_ptr< osg::Texture2D > mOverlayTexture
 
osg::ref_ptr< osg::Image > mOverlayImage
 
int mWidth
 
int mHeight
 
int mMinX
 
int mMaxX
 
int mMinY
 
int mMaxY
 

Member Typedef Documentation

typedef std::vector<osg::ref_ptr<osg::Camera> > MWRender::GlobalMap::CameraVector
private
typedef std::vector<ImageDest> MWRender::GlobalMap::ImageDestVector
private

Constructor & Destructor Documentation

MWRender::GlobalMap::GlobalMap ( osg::Group *  root)

Here is the call graph for this function:

MWRender::GlobalMap::~GlobalMap ( )

Here is the call graph for this function:

Member Function Documentation

void MWRender::GlobalMap::cellTopLeftCornerToImageSpace ( int  x,
int  y,
float &  imageX,
float &  imageY 
)

Here is the caller graph for this function:

void MWRender::GlobalMap::cleanupCameras ( )

Removes cameras that have already been rendered. Should be called every frame to ensure that we do not render the same map more than once. Note, this cleanup is difficult to implement in an automated fashion, since we can't alter the scene graph structure from within an update callback.

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::GlobalMap::clear ( )

Clears the overlay.

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::GlobalMap::exploreCell ( int  cellX,
int  cellY,
osg::ref_ptr< osg::Texture2D >  localMapTexture 
)

Here is the call graph for this function:

Here is the caller graph for this function:

osg::ref_ptr< osg::Texture2D > MWRender::GlobalMap::getBaseTexture ( )

Here is the caller graph for this function:

int MWRender::GlobalMap::getCellSize ( ) const
inline

Here is the caller graph for this function:

int MWRender::GlobalMap::getHeight ( ) const
inline

Here is the caller graph for this function:

osg::ref_ptr< osg::Texture2D > MWRender::GlobalMap::getOverlayTexture ( )

Here is the caller graph for this function:

int MWRender::GlobalMap::getWidth ( ) const
inline

Here is the caller graph for this function:

void MWRender::GlobalMap::markForRemoval ( osg::Camera *  camera)

Mark a camera for cleanup in the next update. For internal use only.

void MWRender::GlobalMap::read ( ESM::GlobalMap map)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::GlobalMap::removeCamera ( osg::Camera *  cam)

Here is the caller graph for this function:

void MWRender::GlobalMap::render ( Loading::Listener loadingListener)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::GlobalMap::requestOverlayTextureUpdate ( int  x,
int  y,
int  width,
int  height,
osg::ref_ptr< osg::Texture2D >  texture,
bool  clear,
bool  cpuCopy,
float  srcLeft = 0.f,
float  srcTop = 0.f,
float  srcRight = 1.f,
float  srcBottom = 1.f 
)
private

Request rendering a 2d quad onto mOverlayTexture. x, y, width and height are the destination coordinates (top-left coordinate origin)

Parameters
cpuCopycopy the resulting render onto mOverlayImage as well?

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::GlobalMap::worldPosToImageSpace ( float  x,
float  z,
float &  imageX,
float &  imageY 
)

Here is the caller graph for this function:

void MWRender::GlobalMap::write ( ESM::GlobalMap map)

Here is the caller graph for this function:

Member Data Documentation

CameraVector MWRender::GlobalMap::mActiveCameras
private
osg::ref_ptr<osg::Texture2D> MWRender::GlobalMap::mAlphaTexture
private
osg::ref_ptr<osg::Texture2D> MWRender::GlobalMap::mBaseTexture
private
CameraVector MWRender::GlobalMap::mCamerasPendingRemoval
private
int MWRender::GlobalMap::mCellSize
private
std::vector< std::pair<int,int> > MWRender::GlobalMap::mExploredCells
private
int MWRender::GlobalMap::mHeight
private
int MWRender::GlobalMap::mMaxX
private
int MWRender::GlobalMap::mMaxY
private
int MWRender::GlobalMap::mMinX
private
int MWRender::GlobalMap::mMinY
private
osg::ref_ptr<osg::Image> MWRender::GlobalMap::mOverlayImage
private
osg::ref_ptr<osg::Texture2D> MWRender::GlobalMap::mOverlayTexture
private
ImageDestVector MWRender::GlobalMap::mPendingImageDest
private
osg::ref_ptr<osg::Group> MWRender::GlobalMap::mRoot
private
int MWRender::GlobalMap::mWidth
private

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