mirror of
https://github.com/overte-org/overte.git
synced 2025-06-14 03:26:02 +02:00
Bail in Neuron plugin update if plugin not enabled
This commit is contained in:
parent
9ae390853c
commit
5abd254a58
1 changed files with 10 additions and 6 deletions
|
@ -367,6 +367,12 @@ void NeuronPlugin::init() {
|
||||||
|
|
||||||
auto preferences = DependencyManager::get<Preferences>();
|
auto preferences = DependencyManager::get<Preferences>();
|
||||||
static const QString NEURON_PLUGIN { "Perception Neuron" };
|
static const QString NEURON_PLUGIN { "Perception Neuron" };
|
||||||
|
{
|
||||||
|
auto getter = [this]()->bool { return _enabled; };
|
||||||
|
auto setter = [this](bool value) { _enabled = value; saveSettings(); };
|
||||||
|
auto preference = new CheckPreference(NEURON_PLUGIN, "Enabled", getter, setter);
|
||||||
|
preferences->addPreference(preference);
|
||||||
|
}
|
||||||
{
|
{
|
||||||
auto getter = [this]()->QString { return _serverAddress; };
|
auto getter = [this]()->QString { return _serverAddress; };
|
||||||
auto setter = [this](const QString& value) { _serverAddress = value; saveSettings(); };
|
auto setter = [this](const QString& value) { _serverAddress = value; saveSettings(); };
|
||||||
|
@ -387,12 +393,6 @@ void NeuronPlugin::init() {
|
||||||
preference->setStep(1);
|
preference->setStep(1);
|
||||||
preferences->addPreference(preference);
|
preferences->addPreference(preference);
|
||||||
}
|
}
|
||||||
{
|
|
||||||
auto getter = [this]()->bool { return _enabled; };
|
|
||||||
auto setter = [this](bool value) { _enabled = value; saveSettings(); };
|
|
||||||
auto preference = new CheckPreference(NEURON_PLUGIN, "Enabled", getter, setter);
|
|
||||||
preferences->addPreference(preference);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NeuronPlugin::isSupported() const {
|
bool NeuronPlugin::isSupported() const {
|
||||||
|
@ -455,6 +455,10 @@ void NeuronPlugin::deactivate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NeuronPlugin::pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) {
|
void NeuronPlugin::pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) {
|
||||||
|
if (!_enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<NeuronJoint> joints;
|
std::vector<NeuronJoint> joints;
|
||||||
{
|
{
|
||||||
// lock and copy
|
// lock and copy
|
||||||
|
|
Loading…
Reference in a new issue