Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
targeting.hpp File Reference

Targets in range: the entities with a component within a radius of a point, found through the collision grid, nearest or most advanced first. More...

#include <aegis2d/core/math.hpp>
#include <aegis2d/ecs/collision.hpp>
#include <aegis2d/ecs/components.hpp>
#include <aegis2d/ecs/entity.hpp>
#include <aegis2d/ecs/path_following.hpp>
#include <aegis2d/ecs/registry.hpp>
#include <algorithm>
#include <cstdint>
#include <limits>
#include <tuple>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  aegis2d
 Root namespace of the engine.
 
namespace  aegis2d::ecs
 Entity-Component-System used by client and server.
 

Enumerations

enum class  aegis2d::ecs::TargetOrder : std::uint8_t { aegis2d::ecs::Nearest , aegis2d::ecs::MostAdvanced }
 Which targets come first in find_targets(). More...
 

Functions

template<typename Component >
void aegis2d::ecs::find_targets (const Registry &registry, const CollisionGrid &grid, Vec2 center, float radius, TargetOrder order, std::vector< Entity > &out)
 Lists the entities with a component whose center is within a radius of a point, in the order asked.
 

Detailed Description

Targets in range: the entities with a component within a radius of a point, found through the collision grid, nearest or most advanced first.