SpawnPlacer Class
Abstract interface for determining spawn positions. More...
Declaration
Derived Classes
| class | AxisSpawnPlacer |
|
Spawn placer that distributes entities evenly along an axis. More... | |
| class | ColumnSpawnPlacer |
|
Places spawned entities in a vertical column formation. More... | |
| class | DistributedSpawnPlacer<N> |
|
Spawn placer that assigns entities to predefined spawn points. More... | |
| class | EmitterSpawnPlacer |
|
Placer that spawns entities at the emitter's position. More... | |
| class | RandomSpawnPlacer |
|
Placer that spawns entities at random positions within bounds. More... | |
Public Destructor Index
| ~SpawnPlacer ()=default | |
Public Member Functions Index
| helios::math::vec3f | getPosition (const helios::engine::ecs::EntityHandle &entityHandle, const helios::math::aabbf &gameObjectBounds, const helios::math::aabbf &environmentBounds, const SpawnPlanCursor &cursor, const SpawnContext &spawnContext)=0 |
|
Calculates the spawn position for an entity. More... | |
| void | onReset () noexcept |
|
Called when the spawn system is reset. More... | |
Description
Abstract interface for determining spawn positions.
SpawnPlacer defines the strategy for calculating where a spawned entity should be placed in the world. Implementations can provide various placement strategies:
- **RandomPlacer:** Random position within level bounds
- **FormationPlacer:** Grid or pattern-based placement
- **EmitterRelativePlacer:** Offset from emitter position
- **FixedPlacer:** Predetermined spawn points
Example implementation: ```cpp class RandomPlacer : public SpawnPlacer { public: vec3f getPosition(const Guid& guid, const aabbf& bounds, const SpawnPlanCursor& cursor, const SpawnContext& ctx) override { return Random::pointInBounds(bounds); } }; ```
- See Also
- See Also
- See Also
Definition at line 47 of file SpawnPlacer.ixx.
Public Destructor
~SpawnPlacer()
| virtual default |
Definition at line 51 of file SpawnPlacer.ixx.
Public Member Functions
getPosition()
|
Calculates the spawn position for an entity.
- Parameters
-
entityHandle The handle of the entity being spawned.
gameObjectBounds The bounding box of the entity to spawn.
environmentBounds The level bounds to spawn within.
cursor The current position within the spawn batch.
spawnContext Context data including optional emitter info.
- Returns
The world position for the spawned entity.
Definition at line 64 of file SpawnPlacer.ixx.
onReset()
| inline noexcept virtual |
Called when the spawn system is reset.
Override to reset any internal state (e.g., RNG seeds). The default implementation is a no-op.
Definition at line 78 of file SpawnPlacer.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.