载入中...
搜索中...
未找到
eve::weather::Weather类 参考

Weather module — real-time precipitation / lightning / wind system. 更多...

#include <Weather.h>

类 eve::weather::Weather 继承关系图:
eve::Module

struct  Impl
 

Public 成员函数

 Module_REG (Weather)
 
 Weather ()
 
 ~Weather () override
 
void init (graphics::Graphics *gfx)
 Idempotent; builds meshes/shaders on first call.
 
void update (float dt, graphics::Graphics *gfx)
 Advance sim + push per-frame uniforms; must run before gfx.render3D().
 
void setPreset (const std::string &name)
 
std::string getPreset () const
 
void setIntensity (float v)
 
float getIntensity () const
 
void setWindSpeed (float v)
 
float getWindSpeed () const
 
void setWindDirection (float degrees)
 Wind direction in degrees; 0 = toward +Z, 90 = toward -X.
 
float getWindDirection () const
 
void setLightningEnabled (bool on)
 
bool isLightningEnabled () const
 
void strike ()
 Force a bolt strike this frame (useful for manual testing).
 
float getFlash () const
 How bright the current flash is (0..1), sampled by the scene for a key light.
 
void setSkyColor (float r, float g, float b)
 
float getSkyColorR () const
 
float getSkyColorG () const
 
float getSkyColorB () const
 
void setSunIntensity (float v)
 
float getSunIntensity () const
 
void setFogColor (float r, float g, float b)
 
float getFogColorR () const
 
float getFogColorG () const
 
float getFogColorB () const
 
void setFogDensity (float v)
 
float getFogDensity () const
 
float getAmbientBrightness () const
 Ambient multiplier that the example should feed into camera.setAmbient().
 
- Public 成员函数 继承自 eve::Module
virtual ~Module ()
 
virtual std::string getName () const =0
 

静态 Public 属性

static const char *const kPresetNames []
 
static const int kPresetCount = 6
 

详细描述

Weather module — real-time precipitation / lightning / wind system.

Drives a set of camera-facing Renderable3D meshes (rain streaks, snow flakes, lightning bolts) whose geometry is animated in the vertex shader from a small set of per-frame uniforms (time, wind, intensity). Meshes and shaders are built lazily on first use and reused, so nothing is allocated per-frame.

Usage from script: weather.setPreset("storm"); weather.setIntensity(0.8); weather.setWindSpeed(12.0); // each frame before gfx.render3D(): weather.update(dt, gfx);

Presets: "clear", "drizzle", "rain", "storm", "snow", "fog".

在文件 Weather.h31 行定义.

构造及析构函数说明

◆ Weather()

eve::weather::Weather::Weather ( )

在文件 Weather.cpp280 行定义.

◆ ~Weather()

eve::weather::Weather::~Weather ( )
override

在文件 Weather.cpp282 行定义.

成员函数说明

◆ getAmbientBrightness()

float eve::weather::Weather::getAmbientBrightness ( ) const

Ambient multiplier that the example should feed into camera.setAmbient().

在文件 Weather.cpp461 行定义.

引用了 eve::weather::Weather::Impl::intensityCur.

◆ getFlash()

float eve::weather::Weather::getFlash ( ) const

How bright the current flash is (0..1), sampled by the scene for a key light.

在文件 Weather.cpp439 行定义.

引用了 eve::weather::Weather::Impl::flash.

◆ getFogColorB()

float eve::weather::Weather::getFogColorB ( ) const

在文件 Weather.cpp456 行定义.

引用了 eve::weather::Weather::Impl::fogB.

◆ getFogColorG()

float eve::weather::Weather::getFogColorG ( ) const

在文件 Weather.cpp455 行定义.

引用了 eve::weather::Weather::Impl::fogG.

◆ getFogColorR()

float eve::weather::Weather::getFogColorR ( ) const

在文件 Weather.cpp454 行定义.

引用了 eve::weather::Weather::Impl::fogR.

◆ getFogDensity()

float eve::weather::Weather::getFogDensity ( ) const

在文件 Weather.cpp459 行定义.

引用了 eve::weather::Weather::Impl::fogDensity.

◆ getIntensity()

