|
COGSCORE_DLL_API bool | pickCamera (Context *context, const CameraComponent &camera, const glm::vec2 &cameraPosition, float rayLength, float radius, PickingFlags pickingFlags, PicksReturned returnFlag, const RayPicking::RayPickFilter &filter, std::vector< RayPicking::RayPickHit > &hits) |
| RayPicking using ray from camera position along camera viewing direction.
|
|
COGSCORE_DLL_API bool | pickRay (Context *context, const glm::vec3 &position, const glm::quat &rotation, float rayLength, float radius, PickingFlags pickingFlags, PicksReturned returnFlag, const RayPicking::RayPickFilter &filter, std::vector< RayPicking::RayPickHit > &hits) |
| RayPicking using defined ray starting from pos.
|
|
COGSCORE_DLL_API void | addPickable (IRayPickable *pickable) |
| Add Component / System for custom picking.
|
|
COGSCORE_DLL_API void | removePickable (IRayPickable *pickable) |
| Remove Component / System from custom picking.
|
|
|
static constexpr glm::vec2 | NoPickTextureCoords = { std::numeric_limits<float>::quiet_NaN(), std::numeric_limits<float>::quiet_NaN() } |
| Marks no match in texture.
|
|
static constexpr size_t | NoPickEntityType = static_cast<size_t>(-1) |
|
Definition at line 28 of file RayPick.h.
◆ addPickable()
void Cogs::Core::RayPicking::addPickable |
( |
IRayPickable * |
pickable | ) |
|
Add Component / System for custom picking.
Definition at line 160 of file RayPick.cpp.
◆ pickCamera()
RayPicking using ray from camera position along camera viewing direction.
- Parameters
-
context | Cogs context. |
camera | Camera used for picking. |
cameraPosition | Camera Position typically from a mouse. |
rayLength | Max length of ray. |
radius | Radius of ray. |
pickingFlags | Flag for picking. Sprite picking root, or sub-entity return. |
returnFlag | Flag for specifying what picks to return: just the first hit, all hits in an unsorted order or all hits sorted from closest to furthest. |
filter | Filters used to narrow down picked objects. |
hits | Returned hits, detected. |
- Returns
- true if an object was hit, false otherwise.
Definition at line 89 of file RayPick.cpp.
References Cogs::Core::AllSorted, Cogs::Core::AllUnsorted, Cogs::Core::EnablePicking, Cogs::Core::CameraComponent::flags, and pickables.
◆ pickRay()
RayPicking using defined ray starting from pos.
- Parameters
-
context | Cogs context. |
position | Start position of ray. |
rotation | Direction of the ray. |
rayLength | Max length of ray. |
radius | Radius of ray. |
pickingFlags | Flag for picking. Sprite picking root, or sub-entity return. |
returnFlag | Flag for specifying what picks to return: just the first hit, all hits in an unsorted order or all hits sorted from closest to furthest. |
filter | Filters used to narrow down picked objects. |
hits | Returned hits, detected.Type with given hash value (Cogs::StringView(type).hash()). Default = RayPicking::NoPickEntityType |
- Returns
- true if an object was hit, false otherwise.
Definition at line 129 of file RayPick.cpp.
References Cogs::Core::AllSorted, and Cogs::Core::AllUnsorted.
◆ removePickable()
void Cogs::Core::RayPicking::removePickable |
( |
IRayPickable * |
pickable | ) |
|
Remove Component / System from custom picking.
Definition at line 165 of file RayPick.cpp.
◆ NoPickEntityType
constexpr size_t Cogs::Core::RayPicking::NoPickEntityType = static_cast<size_t>(-1) |
|
staticconstexpr |
◆ NoPickTextureCoords
constexpr glm::vec2 Cogs::Core::RayPicking::NoPickTextureCoords = { std::numeric_limits<float>::quiet_NaN(), std::numeric_limits<float>::quiet_NaN() } |
|
staticconstexpr |
Marks no match in texture.
Definition at line 32 of file RayPick.h.
◆ pickables
std::vector<IRayPickable *> Cogs::Core::RayPicking::pickables |
|
private |
The documentation for this class was generated from the following files: