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 RenderComponent &comp, bool returnChildEntity, const glm::vec3 &pos, Ordinal ordinal, float dist, const glm::vec2 &texCoords=NoPickTextureCoords)
 Constructor used by the picking code in the systems.
 
bool isInfront (Ordinal otherOrdinal, float otherDistance) const
 
bool isBehind (Ordinal otherOrdinal, float otherDistance) const
 
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()
 
Ordinal ordinal = { std::numeric_limits<uint32_t>::max() }
 

Detailed Description

Picking information for one pick intersection.

Definition at line 70 of file RayPick.h.

Constructor & Destructor Documentation

◆ RayPickHit()

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

Constructor used by the picking code in the systems.

Definition at line 185 of file RayPick.cpp.

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

Member Function Documentation

◆ isBehind()

bool Cogs::Core::RayPicking::RayPickHit::isBehind ( Ordinal  otherOrdinal,
float  otherDistance 
) const
inline

Definition at line 107 of file RayPick.h.

◆ isInfront()

bool Cogs::Core::RayPicking::RayPickHit::isInfront ( Ordinal  otherOrdinal,
float  otherDistance 
) const
inline

Definition at line 99 of file RayPick.h.

◆ operator<()

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

Definition at line 115 of file RayPick.h.

Member Data Documentation

◆ distance

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

Internal: Picking distance. Use isBehind() or operator< instead of poking this member. All picks use view-space distance (-z) from the origin of the ray.

Definition at line 88 of file RayPick.h.

◆ entity

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

The EntityId picked.

Definition at line 72 of file RayPick.h.

Referenced by RayPickHit().

◆ ordinal

Ordinal Cogs::Core::RayPicking::RayPickHit::ordinal = { std::numeric_limits<uint32_t>::max() }

Internal: Result order. Use isBehind() or operator< instead of poking this member.

Definition at line 92 of file RayPick.h.

◆ position

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

The picked position.

Definition at line 79 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 76 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 83 of file RayPick.h.


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