From b8d9e36baf889f93aff5761f49fa7eb30874d283 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Thu, 17 Jun 2021 23:27:31 +0200 Subject: Reimplement camera controller --- tangle/util/volumetric_example.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tangle/util/volumetric_example.h') diff --git a/tangle/util/volumetric_example.h b/tangle/util/volumetric_example.h index da5e4c4..cbcb2d2 100644 --- a/tangle/util/volumetric_example.h +++ b/tangle/util/volumetric_example.h @@ -24,7 +24,7 @@ int _samples_per_second = 30; public: VolumetricExample(descriptor::CuboidD<3> cuboid): RenderWindow("LiterateLB"), - _camera(make_float3(cuboid.nX/2,cuboid.nY/2,cuboid.nZ/2), cuboid.nX, M_PI/2, M_PI/2), + _camera(make_float3(cuboid.nX/2,cuboid.nY/2,cuboid.nZ/2), cuboid.nX), _config(cuboid), _palette(_config.palette), _noise(_config.noise) @@ -103,8 +103,10 @@ void run(TIMESTEP step) { }, [&](sf::Event& event) { _camera.handle(event); - _config.eye_pos = _camera.getEyePosition(); - _config.eye_dir = _camera.getDirection(); + _config.camera_position = _camera.getPosition(); + _config.camera_forward = _camera.getForward(); + _config.camera_right = _camera.getRight(); + _config.camera_up = _camera.getUp(); _config.canvas_size = make_uint2(this->getRenderView().width, this->getRenderView().height); } ); -- cgit v1.2.3