From 8cd883e32e0f5c221b45cb766dc485f6be7be2a5 Mon Sep 17 00:00:00 2001 From: Robert Chisholm Date: Sat, 19 Oct 2024 17:39:39 +0100 Subject: [PATCH] Add support for an initial camera roll angle in visualiser Closes #1238 --- include/flamegpu/visualiser/ModelVis.h | 6 ++++++ src/flamegpu/visualiser/ModelVis.cpp | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/include/flamegpu/visualiser/ModelVis.h b/include/flamegpu/visualiser/ModelVis.h index 0defaa479..86367ee26 100644 --- a/include/flamegpu/visualiser/ModelVis.h +++ b/include/flamegpu/visualiser/ModelVis.h @@ -196,6 +196,12 @@ class ModelVis { * @param z The z coordinate */ void setInitialCameraTarget(const float &x, const float &y, const float &z); + /** + * Set the initial camera roll in radians + * This value defaults to 0 + * @param roll The roll angle in radians + */ + void setInitialCameraRoll(const float &roll); /** * The speed of camera movement, in units travelled per millisecond * This value defaults to (0.05, 5.0) diff --git a/src/flamegpu/visualiser/ModelVis.cpp b/src/flamegpu/visualiser/ModelVis.cpp index 99fe2fd8b..750e7c706 100644 --- a/src/flamegpu/visualiser/ModelVis.cpp +++ b/src/flamegpu/visualiser/ModelVis.cpp @@ -247,6 +247,10 @@ void ModelVis::setInitialCameraTarget(const float &x, const float &y, const floa data->modelCfg.cameraTarget[2] = z; } +void ModelVis::setInitialCameraRoll(const float &roll) { + data->modelCfg.cameraRoll = roll; +} + void ModelVis::setCameraSpeed(const float &speed, const float &shiftMultiplier) { data->modelCfg.cameraSpeed[0] = speed; data->modelCfg.cameraSpeed[1] = shiftMultiplier;