ChaseSystem.ixx File
System for updating entity steering to chase targets. More...
Included Headers
#include <algorithm>
#include <helios.engine.modules.physics.motion.components.SteeringComponent>
#include <helios.engine.modules.spatial.transform.components.TranslationStateComponent>
#include <helios.engine.modules.ai.components.ChaseComponent>
#include <helios.engine.runtime.world.UpdateContext>
#include <helios.engine.mechanics.lifecycle.components.Active>
#include <helios.engine.runtime.world.GameWorld>
#include <helios.engine.ecs.GameObject>
#include <helios.math>
#include <helios.core.units.Unit>
#include <helios.engine.ecs.System>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | modules |
|
Domain-specific components and systems. More... | |
| namespace | ai |
|
AI behavior modules for game entities. More... | |
| namespace | systems |
|
AI behavior processing systems. More... | |
Classes Index
| class | ChaseSystem |
|
System that steers entities towards their chase targets. More... | |
Description
System for updating entity steering to chase targets.
File Listing
The file content with the documentation metadata removed is:
28export namespace helios::engine::modules::ai::systems {
43 class ChaseSystem : public helios::engine::ecs::System {
52 void update(helios::engine::runtime::world::UpdateContext& updateContext) noexcept override {
54 for (auto [entity, sc, cc, tsc, active] : gameWorld_->view<
63 const auto go = gameWorld_->find(entityHandle);
69 const auto* ttr = go->get<helios::engine::modules::spatial::transform::components::TranslationStateComponent>();
82 const auto translation = tsc->translation();
83 const auto direction = (ttr->translation() - translation).normalize();
85 if (std::abs(direction.length() - 1.0f) > helios::math::EPSILON_LENGTH) {
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.