SetWaterHeight

This command sets the water height. Water must be enabled for it to appear with World::SetWaterMode(true).

Syntax

Parameters

Example

#include "Leadwerks.h"

using namespace Leadwerks;

int main(int argc, const char *argv[])
{
Leadwerks::Window* window = Leadwerks::Window::Create();
Context* context = Context::Create(window);
World* world = World::Create();
Camera* camera = Camera::Create();
camera->Move(0, 1, -3);
Light* light = DirectionalLight::Create();
light->SetRotation(35, 35, 0);

camera->SetSkybox("Materials/Sky/skybox_texture.tex");

world->SetWaterMode(true);
world->SetWaterColor(0, 0.5, 0.5, 1);
world->SetWaterHeight(0.0);

while (true)
{
if (window->Closed() || window->KeyDown(Key::Escape)) return false;

Leadwerks::Time::Update();
world->Update();
world->Render();
context->Sync(false);

}
return 0;
}