Skip to main content

SpawnPlacer Class

Abstract interface for determining spawn positions. More...

Declaration

class helios::engine::runtime::spawn::behavior::SpawnPlacer { ... }

Derived Classes

classAxisSpawnPlacer

Spawn placer that distributes entities evenly along an axis. More...

classColumnSpawnPlacer

Places spawned entities in a vertical column formation. More...

classDistributedSpawnPlacer<N>

Spawn placer that assigns entities to predefined spawn points. More...

classEmitterSpawnPlacer

Placer that spawns entities at the emitter's position. More...

classRandomSpawnPlacer

Placer that spawns entities at random positions within bounds. More...

Public Destructor Index

~SpawnPlacer ()=default

Public Member Functions Index

helios::math::vec3fgetPosition (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...

voidonReset () 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

SpawnProfile

See Also

SpawnInitializer

See Also

SpawnContext

Definition at line 47 of file SpawnPlacer.ixx.

Public Destructor

~SpawnPlacer()

virtual helios::engine::runtime::spawn::behavior::SpawnPlacer::~SpawnPlacer ()
virtual default

Definition at line 51 of file SpawnPlacer.ixx.

Public Member Functions

getPosition()

virtual helios::math::vec3f helios::engine::runtime::spawn::behavior::SpawnPlacer::getPosition (const helios::engine::ecs::EntityHandle & entityHandle, const helios::math::aabbf & gameObjectBounds, const helios::math::aabbf & environmentBounds, const SpawnPlanCursor & cursor, const SpawnContext & spawnContext)

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()

virtual void helios::engine::runtime::spawn::behavior::SpawnPlacer::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.

78 virtual void onReset() noexcept {
79 // noop
80 }

The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.