Cogs.Core
Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
Cogs::Core::MeshRayPickableBase Class Referenceabstract

Base class for picking meshes. More...

#include <RayPick.h>

Inheritance diagram for Cogs::Core::MeshRayPickableBase:
Cogs::Core::IRayPickable Cogs::Core::InstancedMeshPicker Cogs::Core::MeshRenderPicker Cogs::Core::SubMeshPicker

Classes

struct  TextureCoordinateInfo
 

Public Member Functions

bool pickCamera (Context *context, const CameraComponent &camera, const glm::vec2 &normPosition, float, float radius, PickingFlags pickingFlags, PicksReturned returnFlag, const RayPicking::RayPickFilter &filter, std::vector< RayPicking::RayPickHit > &hits) override
 Do a ray pick from a normalized screen space position in the camera direction and return all hits.
 
bool pickRay (Context *context, const glm::vec3 &startPos, const glm::quat &rot, float rayLength, float radius, PickingFlags pickingFlags, PicksReturned returnFlag, const RayPicking::RayPickFilter &filter, std::vector< RayPicking::RayPickHit > &hits) override
 Do a ray pick from a position and orientation in world space and return all hits.
 
virtual COGSCORE_DLL_API bool pickCamera (Context *context, const CameraComponent &camera, const glm::vec2 &queryClip, float rayLength, float rayRadius, PickingFlags pickingFlags, PicksReturned returnFlag, const RayPicking::RayPickFilter &filter, std::vector< RayPicking::RayPickHit > &hits)=0
 Do a ray pick from a normalized screen space position in the camera direction and return all hits.
 
virtual COGSCORE_DLL_API bool pickRay (Context *, const glm::vec3 &, const glm::quat &, float, float, PickingFlags, PicksReturned, const RayPicking::RayPickFilter &, std::vector< RayPicking::RayPickHit > &)
 Do a ray pick from a position and orientation in world space and return all hits.
 

Protected Member Functions

virtual bool pickImpl (Context *context, const glm::mat4 &worldPickMatrix, const glm::mat4 &rawViewProjection, const glm::mat4 &viewMatrix, const RayPicking::RayPickFilter &filter, PickingFlags pickingFlags, PicksReturned returnFlag, std::vector< RayPicking::RayPickHit > &hits)=0
 Each mesh rendering system should implement this function that goes through all components and calls pickMesh with the appropiate params.
 

Static Protected Member Functions

static TextureCoordinateInfo getTextureCoordinateInfo (const Cogs::Core::Mesh &mesh)
 
static bool clippedByClipComp (const ClipShapeData &clipData, const glm::vec4 &position)
 
static glm::vec2 getTextureCoords (const TextureCoordinateInfo &textureInfo, const RayIntersectionHit &hit, const PickingFlags pickingFlags)
 

Detailed Description

Base class for picking meshes.

Definition at line 171 of file RayPick.h.

Member Function Documentation

◆ clippedByClipComp()

bool Cogs::Core::MeshRayPickableBase::clippedByClipComp ( const ClipShapeData clipData,
const glm::vec4 &  position 
)
staticprotected

Definition at line 299 of file RayPick.cpp.

◆ getTextureCoordinateInfo()

Cogs::Core::MeshRayPickableBase::TextureCoordinateInfo Cogs::Core::MeshRayPickableBase::getTextureCoordinateInfo ( const Cogs::Core::Mesh mesh)
staticprotected

Definition at line 254 of file RayPick.cpp.

◆ getTextureCoords()

glm::vec2 Cogs::Core::MeshRayPickableBase::getTextureCoords ( const TextureCoordinateInfo textureInfo,
const RayIntersectionHit hit,
const PickingFlags  pickingFlags 
)
staticprotected

Definition at line 325 of file RayPick.cpp.

◆ pickCamera()

bool Cogs::Core::MeshRayPickableBase::pickCamera ( Context context,
const CameraComponent camera,
const glm::vec2 &  queryClip,
float  rayLength,
float  rayRadius,
PickingFlags  pickingFlags,
PicksReturned  returnFlag,
const RayPicking::RayPickFilter filter,
std::vector< RayPicking::RayPickHit > &  hits 
)
overridevirtual

Do a ray pick from a normalized screen space position in the camera direction and return all hits.

Parameters
queryClipPicking query position in clip coords [-1,1]x[-1,1].
rayLengthMax length of picking ray, measured in world units.
rayRadiusRadius of picking picking ray, measured in pixels.

Implements Cogs::Core::IRayPickable.

Definition at line 194 of file RayPick.cpp.

◆ pickImpl()

virtual bool Cogs::Core::MeshRayPickableBase::pickImpl ( Context context,
const glm::mat4 &  worldPickMatrix,
const glm::mat4 &  rawViewProjection,
const glm::mat4 &  viewMatrix,
const RayPicking::RayPickFilter filter,
PickingFlags  pickingFlags,
PicksReturned  returnFlag,
std::vector< RayPicking::RayPickHit > &  hits 
)
protectedpure virtual

Each mesh rendering system should implement this function that goes through all components and calls pickMesh with the appropiate params.

Implemented in Cogs::Core::InstancedMeshPicker, Cogs::Core::MeshRenderPicker, and Cogs::Core::SubMeshPicker.

◆ pickRay()

bool Cogs::Core::MeshRayPickableBase::pickRay ( Context ,
const glm::vec3 &  ,
const glm::quat &  ,
float  ,
float  ,
PickingFlags  ,
PicksReturned  ,
const RayPicking::RayPickFilter ,
std::vector< RayPicking::RayPickHit > &   
)
overridevirtual

Do a ray pick from a position and orientation in world space and return all hits.

Reimplemented from Cogs::Core::IRayPickable.

Definition at line 221 of file RayPick.cpp.


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