Antkeeper
0.0.1
|
Generates terrain patches and performs terrain patch LOD selection. More...
#include <terrain-system.hpp>
Public Member Functions | |
terrain_system (entity::registry ®istry) | |
~terrain_system () | |
virtual void | update (float t, float dt) |
Perform's a system's update() function. More... | |
entity::id | generate (std::shared_ptr< gl::image_2d > heightmap, const math::uvec2 &subdivisions, const math::transform< float > &transform, std::shared_ptr< render::material > material) |
Generates terrain entities from a heightmap. More... | |
![]() | |
updatable_system (entity::registry ®istry) | |
Creates an updatable system. More... | |
Additional Inherited Members | |
![]() | |
entity::registry & | registry |
Registry on which the system operate. More... | |
Generates terrain patches and performs terrain patch LOD selection.
Definition at line 37 of file terrain-system.hpp.
|
explicit |
Definition at line 37 of file terrain-system.cpp.
terrain_system::~terrain_system | ( | ) |
Definition at line 41 of file terrain-system.cpp.
entity::id terrain_system::generate | ( | std::shared_ptr< gl::image_2d > | heightmap, |
const math::uvec2 & | subdivisions, | ||
const math::transform< float > & | transform, | ||
std::shared_ptr< render::material > | material | ||
) |
Generates terrain entities from a heightmap.
heightmap | Heightmap from which the terrain should be generated. |
subdivisions | Number of heightmap subdivisions on the x- and z-axes. Determines the number of terrain entities generated. |
transform | Translation, rotation, and scale of the terrain. |
material | Terrain material. |
@except std::invalid_argument Failed to generate terrain from null heightmap. @except std::runtime_error Heightmap size less than 2x2. @except std::runtime_error Heightmap subdivision failed.
Definition at line 48 of file terrain-system.cpp.
|
virtual |
Perform's a system's update() function.
t | Total elapsed time, in seconds. |
dt | Delta time, in seconds. |
Implements updatable_system.
Definition at line 44 of file terrain-system.cpp.