Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Namespaces | Variables
Task_MoveToLocation.cpp File Reference

Atomic task: move entity toward a target location. More...

#include "Task_MoveToLocation.h"
#include "../../AtomicTaskRegistry.h"
#include "../../LocalBlackboard.h"
#include "../../TaskWorldFacade.h"
#include "../../../system/system_utils.h"
#include <cmath>
+ Include dependency graph for Task_MoveToLocation.cpp:

Go to the source code of this file.

Namespaces

namespace  Olympe
 < Provides AssetID and INVALID_ASSET_ID
 

Variables

static const float Olympe::DEFAULT_SPEED = 100.0f
 
static const float Olympe::ARRIVAL_TOLERANCE = 0.5f
 
static const charOlympe::BB_KEY_POSITION = "Position"
 

Detailed Description

Atomic task: move entity toward a target location.

Author
Olympe Engine
Date
2026-02-23

Dual-mode movement task.

World mode (ctx.ComponentFacade with Position and Movement set): Reads the entity's PositionComponent and writes to its MovementComponent. Sets Velocity = dir * speed while the entity is farther than ARRIVAL_TOLERANCE from the target; zeroes Velocity and returns Success once it arrives. A physics/movement ECS system is responsible for integrating the velocity.

Headless mode (ctx.ComponentFacade is nullptr or components are absent): Reads and writes the "Position" key in ctx.LocalBB, integrating position analytically using ctx.DeltaTime.

C++14 compliant - no C++17/20 features.

Definition in file Task_MoveToLocation.cpp.