Emergency 20 Dokumentation  4.2.0
em5::RayMapQuery Class Reference

Ray map query interface. More...

#include <RayMapQuery.h>

Inheritance diagram for em5::RayMapQuery:
qsf::RayMapQuery qsf::MapQuery

Public Member Functions

 RayMapQuery (const qsf::Map &map)
 Constructor. More...
 
virtual ~RayMapQuery ()
 Destructor. More...
 
void getEntityUnderNormalizedMousePosition (const glm::vec2 &normalizedMousePosition, RayMapQueryResponse &rayMapQueryResponse, const IgnoreEntityIds *ignoreEntityIds=nullptr)
 Returns the entity under the mouse position if any. More...
 
void getEntityOnMapPosition (const glm::vec3 &mapPosition, RayMapQueryResponse &rayMapQueryResponse, const IgnoreEntityIds *ignoreEntityIds=nullptr)
 Returns the entity under the world position if any. More...
 
void getEntityUnderMousePosition (qsf::Ray &ray, RayMapQueryResponse &rayMapQueryResponse, const IgnoreEntityIds *ignoreEntityIds=nullptr)
 
- Public Member Functions inherited from qsf::RayMapQuery
 RayMapQuery (const Map &map)
 Constructor. More...
 
 ~RayMapQuery ()
 Destructor. More...
 
void getFirstHitByRenderWindow (const RenderWindow &renderWindow, int xPosition, int yPosition, RayMapQueryResponse &rayMapQueryResponse, const EntitySelectionManager::IdSet *ignoreEntityIds=nullptr)
 Find the first component hit by a ray generated by using a given render window and a mouse position. More...
 
void getFirstHitByRenderWindowNormalizedPosition (const RenderWindow &renderWindow, float normalizedXPosition, float normalizedYPosition, RayMapQueryResponse &rayMapQueryResponse, const EntitySelectionManager::IdSet *ignoreEntityIds=nullptr)
 
void getFirstHitByCamera (const CameraComponent &cameraComponent, float xPosition, float yPosition, RayMapQueryResponse &rayMapQueryResponse, const EntitySelectionManager::IdSet *ignoreEntityIds)
 Find the first component hit by a ray generated by using a given camera and a normalized mouse position. More...
 
void getFirstHitAlongRay (const Ray &ray, RayMapQueryResponse &rayMapQueryResponse, const QueryParameters &queryParameters=QueryParameters())
 Find the first component hit by the given ray. More...
 
- Public Member Functions inherited from qsf::MapQuery
 ~MapQuery ()
 Destructor. More...
 
const MapgetMap () const
 Return the map instance to perform the map query on. More...
 

Additional Inherited Members

- Public Types inherited from qsf::RayMapQuery
enum  QueryAccuracy { ACCURACY_BBOX, ACCURACY_MESH }
 
enum  QueryIncludeFlags { INCLUDE_NONE = 0, INCLUDE_TERRAIN = 1, INCLUDE_OGRE_ENTITIES = 2, INCLUDE_ALL = 3 }
 
typedef boost::function< bool(Component &, QueryAccuracy &)> FilterCallback
 Filter callback; receives the component to evaluate as parameter and the to be used QueryAccuracy, the query accuracy can be changed (which changes the accuracy only for that entity), returns "true" if the component passes the filter and "false" if the component gets filtered out. More...
 
typedef boost::container::flat_set< uint64IgnoreEntityIds
 
- Static Public Member Functions inherited from qsf::RayMapQuery
static boost::optional< RaygetRayByRenderWindowPosition (const RenderWindow &renderWindow, int xPosition, int yPosition)
 
static boost::optional< RaygetRayByRenderWindowNormalizedPosition (const RenderWindow &renderWindow, float xNormalizedPosition, float yNormalizedPosition)
 
- Static Public Attributes inherited from qsf::MapQuery
static const uint32 QUERY_ENTITY_DEFAULT_MASK
 Default query mask for entities. More...
 
static const uint32 QUERY_FX_DEFAULT_MASK
 Default query mask for effects like billboard sets / particle systems. More...
 
static const uint32 QUERY_STATIC_GEOMETRY_DEFAULT_MASK
 Default query mask for static geometry. More...
 
static const uint32 QUERY_LIGHT_DEFAULT_MASK
 Default query mask for lights. More...
 
static const uint32 QUERY_FRUSTUM_DEFAULT_MASK
 Default query mask for frusta and cameras. More...
 
static const uint32 QUERY_DEBUG_MASK
 Flag for debug mode hint. More...
 
- Protected Member Functions inherited from qsf::RayMapQuery
Ogre::RaySceneQuery * getOrCreateOgreRaySceneQuery (Ogre::Ray &ogreRay, uint32 queryMask=QUERY_ENTITY_DEFAULT_MASK)
 Get or created the OGRE ray scene query instance. More...
 
bool isTerrainHitByRay (const Ray &ray, Ogre::Ray &ogreRay, const QueryParameters &queryParameters, float &closestDistance, Component *&closestComponent)
 Checks if the ray has hit the terrain. More...
 
- Protected Member Functions inherited from qsf::MapQuery
 MapQuery (const Map &map)
 Constructor. More...
 

Detailed Description

Ray map query interface.

Constructor & Destructor Documentation

em5::RayMapQuery::RayMapQuery ( const qsf::Map map)
explicit

Constructor.

Parameters
[in]mapMap instance to perform the map query on, the instance must stay valid as long as this map query instance exists
virtual em5::RayMapQuery::~RayMapQuery ( )
virtual

Destructor.

Note
  • Not virtual by intent

Member Function Documentation

void em5::RayMapQuery::getEntityOnMapPosition ( const glm::vec3 &  mapPosition,
RayMapQueryResponse rayMapQueryResponse,
const IgnoreEntityIds ignoreEntityIds = nullptr 
)

Returns the entity under the world position if any.

Parameters
[in]mapPositionWorld position on the map to use for the ray generation
[out]rayMapQueryResponseReceives the query response; in case of asynchronous processing use the query response callback instead to use the response
[in]ignoreEntityIdsOptional list of entity IDs to ignore, can be a null pointer
void em5::RayMapQuery::getEntityUnderMousePosition ( qsf::Ray ray,
RayMapQueryResponse rayMapQueryResponse,
const IgnoreEntityIds ignoreEntityIds = nullptr 
)
void em5::RayMapQuery::getEntityUnderNormalizedMousePosition ( const glm::vec2 &  normalizedMousePosition,
RayMapQueryResponse rayMapQueryResponse,
const IgnoreEntityIds ignoreEntityIds = nullptr 
)

Returns the entity under the mouse position if any.

Parameters
[in]normalizedMousePositionNormalized mouse position inside the render window to use for the ray generation
[out]rayMapQueryResponseReceives the query response; in case of asynchronous processing use the query response callback instead to use the response
[in]ignoreEntityIdsOptional list of entity IDs to ignore, can be a null pointer

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