Rise
The Vieneo Province
Loading...
Searching...
No Matches
WindshieldRain::Surface Class Reference

#include <WindshieldRain.h>

Collaboration diagram for WindshieldRain::Surface:
[legend]

Classes

struct  BladeSweep
struct  BeadSample
struct  WakeSample
struct  WaterDrop
struct  CappedImpactIndex

Public Types

using Field = std::vector<float>

Public Member Functions

 Surface (float width=1, float height=1, uint32_t seed=9)
void Clear ()
void Impact (Point position, float radius, bool coalesce=true)
void Splash (Point position, float radius, Point velocity={}, bool coalesce=true)
void Update (float elapsed, float rain, Point acceleration, Point wind, float airDensity, float airSpeed=-1.f, AirJet airJet={})
void WipeTriangle (Point a, Point b, Point c)
void SweepBlades (const std::vector< BladeSweep > &sweeps, float elapsed)
void Rebuild ()
void BeadMap (std::vector< BeadSample > &map, std::vector< WakeSample > *wakes=nullptr, std::vector< float > *scratchDistances=nullptr) const
uint64_t Revision () const
int LastStepCount () const
const Field & Water () const
const Field & Residue () const
const std::vector< Drop > & Drops () const
size_t DropLimit () const
float Width () const
float Height () const
bool Wet () const
float Wetness () const

Static Public Attributes

static constexpr int Resolution = 256
static constexpr size_t MaxDrops = 8192
static constexpr float TrailHalfLifeSeconds = 12.f
static constexpr float BeadRadiusScale = 1.25f

Private Member Functions

void CappedImpact (Point position, float radius, CappedImpactIndex &index)
void MaterializeWater () const
void Coalesce ()
float Random ()
float TrailAt (Point p) const
void Stamp (Field &field, Point p, float radius, float amount, bool residue=false) const
void StampTrail (Point start, Point delta, float radius, float amount, int samples)

Static Private Member Functions

static float Volume (const Drop &drop)
static bool Touching (const Drop &a, const Drop &b)
static void Merge (Drop &a, const Drop &b)
static float Roughness (Point p)
static int Pixel (float v, float extent)

Private Attributes

float width
float height
float accumulator = 0
float spawnCredit = 0
uint32_t random
size_t splashPopulation =0
int lastStepCount = 0
uint64_t revision = 0
std::vector< Drop > drops
Field trail = Field(Resolution * Resolution)
Field water = Field(Resolution * Resolution)
std::vector< WaterDrop > waterDrops

Detailed Description

Definition at line 85 of file WindshieldRain.h.

Member Typedef Documentation

◆ Field

using WindshieldRain::Surface::Field = std::vector<float>

Definition at line 91 of file WindshieldRain.h.

Constructor & Destructor Documentation

◆ Surface()

WindshieldRain::Surface::Surface ( float width = 1,
float height = 1,
uint32_t seed = 9 )
inline

Definition at line 92 of file WindshieldRain.h.

Member Function Documentation

◆ BeadMap()

void WindshieldRain::Surface::BeadMap ( std::vector< BeadSample > & map,
std::vector< WakeSample > * wakes = nullptr,
std::vector< float > * scratchDistances = nullptr ) const
inline

Definition at line 516 of file WindshieldRain.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CappedImpact()

void WindshieldRain::Surface::CappedImpact ( Point position,
float radius,
CappedImpactIndex & index )
inlineprivate

Definition at line 639 of file WindshieldRain.h.

Here is the call graph for this function:

◆ Clear()

void WindshieldRain::Surface::Clear ( )
inline

Definition at line 95 of file WindshieldRain.h.

◆ Coalesce()

void WindshieldRain::Surface::Coalesce ( )
inlineprivate

Definition at line 710 of file WindshieldRain.h.

Here is the call graph for this function:

◆ DropLimit()

size_t WindshieldRain::Surface::DropLimit ( ) const
inline

Definition at line 605 of file WindshieldRain.h.

Here is the caller graph for this function:

◆ Drops()

const std::vector< Drop > & WindshieldRain::Surface::Drops ( ) const
inline

Definition at line 604 of file WindshieldRain.h.

◆ Height()

float WindshieldRain::Surface::Height ( ) const
inline

Definition at line 611 of file WindshieldRain.h.

Here is the caller graph for this function:

◆ Impact()

void WindshieldRain::Surface::Impact ( Point position,
float radius,
bool coalesce = true )
inline

Definition at line 103 of file WindshieldRain.h.

Here is the call graph for this function:

◆ LastStepCount()

int WindshieldRain::Surface::LastStepCount ( ) const
inline

Definition at line 601 of file WindshieldRain.h.

◆ MaterializeWater()

void WindshieldRain::Surface::MaterializeWater ( ) const
inlineprivate

Definition at line 678 of file WindshieldRain.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Merge()

void WindshieldRain::Surface::Merge ( Drop & a,
const Drop & b )
inlinestaticprivate

Definition at line 694 of file WindshieldRain.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Pixel()

int WindshieldRain::Surface::Pixel ( float v,
float extent )
inlinestaticprivate

Definition at line 751 of file WindshieldRain.h.

Here is the caller graph for this function:

◆ Random()

float WindshieldRain::Surface::Random ( )
inlineprivate

Definition at line 746 of file WindshieldRain.h.

◆ Rebuild()

void WindshieldRain::Surface::Rebuild ( )
inline

Definition at line 498 of file WindshieldRain.h.

