summaryrefslogtreecommitdiffhomepage
path: root/logic/pipeline.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-03-10 18:06:43 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-03-10 18:35:13 +0100
commitae1913228833d10b66636f2ff4d2b7ecc70ef142 (patch)
tree0b2488fa1f57eb8b7c90dda2fb1cf07f363282e4 /logic/pipeline.cpp
parente4ecbfe821dd6826f272af4a9331a8a6318d2e1f (diff)
logic/pipeline: immediately move to center with reltrans
Diffstat (limited to 'logic/pipeline.cpp')
-rw-r--r--logic/pipeline.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/logic/pipeline.cpp b/logic/pipeline.cpp
index 7774b02e..494d93ff 100644
--- a/logic/pipeline.cpp
+++ b/logic/pipeline.cpp
@@ -37,6 +37,13 @@ static constexpr inline double d2r = M_PI / 180.;
reltrans::reltrans() {}
+void reltrans::on_center()
+{
+ interp_pos = { 0, 0, 0 };
+ in_zone = false;
+ cur = false;
+}
+
euler_t reltrans::rotate(const rmat& R, const euler_t& in, vec3_bool disable) const
{
enum { tb_Z, tb_X, tb_Y };
@@ -410,8 +417,11 @@ Pose pipeline::apply_zero_pos(Pose value) const
return value;
}
-Pose pipeline::apply_reltrans(Pose value, vec6_bool disabled)
+Pose pipeline::apply_reltrans(Pose value, vec6_bool disabled, bool centerp)
{
+ if (centerp)
+ rel.on_center();
+
value = rel.apply_pipeline(s.reltrans_mode, value,
{ !!s.reltrans_disable_src_yaw,
!!s.reltrans_disable_src_pitch,
@@ -483,7 +493,7 @@ void pipeline::logic()
value(i) = map(value(i), m(i));
}
- value = apply_reltrans(value, disabled);
+ value = apply_reltrans(value, disabled, center_ordered);
{
// CAVEAT translation only, due to tcomp