mirror of
https://github.com/overte-org/overte.git
synced 2025-04-12 19:58:15 +02:00
Exposing the on off to use the distance configs
This commit is contained in:
parent
52a4224442
commit
9b3d546dad
4 changed files with 21 additions and 3 deletions
|
@ -41,8 +41,8 @@ void ControlViews::run(const workload::WorkloadContextPointer& runContext, const
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (auto& outView : outViews) {
|
for (auto& outView : outViews) {
|
||||||
auto& current = regionBackFronts[workload::Region::R2].y;
|
auto& current = regionBackFronts[workload::Region::R2].y;
|
||||||
current = wtf_adjust(current, inTimings[0]);
|
auto newCurrent = wtf_adjust(current, inTimings[0]);
|
||||||
outView.regions[workload::Region::R2].y = current;
|
outView.regions[workload::Region::R2].y = newCurrent;
|
||||||
workload::View::updateRegionsFromBackFronts(outView);
|
workload::View::updateRegionsFromBackFronts(outView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,11 @@ void SetupViews::run(const WorkloadContextPointer& renderContext, const Input& i
|
||||||
|
|
||||||
// Update regions based on the current config
|
// Update regions based on the current config
|
||||||
for (auto& v : outViews) {
|
for (auto& v : outViews) {
|
||||||
View::updateRegionsFromBackFrontDistances(v, (float*) &data);
|
if (data.applyViewRanges) {
|
||||||
|
View::updateRegionsFromBackFrontDistances(v, (float*) &data);
|
||||||
|
} else {
|
||||||
|
View::updateRegionsFromBackFronts(v);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// outViews is ready to be used
|
// outViews is ready to be used
|
||||||
|
|
|
@ -27,6 +27,7 @@ namespace workload {
|
||||||
Q_PROPERTY(bool forceViewHorizontal READ forceViewHorizontal WRITE setForceViewHorizontal NOTIFY dirty)
|
Q_PROPERTY(bool forceViewHorizontal READ forceViewHorizontal WRITE setForceViewHorizontal NOTIFY dirty)
|
||||||
|
|
||||||
Q_PROPERTY(bool simulateSecondaryCamera READ simulateSecondaryCamera WRITE setSimulateSecondaryCamera NOTIFY dirty)
|
Q_PROPERTY(bool simulateSecondaryCamera READ simulateSecondaryCamera WRITE setSimulateSecondaryCamera NOTIFY dirty)
|
||||||
|
Q_PROPERTY(bool applyViewRanges READ applyViewRanges WRITE setApplyViewRanges NOTIFY dirty)
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,6 +55,9 @@ namespace workload {
|
||||||
bool simulateSecondaryCamera() const { return data.simulateSecondaryCamera; }
|
bool simulateSecondaryCamera() const { return data.simulateSecondaryCamera; }
|
||||||
void setSimulateSecondaryCamera(bool use) { data.simulateSecondaryCamera = use; emit dirty(); }
|
void setSimulateSecondaryCamera(bool use) { data.simulateSecondaryCamera = use; emit dirty(); }
|
||||||
|
|
||||||
|
bool applyViewRanges() const { return data.applyViewRanges; }
|
||||||
|
void setApplyViewRanges(bool use) { data.applyViewRanges = use; emit dirty(); }
|
||||||
|
|
||||||
struct Data {
|
struct Data {
|
||||||
float r1Back { 2.0f };
|
float r1Back { 2.0f };
|
||||||
float r1Front { 10.0f };
|
float r1Front { 10.0f };
|
||||||
|
@ -68,6 +72,8 @@ namespace workload {
|
||||||
bool useAvatarView{ false };
|
bool useAvatarView{ false };
|
||||||
bool forceViewHorizontal{ false };
|
bool forceViewHorizontal{ false };
|
||||||
bool simulateSecondaryCamera{ false };
|
bool simulateSecondaryCamera{ false };
|
||||||
|
bool applyViewRanges{ true };
|
||||||
|
|
||||||
} data;
|
} data;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
|
@ -110,6 +110,14 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Separator {}
|
||||||
|
HifiControls.CheckBox {
|
||||||
|
boxSize: 20
|
||||||
|
text: "Apply Front Back Ranges"
|
||||||
|
checked: Workload.getConfig("setupViews")["applyViewRanges"]
|
||||||
|
onCheckedChanged: { Workload.getConfig("setupViews")["applyViewRanges"] = checked; }
|
||||||
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
Loading…
Reference in a new issue