StevEngine
StevEngine is a customizable C++ game engine.
|
Component for rendering heightmap terrain. More...
#include <visuals/TerrainRenderer.hpp>
Public Member Functions | |
TerrainRenderer (const Utilities::TerrainData &data, Material material=Material(), bool smooth=true) | |
Create terrain renderer. | |
TerrainRenderer (Utilities::Stream &stream) | |
Create terrain renderer from serialized data. | |
std::string | GetType () const |
Get component type. | |
Utilities::Stream | Export (Utilities::StreamType type) const |
Serialize component to a stream. | |
![]() | |
RenderComponent (const Object &object) | |
Create render component. | |
RenderComponent (const Object &object, Utilities::Vector3 position, Utilities::Quaternion rotation, Utilities::Vector3 scale) | |
Create render component with transform. | |
RenderComponent (const Object &object, Utilities::Stream &stream) | |
Create from serialized data. | |
Object & | GetObject () |
Local scale modifier. | |
Visuals::Material & | GetMaterial () |
Get material. | |
void | AddShader (ShaderProgram program) |
Add shader program. | |
void | RemoveShader (ShaderType type) |
Remove shader of specified type. | |
~RenderComponent () | |
Clean up component resources. | |
![]() | |
Component () | |
Create new component. | |
virtual | ~Component () |
Clean up component resources. | |
GameObject & | GetParent () const |
Get parent GameObject. | |
Scene & | GetScene () const |
Get containing Scene. | |
virtual void | Start () |
Initialize component after creation. | |
Friends | |
class | StevEngine::GameObject |
Additional Inherited Members | |
![]() | |
Utilities::Vector3 | position = Utilities::Vector3() |
Utilities::Quaternion | rotation = Utilities::Quaternion() |
Local position offset. | |
Utilities::Vector3 | scale = Utilities::Vector3(1, 1, 1) |
Local rotation offset. | |
![]() | |
Object | object |
Renderable object. | |
std::map< ShaderType, ShaderProgram > | shaders |
Shader programs by type. | |
![]() | |
std::vector< std::pair< Utilities::ID, std::string > > | handlers |
Event handler registrations. | |
Component for rendering heightmap terrain.
Handles rendering of terrain generated from heightmap data. Supports normal mapping and smooth/flat shading.
StevEngine::Visuals::TerrainRenderer::TerrainRenderer | ( | const Utilities::TerrainData & | data, |
Material | material = Material(), | ||
bool | smooth = true ) |
Create terrain renderer.
data | Heightmap terrain data |
material | Surface material |
smooth | Use smooth normal calculation |
StevEngine::Visuals::TerrainRenderer::TerrainRenderer | ( | Utilities::Stream & | stream | ) |
Create terrain renderer from serialized data.
stream | Stream containing serialized component data |
|
virtual |
Serialize component to a stream.
type | Type of stream to export to |
Reimplemented from StevEngine::Renderer::RenderComponent.
|
inlinevirtual |
Get component type.
Reimplemented from StevEngine::Renderer::RenderComponent.