RandomSpawnPlacer Class
Placer that spawns entities at random positions within bounds. More...
Declaration
Base class
| class | SpawnPlacer |
|
Abstract interface for determining spawn positions. More... | |
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) override |
|
Returns a random position within the level bounds. More... | |
| void | onReset () noexcept override |
|
Resets the random number generator to its initial seed. More... | |
Private Member Attributes Index
| helios::util::Random | rGen_ {12345} |
Description
Placer that spawns entities at random positions within bounds.
RandomSpawnPlacer generates random X and Y coordinates within the provided level bounds. The Z coordinate is set to 0, making this suitable for 2D games.
Uses a static Random generator with a fixed seed for reproducibility.
- See Also
Definition at line 30 of file RandomSpawnPlacer.ixx.
Public Member Functions
getPosition()
| inline virtual |
Returns a random position within the level bounds.
- Parameters
-
entityHandle The handle of the entity being spawned (unused).
gameObjectBounds The bounding box of the entity to spawn (unused).
environmentBounds The level bounds to spawn within.
cursor The current position within the spawn batch (unused).
spawnContext Context data (unused).
- Returns
A random vec3f with Z = 0.
Definition at line 47 of file RandomSpawnPlacer.ixx.
References helios::math::aabb< T >::max and helios::math::aabb< T >::min.
onReset()
| inline noexcept virtual |
Resets the random number generator to its initial seed.
Definition at line 65 of file RandomSpawnPlacer.ixx.
Private Member Attributes
rGen_
|
Definition at line 32 of file RandomSpawnPlacer.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.