Emergency 20 Dokumentation  4.2.0
em5::MiniMapRenderer Class Reference

Minimap rendering class. More...

#include <MiniMapRenderer.h>

Inheritance diagram for em5::MiniMapRenderer:

Classes

struct  IconState
 The icon state data contains everything needed for deriving the renderer icon (basically OGRE billboard set, the thing seen by the user) More...
 
struct  LiveIconState
 The live icon state holds the icon state of the current game (independent of the stuff the user sees on the mini map), this includes visual icon data as well as icon animation related data. More...
 
struct  MiniMapPolygon
 

Public Types

typedef uint64 IconId
 Usually the icon ID is identical to the entity ID (but there are some icon types which don't have a corresponding entity to start with) More...
 
typedef std::unordered_map< IconId, Ogre::v1::Billboard * > RendererIcons
 The essence used by the renderer to create the visible result (basically OGRE billboard), synchronized with the given visual icon data. More...
 
typedef std::unordered_map< uint64, IconStateIconStates
 Key = entity ID. More...
 
typedef std::unordered_map< uint64, LiveIconStateLiveIconStates
 Key = entity ID. More...
 

Public Member Functions

 MiniMapRenderer (const glm::vec2 &viewportSize)
 Constructor. More...
 
virtual ~MiniMapRenderer ()
 Destructor. More...
 
const LiveIconStatesgetLiveIconStates () const
 
void setExternalIconStates (const IconStates *iconStates)
 
qsf::MapgetMap ()
 
bool setMap (qsf::Map &map, const qsf::AssetProxy &miniMapAssetProxy)
 
void setViewportSize (const glm::vec2 &viewportSize)
 
void update (float timeDelta)
 
void render ()
 
Ogre::v1::BillboardSet * getBillboardSetByMiniMapIconType (MiniMapIconType type) const
 
void setMinimapIconAssetAndSizeAndScale (const qsf::AssetProxy &asset, int atlasSize, int iconSize, float scaling)
 Sets an asset and its size for the minimap icons. More...
 
void resetMinimapIconAssetAndSizeAndScale ()
 Resets the used icon atlas to default values. More...
 
Rocket::Core::Texture * getMiniMapTexture () const
 
void setPathVisualizationEntityId (uint64 entityId)
 
void setCamera (qsf::CameraComponent *camera)
 
bool getCameraQuadVisible () const
 
void setCameraQuadVisible (bool visible)
 
bool isVisible (MiniMapIconBucket iconBucket) const
 
void toggleVisibility (MiniMapIconBucket iconBucket)
 
void moveCameraToTarget (const glm::vec3 &worldPosition)
 
float getZoomFactor () const
 
void setZoomFactor (float zoomFactor)
 
float getMinZoomFactor () const
 
void setMinZoomFactor (float zoomFactor)
 
float getMaxZoomFactor () const
 
void setMaxZoomFactor (float zoomFactor)
 
void zoomIn ()
 
void zoomOut ()
 
bool getUseViewportSizeBlackBars () const
 
void setUseViewportSizeBlackBars (bool useViewportSizeBlackBars)
 
bool getUnitOfDifferentPlayerHandling () const
 
void setUnitOfDifferentPlayerHandling (bool unitOfDifferentPlayerHandling)
 
bool getViewportFollowsGameCamera () const
 
void setViewportFollowsGameCamera (bool viewportFollowsGameCamera)
 
glm::vec3 getWorldPositionFromViewportPosition (const glm::vec2 &viewportPosition) const
 
const glm::vec2 & getCurrentMinimapCameraPosition () const
 
void moveMinimapCamera (const glm::vec2 &newPosition)
 
bool addIcon (uint64 entityId, MiniMapIconType type, float scaleOrMaxSize, const qsf::Color4 &color=qsf::Color4::WHITE)
 
void removeIcon (uint64 entityId)
 
bool addPolygon (uint64 entityId, const qsf::Color4 &color, bool updatePosition)
 
bool addPolygon (uint64 entityId, const qsf::Color4 &color, const std::vector< glm::vec3 > &vertices)
 
void removePolygon (uint64 entityId)
 
void addPingAtWorldPosition (const glm::vec3 &worldPosition, bool cyclesAnimation, bool playSound)
 
void addHighlightAtWorldPosition (const glm::vec3 &worldPosition, float scaleOrMaxSize)
 

Static Public Attributes

static const uint64 PATH_VISUALIZATION_DESTINATION_ICON_ENTITY_ID
 Path visualization destination icon dummy entity ID. More...
 

Detailed Description

Minimap rendering class.

Note
  • For rendering inside the game, not the minimap creation in the editor
  • One entity can only have one icon on the minimap

Member Typedef Documentation

Usually the icon ID is identical to the entity ID (but there are some icon types which don't have a corresponding entity to start with)

typedef std::unordered_map<uint64, IconState> em5::MiniMapRenderer::IconStates

Key = entity ID.

Key = entity ID.

typedef std::unordered_map<IconId, Ogre::v1::Billboard*> em5::MiniMapRenderer::RendererIcons

The essence used by the renderer to create the visible result (basically OGRE billboard), synchronized with the given visual icon data.

Constructor & Destructor Documentation

em5::MiniMapRenderer::MiniMapRenderer ( const glm::vec2 &  viewportSize)
explicit

Constructor.

virtual em5::MiniMapRenderer::~MiniMapRenderer ( )
virtual

Destructor.

Member Function Documentation

void em5::MiniMapRenderer::addHighlightAtWorldPosition ( const glm::vec3 &  worldPosition,
float  scaleOrMaxSize 
)
bool em5::MiniMapRenderer::addIcon ( uint64  entityId,
MiniMapIconType  type,
float  scaleOrMaxSize,
const qsf::Color4 color = qsf::Color4::WHITE 
)
void em5::MiniMapRenderer::addPingAtWorldPosition ( const glm::vec3 &  worldPosition,
bool  cyclesAnimation,
bool  playSound 
)
bool em5::MiniMapRenderer::addPolygon ( uint64  entityId,
const qsf::Color4 color,
bool  updatePosition 
)
bool em5::MiniMapRenderer::addPolygon ( uint64  entityId,
const qsf::Color4 color,
const std::vector< glm::vec3 > &  vertices 
)
Ogre::v1::BillboardSet* em5::MiniMapRenderer::getBillboardSetByMiniMapIconType ( MiniMapIconType  type) const
bool em5::MiniMapRenderer::getCameraQuadVisible ( ) const
inline
const glm::vec2 & em5::MiniMapRenderer::getCurrentMinimapCameraPosition ( ) const
inline
const MiniMapRenderer::LiveIconStates & em5::MiniMapRenderer::getLiveIconStates ( ) const
inline
qsf::Map * em5::MiniMapRenderer::getMap ( )
inline
float em5::MiniMapRenderer::getMaxZoomFactor ( ) const
inline
Rocket::Core::Texture * em5::MiniMapRenderer::getMiniMapTexture ( ) const
inline
float em5::MiniMapRenderer::getMinZoomFactor ( ) const
inline
bool em5::MiniMapRenderer::getUnitOfDifferentPlayerHandling ( ) const
inline
bool em5::MiniMapRenderer::getUseViewportSizeBlackBars ( ) const
inline
bool em5::MiniMapRenderer::getViewportFollowsGameCamera ( ) const
inline
glm::vec3 em5::MiniMapRenderer::getWorldPositionFromViewportPosition ( const glm::vec2 &  viewportPosition) const
float em5::MiniMapRenderer::getZoomFactor ( ) const
inline
bool em5::MiniMapRenderer::isVisible ( MiniMapIconBucket  iconBucket) const
void em5::MiniMapRenderer::moveCameraToTarget ( const glm::vec3 &  worldPosition)
void em5::MiniMapRenderer::moveMinimapCamera ( const glm::vec2 &  newPosition)
void em5::MiniMapRenderer::removeIcon ( uint64  entityId)
void em5::MiniMapRenderer::removePolygon ( uint64  entityId)
void em5::MiniMapRenderer::render ( )
void em5::MiniMapRenderer::resetMinimapIconAssetAndSizeAndScale ( )

Resets the used icon atlas to default values.

void em5::MiniMapRenderer::setCamera ( qsf::CameraComponent camera)
void em5::MiniMapRenderer::setCameraQuadVisible ( bool  visible)
void em5::MiniMapRenderer::setExternalIconStates ( const IconStates iconStates)
bool em5::MiniMapRenderer::setMap ( qsf::Map map,
const qsf::AssetProxy miniMapAssetProxy 
)
void em5::MiniMapRenderer::setMaxZoomFactor ( float  zoomFactor)
inline
void em5::MiniMapRenderer::setMinimapIconAssetAndSizeAndScale ( const qsf::AssetProxy asset,
int  atlasSize,
int  iconSize,
float  scaling 
)

Sets an asset and its size for the minimap icons.

Parameters
[in]assetThe asset to be used for the minimap icons (must be an texture asset)
[in]atlasSizeThe size of the icon atlas (size must be > 0)
[in]iconSizeThe size of an icon inside the atlas (size must be > 0 and < atlasSize)
[in]scalingThe scale factor for the icons (must be > 0.0f)
Note
  • If one of the above parameters is invalid (e.g. asset is unknown) the default values are set instead
void em5::MiniMapRenderer::setMinZoomFactor ( float  zoomFactor)
inline
void em5::MiniMapRenderer::setPathVisualizationEntityId ( uint64  entityId)
inline
void em5::MiniMapRenderer::setUnitOfDifferentPlayerHandling ( bool  unitOfDifferentPlayerHandling)
inline
void em5::MiniMapRenderer::setUseViewportSizeBlackBars ( bool  useViewportSizeBlackBars)
inline
void em5::MiniMapRenderer::setViewportFollowsGameCamera ( bool  viewportFollowsGameCamera)
inline
void em5::MiniMapRenderer::setViewportSize ( const glm::vec2 &  viewportSize)
void em5::MiniMapRenderer::setZoomFactor ( float  zoomFactor)
void em5::MiniMapRenderer::toggleVisibility ( MiniMapIconBucket  iconBucket)
void em5::MiniMapRenderer::update ( float  timeDelta)
void em5::MiniMapRenderer::zoomIn ( )
inline
void em5::MiniMapRenderer::zoomOut ( )
inline

Member Data Documentation

const uint64 em5::MiniMapRenderer::PATH_VISUALIZATION_DESTINATION_ICON_ENTITY_ID
static

Path visualization destination icon dummy entity ID.


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