summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--logic/pipeline.cpp9
-rw-r--r--logic/pipeline.hpp2
2 files changed, 7 insertions, 4 deletions
diff --git a/logic/pipeline.cpp b/logic/pipeline.cpp
index 105e672a..4756db3e 100644
--- a/logic/pipeline.cpp
+++ b/logic/pipeline.cpp
@@ -114,7 +114,7 @@ Pose reltrans::apply_pipeline(reltrans_state state, const Pose& value,
// dynamic neck
if (neck_enable)
{
- const euler_t neck = apply_neck(value, -neck_z);
+ const euler_t neck = apply_neck(value, -neck_z, disable(TZ));
for (unsigned k = 0; k < 3; k++)
rel(k) += neck(k);
@@ -169,7 +169,7 @@ Pose reltrans::apply_pipeline(reltrans_state state, const Pose& value,
// dynamic neck
if (neck_enable)
{
- const euler_t neck = apply_neck(value, -neck_z);
+ const euler_t neck = apply_neck(value, -neck_z, disable(TZ));
for (unsigned k = 0; k < 3; k++)
rel(k) += neck(k);
@@ -182,7 +182,7 @@ Pose reltrans::apply_pipeline(reltrans_state state, const Pose& value,
};
}
-euler_t reltrans::apply_neck(const Pose& value, int nz) const
+euler_t reltrans::apply_neck(const Pose& value, int nz, bool disable_tz) const
{
euler_t neck;
@@ -190,6 +190,9 @@ euler_t reltrans::apply_neck(const Pose& value, int nz) const
neck = rotate(R, { 0, 0, nz }, vec3_bool());
neck(TZ) = neck(TZ) - nz;
+ if (disable_tz)
+ neck(TZ) = 0;
+
return neck;
}
diff --git a/logic/pipeline.hpp b/logic/pipeline.hpp
index 2fe0f64b..606a7bf6 100644
--- a/logic/pipeline.hpp
+++ b/logic/pipeline.hpp
@@ -57,7 +57,7 @@ public:
const vec6_bool& disable, bool neck_enable, int neck_z);
warn_result_unused
- euler_t apply_neck(const Pose& value, int nz) const;
+ euler_t apply_neck(const Pose& value, int nz, bool disable_tz) const;
};
using namespace time_units;