float eve::weather::Weather::getIntensity ( ) const

在文件 Weather.cpp418 行定义.

引用了 eve::weather::Weather::Impl::intensity.

◆ getPreset()

std::string eve::weather::Weather::getPreset ( ) const

在文件 Weather.cpp413 行定义.

引用了 kPresetNames , 以及 eve::weather::Weather::Impl::preset.

◆ getSkyColorB()

float eve::weather::Weather::getSkyColorB ( ) const

在文件 Weather.cpp446 行定义.

引用了 eve::weather::Weather::Impl::skyB.

◆ getSkyColorG()

float eve::weather::Weather::getSkyColorG ( ) const

在文件 Weather.cpp445 行定义.

引用了 eve::weather::Weather::Impl::skyG.

◆ getSkyColorR()

float eve::weather::Weather::getSkyColorR ( ) const

在文件 Weather.cpp444 行定义.

引用了 eve::weather::Weather::Impl::skyR.

◆ getSunIntensity()

float eve::weather::Weather::getSunIntensity ( ) const

在文件 Weather.cpp449 行定义.

引用了 eve::weather::Weather::Impl::sunIntensity.

◆ getWindDirection()

float eve::weather::Weather::getWindDirection ( ) const

在文件 Weather.cpp424 行定义.

引用了 eve::weather::Weather::Impl::windDirDeg.

◆ getWindSpeed()

float eve::weather::Weather::getWindSpeed ( ) const

在文件 Weather.cpp421 行定义.

引用了 eve::weather::Weather::Impl::windSpeed.

◆ init()

◆ isLightningEnabled()

bool eve::weather::Weather::isLightningEnabled ( ) const

在文件 Weather.cpp427 行定义.

引用了 eve::weather::Weather::Impl::lightningEnabled.

◆ Module_REG()

eve::weather::Weather::Module_REG ( Weather  )

◆ setFogColor()

void eve::weather::Weather::setFogColor ( float  r,
float  g,
float  b 
)

◆ setFogDensity()

void eve::weather::Weather::setFogDensity ( float  v)

在文件 Weather.cpp458 行定义.

引用了 eve::weather::Weather::Impl::fogDensity , 以及 v.

◆ setIntensity()

void eve::weather::Weather::setIntensity ( float  v)

在文件 Weather.cpp415 行定义.

引用了 eve::weather::Weather::Impl::intensity , 以及 v.

◆ setLightningEnabled()

void eve::weather::Weather::setLightningEnabled ( bool  on)

在文件 Weather.cpp426 行定义.

引用了 eve::weather::Weather::Impl::lightningEnabled.

◆ setPreset()

void eve::weather::Weather::setPreset ( const std::string &  name)

在文件 Weather.cpp404 行定义.

引用了 kPresetCount, kPresetNames, name , 以及 eve::weather::Weather::Impl::preset.

◆ setSkyColor()

void eve::weather::Weather::setSkyColor ( float  r,
float  g,
float  b 
)

◆ setSunIntensity()

void eve::weather::Weather::setSunIntensity ( float  v)

在文件 Weather.cpp448 行定义.

引用了 eve::weather::Weather::Impl::sunIntensity , 以及 v.

◆ setWindDirection()

void eve::weather::Weather::setWindDirection ( float  degrees)

Wind direction in degrees; 0 = toward +Z, 90 = toward -X.

在文件 Weather.cpp423 行定义.

引用了 eve::weather::Weather::Impl::windDirDeg.

◆ setWindSpeed()

void eve::weather::Weather::setWindSpeed ( float  v)

在文件 Weather.cpp420 行定义.

引用了 v , 以及 eve::weather::Weather::Impl::windSpeed.

◆ strike()

◆ update()

类成员变量说明

◆ kPresetCount

const int eve::weather::Weather::kPresetCount = 6
static

在文件 Weather.h47 行定义.

被这些函数引用 setPreset().

◆ kPresetNames

const char *const eve::weather::Weather::kPresetNames
static
初始值:
= {"clear", "drizzle", "rain",
"storm", "snow", "fog"}

在文件 Weather.h46 行定义.

被这些函数引用 getPreset() , 以及 setPreset().


该类的文档由以下文件生成: