Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::World::WindField Class Reference

Procedural wind field used by glider flight, particles, and debug rendering. More...

#include <WindField.h>

Collaboration diagram for Engine::World::WindField:

Public Member Functions

WindSample sample (const glm::vec3 &worldPos, float timeSeconds) const
 Samples the strongest wind pocket affecting a world-space point.
const WindFieldConfig & getConfig () const
 Returns the current wind field configuration.
WindFieldConfig & getConfig ()
 Returns a mutable wind field configuration.
void setConfig (const WindFieldConfig &config)
 Replaces the wind field configuration.
void drawDebugAround (const glm::vec3 &center, float timeSeconds) const
 Draws debug visualization for wind pockets near a world-space center.

Private Attributes

WindFieldConfig config_
 Active runtime wind configuration.

Detailed Description

Procedural wind field used by glider flight, particles, and debug rendering.

WindField is deterministic for a given configuration, world position, and time. It does not store generated pockets; sample() derives nearby pocket candidates from hashed grid cells.

Definition at line 75 of file WindField.h.

Member Function Documentation

◆ drawDebugAround()

void Engine::World::WindField::drawDebugAround ( const glm::vec3 & center,
float timeSeconds ) const

Draws debug visualization for wind pockets near a world-space center.

Debug drawing is skipped when WindFieldConfig::debugDraw is false, when the field is disabled, or when both border and arrow drawing are disabled.

Parameters
centerWorld-space center of the visualization area.
timeSecondsGlobal time in seconds used for animated wind direction.

◆ getConfig() [1/2]

WindFieldConfig & Engine::World::WindField::getConfig ( )
inlinenodiscard

Returns a mutable wind field configuration.

Changes affect subsequent sample() and drawDebugAround() calls immediately.

Definition at line 104 of file WindField.h.

References config_.

◆ getConfig() [2/2]

const WindFieldConfig & Engine::World::WindField::getConfig ( ) const
inlinenodiscard

Returns the current wind field configuration.

Definition at line 94 of file WindField.h.

References config_.

◆ sample()

WindSample Engine::World::WindField::sample ( const glm::vec3 & worldPos,
float timeSeconds ) const
nodiscard

Samples the strongest wind pocket affecting a world-space point.

The sampler checks the point's neighboring horizontal cells and vertical layers, then returns the strongest pocket containing the point. Pocket direction slowly rotates by WindFieldConfig::globalDirectionRotationSpeed over time.

Parameters
worldPosWorld-space point to sample.
timeSecondsGlobal time in seconds used for direction animation.
Returns
Wind sample for the point, or a default sample when no pocket affects it.

◆ setConfig()

void Engine::World::WindField::setConfig ( const WindFieldConfig & config)
inline

Replaces the wind field configuration.

Parameters
configNew configuration copied into the wind field.

Definition at line 113 of file WindField.h.

References config_.

Member Data Documentation

◆ config_

WindFieldConfig Engine::World::WindField::config_
private

Active runtime wind configuration.

Definition at line 130 of file WindField.h.

Referenced by getConfig(), getConfig(), and setConfig().


The documentation for this class was generated from the following file:
  • /workspace/magerbeton/gl3-vulkan/code/Engine/include/Engine/World/WindField.h