Cogs.Core
Public Member Functions | Public Attributes | List of all members
Cogs::Core::RayPicking::RayPickHit Struct Reference

#include <RayPick.h>

Public Member Functions

 RayPickHit (const ComponentModel::Component &comp, bool returnChildEntity, const glm::vec3 &pos, float dist, const glm::vec2 &texCoords=NoPickTextureCoords)
 Constructor used by the picking code in the systems.
 
bool operator< (const RayPickHit &rhs) const
 

Public Attributes

EntityId entity = NoEntity
 The EntityId picked.
 
EntityId root = NoEntity
 
glm::vec3 position
 The picked position.
 
glm::vec2 textureCoords = NoPickTextureCoords
 
float distance = std::numeric_limits<float>::max()
 

Detailed Description

Picking information for one pick intersection.

Definition at line 36 of file RayPick.h.

Constructor & Destructor Documentation

◆ RayPickHit()

Cogs::Core::RayPicking::RayPickHit::RayPickHit ( const ComponentModel::Component comp,
bool  returnChildEntity,
const glm::vec3 &  pos,
float  dist,
const glm::vec2 &  texCoords = NoPickTextureCoords 
)

Constructor used by the picking code in the systems.

Definition at line 171 of file RayPick.cpp.

References entity, Cogs::ComponentModel::Component::getContainer(), Cogs::ComponentModel::Entity::getId(), and root.

Member Function Documentation

◆ operator<()

bool Cogs::Core::RayPicking::RayPickHit::operator< ( const RayPickHit rhs) const
inline

Definition at line 60 of file RayPick.h.

Member Data Documentation

◆ distance

float Cogs::Core::RayPicking::RayPickHit::distance = std::numeric_limits<float>::max()

Internal: Picking distance. All picks use view-space distance (-z) from the origin of the ray.

Definition at line 53 of file RayPick.h.

◆ entity

EntityId Cogs::Core::RayPicking::RayPickHit::entity = NoEntity

The EntityId picked.

Definition at line 38 of file RayPick.h.

Referenced by RayPickHit().

◆ position

glm::vec3 Cogs::Core::RayPicking::RayPickHit::position

The picked position.

Definition at line 45 of file RayPick.h.

◆ root

EntityId Cogs::Core::RayPicking::RayPickHit::root = NoEntity

Gets the Root EntityId picked if picking sub-entities E.g if PickingFlags::ReturnChildEntity set.

Definition at line 42 of file RayPick.h.

Referenced by RayPickHit().

◆ textureCoords

glm::vec2 Cogs::Core::RayPicking::RayPickHit::textureCoords = NoPickTextureCoords

The Texture Coordinates of the first point in triangle from picking if available. Use: hasTextureCoords() to check availability of textureCoords.

Definition at line 49 of file RayPick.h.


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