Here is the caller graph for this function:

◆ Residue()

const Field & WindshieldRain::Surface::Residue ( ) const
inline

Definition at line 603 of file WindshieldRain.h.

Here is the caller graph for this function:

◆ Revision()

uint64_t WindshieldRain::Surface::Revision ( ) const
inline

Definition at line 600 of file WindshieldRain.h.

Here is the caller graph for this function:

◆ Roughness()

float WindshieldRain::Surface::Roughness ( Point p)
inlinestaticprivate

Definition at line 732 of file WindshieldRain.h.

◆ Splash()

void WindshieldRain::Surface::Splash ( Point position,
float radius,
Point velocity = {},
bool coalesce = true )
inline

Definition at line 116 of file WindshieldRain.h.

◆ Stamp()

void WindshieldRain::Surface::Stamp ( Field & field,
Point p,
float radius,
float amount,
bool residue = false ) const
inlineprivate

Definition at line 765 of file WindshieldRain.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StampTrail()

void WindshieldRain::Surface::StampTrail ( Point start,
Point delta,
float radius,
float amount,
int samples )
inlineprivate

Definition at line 785 of file WindshieldRain.h.

Here is the call graph for this function:

◆ SweepBlades()

void WindshieldRain::Surface::SweepBlades ( const std::vector< BladeSweep > & sweeps,
float elapsed )
inline

Definition at line 400 of file WindshieldRain.h.

Here is the call graph for this function:

◆ Touching()

bool WindshieldRain::Surface::Touching ( const Drop & a,
const Drop & b )
inlinestaticprivate

Definition at line 688 of file WindshieldRain.h.

Here is the caller graph for this function:

◆ TrailAt()

float WindshieldRain::Surface::TrailAt ( Point p) const
inlineprivate

Definition at line 755 of file WindshieldRain.h.

◆ Update()

void WindshieldRain::Surface::Update ( float elapsed,
float rain,
Point acceleration,
Point wind,
float airDensity,
float airSpeed = -1.f,
AirJet airJet = {} )
inline

Definition at line 140 of file WindshieldRain.h.

◆ Volume()

float WindshieldRain::Surface::Volume ( const Drop & drop)
inlinestaticprivate

Definition at line 687 of file WindshieldRain.h.

Here is the caller graph for this function:

◆ Water()

const Field & WindshieldRain::Surface::Water ( ) const
inline

Definition at line 602 of file WindshieldRain.h.

Here is the call graph for this function:

◆ Wet()

bool WindshieldRain::Surface::Wet ( ) const
inline

Definition at line 612 of file WindshieldRain.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wetness()

float WindshieldRain::Surface::Wetness ( ) const
inline

Definition at line 613 of file WindshieldRain.h.

◆ Width()

float WindshieldRain::Surface::Width ( ) const
inline

Definition at line 610 of file WindshieldRain.h.

Here is the caller graph for this function:

◆ WipeTriangle()

void WindshieldRain::Surface::WipeTriangle ( Point a,
Point b,
Point c )
inline

Definition at line 360 of file WindshieldRain.h.

Here is the call graph for this function:

Member Data Documentation

◆ accumulator

float WindshieldRain::Surface::accumulator = 0
private

Definition at line 620 of file WindshieldRain.h.

◆ BeadRadiusScale

float WindshieldRain::Surface::BeadRadiusScale = 1.25f
staticconstexpr

Definition at line 512 of file WindshieldRain.h.

◆ drops

std::vector<Drop> WindshieldRain::Surface::drops
private

Definition at line 625 of file WindshieldRain.h.

◆ height

float WindshieldRain::Surface::height
private

Definition at line 620 of file WindshieldRain.h.

◆ lastStepCount

int WindshieldRain::Surface::lastStepCount = 0
private

Definition at line 623 of file WindshieldRain.h.

◆ MaxDrops

size_t WindshieldRain::Surface::MaxDrops = 8192
staticconstexpr

Definition at line 89 of file WindshieldRain.h.

◆ random

uint32_t WindshieldRain::Surface::random
private

Definition at line 621 of file WindshieldRain.h.

◆ Resolution

int WindshieldRain::Surface::Resolution = 256
staticconstexpr

Definition at line 88 of file WindshieldRain.h.

◆ revision

uint64_t WindshieldRain::Surface::revision = 0
private

Definition at line 624 of file WindshieldRain.h.

◆ spawnCredit

float WindshieldRain::Surface::spawnCredit = 0
private

Definition at line 620 of file WindshieldRain.h.

◆ splashPopulation

size_t WindshieldRain::Surface::splashPopulation =0
private

Definition at line 622 of file WindshieldRain.h.

◆ trail

Field WindshieldRain::Surface::trail = Field(Resolution * Resolution)
private

Definition at line 626 of file WindshieldRain.h.

◆ TrailHalfLifeSeconds

float WindshieldRain::Surface::TrailHalfLifeSeconds = 12.f
staticconstexpr

Definition at line 90 of file WindshieldRain.h.

◆ water

Field WindshieldRain::Surface::water = Field(Resolution * Resolution)
mutableprivate

Definition at line 627 of file WindshieldRain.h.

◆ waterDrops

std::vector<WaterDrop> WindshieldRain::Surface::waterDrops
mutableprivate

Definition at line 629 of file WindshieldRain.h.

◆ width

float WindshieldRain::Surface::width
private

Definition at line 620 of file WindshieldRain.h.


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