ColumnSpawnPlacer.ixx File
Spawn placer that arranges entities in a vertical column. More...
Included Headers
#include <cmath>
#include <helios.math>
#include <helios.engine.runtime.world.UpdateContext>
#include <helios.util.Random>
#include <helios.engine.ecs.EntityHandle>
#include <helios.engine.runtime.spawn.behavior.SpawnPlacer>
#include <helios.engine.runtime.spawn.SpawnContext>
#include <helios.engine.runtime.spawn.SpawnPlanCursor>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | runtime |
|
Runtime infrastructure for game execution and lifecycle orchestration. More... | |
| namespace | spawn |
|
Entity spawning infrastructure for the helios engine. More... | |
| namespace | behavior |
|
Spawn behavior strategies for positioning and initializing entities. More... | |
| namespace | placements |
|
Concrete SpawnPlacer implementations. More... | |
Classes Index
| class | ColumnSpawnPlacer |
|
Places spawned entities in a vertical column formation. More... | |
Description
Spawn placer that arranges entities in a vertical column.
File Listing
The file content with the documentation metadata removed is:
21export namespace helios::engine::runtime::spawn::behavior::placements {
46 class ColumnSpawnPlacer final : public SpawnPlacer {
62 const helios::engine::ecs::EntityHandle& entityHandle,
63 const helios::math::aabbf& gameObjectBounds,
64 const helios::math::aabbf& environmentBounds,
65 const SpawnPlanCursor& cursor,
66 const SpawnContext& spawnContext
69 const float top = environmentBounds.max()[1];
70 const float bottom = environmentBounds.min()[1];
73 const float objectHeight = gameObjectBounds.size()[1];
75 size_t position = cursor.position;
78 if (cursor.spawnCount == 1) {
79 dist = helios::util::Random(12345).randomFloat(0, height - objectHeight);
82 dist = height / static_cast<float>(cursor.spawnCount);
85 const float x = environmentBounds.min()[0];
88 return helios::math::vec3f{x, y, 0.0f};
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.