Skip to main content

EmitterSpawnPlacer Class

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

Declaration

class helios::engine::runtime::spawn::behavior::placements::EmitterSpawnPlacer { ... }

Base class

classSpawnPlacer

Abstract interface for determining spawn positions. More...

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

Returns the emitter's position. More...

Description

Placer that spawns entities at the emitter's position.

EmitterSpawnPlacer uses the position stored in the EmitterContext to place spawned entities. This is commonly used for projectiles that should originate from the firing entity.

Precondition

The SpawnContext must contain a valid EmitterContext.

See Also

SpawnPlacer

See Also

EmitterContext

Definition at line 32 of file EmitterSpawnPlacer.ixx.

Public Member Functions

getPosition()

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

Returns the emitter's position.

Parameters
entityHandle

The handle of the entity being spawned (unused).

gameObjectBounds

The bounding box of the entity to spawn (unused).

environmentBounds

The level bounds (unused).

cursor

The current position within the spawn batch (unused).

spawnContext

Context containing the emitter information.

Returns

The emitter's world position.

Precondition

spawnContext.emitterContext must have a value.

Definition at line 49 of file EmitterSpawnPlacer.ixx.

50 const helios::engine::ecs::EntityHandle& entityHandle,
51 const helios::math::aabbf& gameObjectBounds,
52 const helios::math::aabbf& environmentBounds,
53 const SpawnPlanCursor& cursor,
54 const SpawnContext& spawnContext
55 ) override {
56
57 const auto emitterCtx = spawnContext.emitterContext;
58 assert(emitterCtx.has_value() && "Unexpected nullopt for emitter");
59
60 return emitterCtx.value().position;
61 }

Reference helios::engine::runtime::spawn::types::SpawnContext::emitterContext.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.