Local map rendering.
More...
#include <localmap.hpp>
|
| LocalMap (osg::Group *root) |
|
| ~LocalMap () |
|
void | clear () |
|
void | requestMap (std::set< const MWWorld::CellStore * > cells) |
|
void | removeCell (MWWorld::CellStore *cell) |
|
osg::ref_ptr< osg::Texture2D > | getMapTexture (int x, int y) |
|
osg::ref_ptr< osg::Texture2D > | getFogOfWarTexture (int x, int y) |
|
void | removeCamera (osg::Camera *cam) |
|
void | markForRemoval (osg::Camera *cam) |
|
void | cleanupCameras () |
|
void | updatePlayer (const osg::Vec3f &position, const osg::Quat &orientation, float &u, float &v, int &x, int &y, osg::Vec3f &direction) |
|
void | saveFogOfWar (MWWorld::CellStore *cell) |
|
void | worldToInteriorMapPosition (osg::Vec2f pos, float &nX, float &nY, int &x, int &y) |
|
osg::Vec2f | interiorMapToWorldPosition (float nX, float nY, int x, int y) |
|
bool | isPositionExplored (float nX, float nY, int x, int y) |
|
osg::Group * | getRoot () |
|
|
const osg::Vec2f | rotatePoint (const osg::Vec2f &point, const osg::Vec2f ¢er, const float angle) |
|
void | requestExteriorMap (const MWWorld::CellStore *cell) |
|
void | requestInteriorMap (const MWWorld::CellStore *cell) |
|
osg::ref_ptr< osg::Camera > | createOrthographicCamera (float left, float top, float width, float height, const osg::Vec3d &upVector, float zmin, float zmax) |
|
void | setupRenderToTexture (osg::ref_ptr< osg::Camera > camera, int x, int y) |
|
MWRender::LocalMap::LocalMap |
( |
osg::Group * |
root | ) |
|
MWRender::LocalMap::~LocalMap |
( |
| ) |
|
void MWRender::LocalMap::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.
void MWRender::LocalMap::clear |
( |
| ) |
|
Clear all savegame-specific data (i.e. fog of war textures)
osg::ref_ptr< osg::Camera > MWRender::LocalMap::createOrthographicCamera |
( |
float |
left, |
|
|
float |
top, |
|
|
float |
width, |
|
|
float |
height, |
|
|
const osg::Vec3d & |
upVector, |
|
|
float |
zmin, |
|
|
float |
zmax |
|
) |
| |
|
private |
osg::ref_ptr< osg::Texture2D > MWRender::LocalMap::getFogOfWarTexture |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
osg::ref_ptr< osg::Texture2D > MWRender::LocalMap::getMapTexture |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
osg::Group * MWRender::LocalMap::getRoot |
( |
| ) |
|
osg::Vec2f MWRender::LocalMap::interiorMapToWorldPosition |
( |
float |
nX, |
|
|
float |
nY, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
bool MWRender::LocalMap::isPositionExplored |
( |
float |
nX, |
|
|
float |
nY, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
Check if a given position is explored by the player (i.e. not obscured by fog of war)
void MWRender::LocalMap::markForRemoval |
( |
osg::Camera * |
cam | ) |
|
Indicates a camera has been queued for rendering and can be cleaned up in the next frame. For internal use only.
void MWRender::LocalMap::removeCamera |
( |
osg::Camera * |
cam | ) |
|
Remove map and fog textures for the given cell.
Request a map render for the given cells. Render textures will be immediately created and can be retrieved with the getMapTexture function.
const osg::Vec2f MWRender::LocalMap::rotatePoint |
( |
const osg::Vec2f & |
point, |
|
|
const osg::Vec2f & |
center, |
|
|
const float |
angle |
|
) |
| |
|
private |
Save the fog of war for this cell to its CellStore.
void MWRender::LocalMap::setupRenderToTexture |
( |
osg::ref_ptr< osg::Camera > |
camera, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
|
private |
void MWRender::LocalMap::updatePlayer |
( |
const osg::Vec3f & |
position, |
|
|
const osg::Quat & |
orientation, |
|
|
float & |
u, |
|
|
float & |
v, |
|
|
int & |
x, |
|
|
int & |
y, |
|
|
osg::Vec3f & |
direction |
|
) |
| |
Set the position & direction of the player, and returns the position in map space through the reference parameters.
void MWRender::LocalMap::worldToInteriorMapPosition |
( |
osg::Vec2f |
pos, |
|
|
float & |
nX, |
|
|
float & |
nY, |
|
|
int & |
x, |
|
|
int & |
y |
|
) |
| |
Get the interior map texture index and normalized position on this texture, given a world position
float MWRender::LocalMap::mAngle |
|
private |
osg::BoundingBox MWRender::LocalMap::mBounds |
|
private |
int MWRender::LocalMap::mCellDistance |
|
private |
bool MWRender::LocalMap::mInterior |
|
private |
int MWRender::LocalMap::mMapResolution |
|
private |
float MWRender::LocalMap::mMapWorldSize |
|
private |
osg::ref_ptr<osg::Group> MWRender::LocalMap::mRoot |
|
private |
osg::ref_ptr<osg::Node> MWRender::LocalMap::mSceneRoot |
|
private |
const int MWRender::LocalMap::sFogOfWarResolution = 32 |
|
staticprivate |
The documentation for this class was generated from the following files:
- /home/travis/build/OpenMW/openmw/apps/openmw/mwrender/localmap.hpp
- /home/travis/build/OpenMW/openmw/apps/openmw/mwrender/localmap.cpp