Interactive snow service owned by the weather module. 更多...
#include <Snow.h>
Public 成员函数 | |
| Module_REG (Snow) | |
| Snow () | |
| Constructs a Snow. | |
| ~Snow () override=default | |
| Releases Snow resources. | |
| SnowField * | newField (int width, int height) |
| New empty snow field. @ownership Ownership transfers to the script/native caller. @lifetime Valid until the caller releases the field; the weather module does not retain it. @thread Main/script thread only. | |
| bool | applyToHeightmap (SnowField *field, procgen::Heightmap *terrain, procgen::Heightmap *out, float heightScale) |
| Compatibility script wrapper around applySnowToHeightmap(). @ownership All pointers are borrowed; no argument is retained. @lifetime Arguments must remain valid for this synchronous call. @thread Main/script thread only. | |
| graphics::Texture * | uploadTexture (SnowField *field, graphics::Graphics *gfx, const std::string &kind) |
| Upload the field as an RGBA8 texture. | |
| bool | updateTexture (SnowField *field, graphics::Texture *texture, graphics::Graphics *gfx, const std::string &kind) |
| Replace an uploaded snow texture's pixels in place. | |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| Module. | |
| virtual std::string | getName () const =0 |
| Returns the name. | |
详细描述
Interactive snow service owned by the weather module.
The SnowField grid is the single source of truth: it drives the real terrain-surface displacement (footprints / craters as actual geometry via applySnowToHeightmap + heightmapTargets.updateMesh) and the POM height map (uploadTexture / updateTexture + Renderable3D.setHeightTexture/setParallax), plus snowfall recovery (addSnowfall).
Script: snow <- eve.Snow();
构造及析构函数说明
◆ Snow()
|
default |
Constructs a Snow.
◆ ~Snow()
|
overridedefault |
Releases Snow resources.
成员函数说明
◆ applyToHeightmap()
| bool eve::weather::Snow::applyToHeightmap | ( | SnowField * | field, |
| procgen::Heightmap * | terrain, | ||
| procgen::Heightmap * | out, | ||
| float | heightScale | ||
| ) |
Compatibility script wrapper around applySnowToHeightmap(). @ownership All pointers are borrowed; no argument is retained. @lifetime Arguments must remain valid for this synchronous call. @thread Main/script thread only.
引用了 eve::weather::applySnowToHeightmap() , 以及 terrain.
◆ Module_REG()
| eve::weather::Snow::Module_REG | ( | Snow | ) |
◆ newField()
| SnowField * eve::weather::Snow::newField | ( | int | width, |
| int | height | ||
| ) |
◆ updateTexture()
| bool eve::weather::Snow::updateTexture | ( | SnowField * | field, |
| graphics::Texture * | texture, | ||
| graphics::Graphics * | gfx, | ||
| const std::string & | kind | ||
| ) |
Replace an uploaded snow texture's pixels in place.
- 参数
-
kind one of "height" | "albedo" | "normal" (must match the upload).
- 返回
- Compatibility scalar; false when dimensions or pixels are invalid. @ownership All pointers are borrowed and are not retained. @lifetime Arguments must remain valid for this synchronous call. @thread Render/main thread only.
引用了 kind , 以及 eve::graphics::Graphics::updateTexture().
◆ uploadTexture()
| graphics::Texture * eve::weather::Snow::uploadTexture | ( | SnowField * | field, |
| graphics::Graphics * | gfx, | ||
| const std::string & | kind | ||
| ) |
Upload the field as an RGBA8 texture.
- 参数
-
kind "height" (R = snow depth, POM height map), "albedo" (snow/ground color) or "normal" (tangent-space from the depth gradient). @ownership fieldandgfxare borrowed; the returned texture is owned by Graphics. @lifetime Arguments must remain valid for this synchronous call; the result remains valid until its Graphics owner releases resources. @thread Render/main thread only.
引用了 kind , 以及 eve::graphics::Graphics::newTexture().
该类的文档由以下文件生成:
Public 成员函数 继承自