|
Zappy GUI
C++ graphic client: renderer, camera, network
|
Helper class to perform raycasting and find selected entities in the game world. More...
#include <SelectionFinder.hpp>
Collaboration diagram for SelectionFinder:Classes | |
| struct | Selection |
Public Types | |
| enum class | EntityType { None , Player , Egg , Tile } |
Static Public Member Functions | |
| static Selection | findFromRay (const Ray &ray, const GameState &state, float tileSize, const Model &playerModel, float playerModelSize, const Model &eggModel, float eggModelSize, const TileSlotMap &slotMap) |
| Performs raycast and finds closest entity. | |
| static Selection | getEmptySelection () |
| Returns an empty selection (type None). | |
Helper class to perform raycasting and find selected entities in the game world.
Definition at line 14 of file SelectionFinder.hpp.
|
strong |
| Enumerator | |
|---|---|
| None | |
| Player | |
| Egg | |
| Tile | |
Definition at line 16 of file SelectionFinder.hpp.
|
static |
Performs raycast and finds closest entity.
| ray | Mouse ray from camera. |
| state | Game state to check entities against. |
| tileSize | Size of each tile in world units. |
| playerModel | Player model for mesh-accurate raycasting. |
| playerModelSize | Player model scale scalar. |
| eggModel | Egg model for mesh-accurate raycasting. |
| eggModelSize | Egg model scale scalar. |
Definition at line 9 of file SelectionFinder.cpp.
References Egg, WorldState::eggs, TileSlotMap::eggSlot(), WorldState::height, SelectionFinder::Selection::id, Player, WorldState::players, TileSlotMap::slotOffset(), Tile, RenderingHelper::tileToWorld(), SelectionFinder::Selection::tileX, SelectionFinder::Selection::tileY, SelectionFinder::Selection::type, WorldState::width, and GameState::world.
Referenced by RaylibRenderer::_performRaycast().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Returns an empty selection (type None).
Definition at line 82 of file SelectionFinder.cpp.
References None, and SelectionFinder::Selection::type.
Referenced by RaylibRenderer::_performRaycast(), and RaylibRenderer::init().
Here is the caller graph for this function: