From b5127b000658562f81ce760cccd39704b451d7b8 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 21 Mar 2019 03:38:10 +0100 Subject: [PATCH] 3d:: rotation_yz for line animation (la currently still changes directions randomly) --- config.cpp | 1 + conformal.cpp | 15 ++++++++++++--- hyper.h | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/config.cpp b/config.cpp index d2170c7e..f00996f0 100644 --- a/config.cpp +++ b/config.cpp @@ -224,6 +224,7 @@ void initConfig() { addsaver(conformal::bandhalf, "band width"); addsaver(conformal::bandsegment, "band segment"); addsaver(conformal::rotation, "conformal rotation"); + addsaver(conformal::rotation_xz, "conformal rotation_xz"); addsaver(conformal::do_rotate, "conformal rotation mode", 1); addsaver(conformal::model_orientation, "model orientation", 0); addsaver(conformal::model_orientation_yz, "model orientation-yz", 0); diff --git a/conformal.cpp b/conformal.cpp index 834203cd..a84227a7 100644 --- a/conformal.cpp +++ b/conformal.cpp @@ -273,6 +273,7 @@ namespace conformal { int bandhalf = 200; int bandsegment = 16000; ld rotation = 0; + ld rotation_xz = 90; int do_rotate = 1; ld model_orientation, halfplane_scale, model_orientation_yz; ld clip_min, clip_max; @@ -370,6 +371,7 @@ namespace conformal { v[ph+1]->at * C0; View = spin(rotation * degree) * xpush(-(phase-ph) * hdist(now, next)) * View; + if(DIM == 3) View = cspin(0, 2, rotation_xz * degree) * View; playermoved = false; centerover.at = v[ph]->base; compute_graphical_distance(); @@ -704,6 +706,12 @@ namespace conformal { dialog::addBoolItem(XLAT("rotation"), do_rotate == 2, 'r'); if(do_rotate == 0) dialog::lastItem().value = XLAT("NEVER"); dialog::lastItem().value += " " + its(rotation) + "°"; + + if(DIM == 3) { + dialog::addBoolItem(XLAT("rotation (x/z plane)"), do_rotate == 2, 'k'); + if(do_rotate == 0) dialog::lastItem().value = XLAT("NEVER"); + dialog::lastItem().value += " " + its(rotation_xz) + "°"; + } // if(pmodel == mdBand && sphere) if(pmodel != mdPerspective) @@ -959,9 +967,10 @@ namespace conformal { } else if(uni == 'a') pushScreen(history_menu); - else if(uni == 'r') { - if(rotation < 0) rotation = 0; - dialog::editNumber(rotation, 0, 360, 90, 0, XLAT("rotation"), + else if(uni == 'r' || uni == 'k') { + ld& selected_rotation = uni == 'r' ? rotation : rotation_xz; + if(selected_rotation < 0) selected_rotation = 0; + dialog::editNumber(selected_rotation, 0, 360, 90, 0, XLAT("rotation"), "This controls the automatic rotation of the world. " "It affects the line animation in the history mode, and " "lands which have a special direction. Note that if finding this special direction is a part of the puzzle, " diff --git a/hyper.h b/hyper.h index 8cb2fc60..3059ee21 100644 --- a/hyper.h +++ b/hyper.h @@ -1395,6 +1395,7 @@ namespace conformal { extern bool includeHistory; extern bool use_atan; extern ld rotation; + extern ld rotation_xz; extern int do_rotate; extern ld model_orientation, model_orientation_yz; extern ld halfplane_scale;