Skip to content

Commit b5e71a8

Browse files
committed
Change turntable to have Y pointing up.
Turntable was added in commit e67f967.
1 parent 30e42ca commit b5e71a8

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/confscreen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ void TextWindow::ScreenChangeBackFaces(int link, uint32_t v) {
9595
void TextWindow::ScreenChangeTurntableNav(int link, uint32_t v) {
9696
SS.turntableNav = !SS.turntableNav;
9797
if(SS.turntableNav) {
98-
// If turntable nav is being turned on, align view so Z is vertical
99-
SS.GW.AnimateOnto(Quaternion::From(Vector::From(-1, 0, 0), Vector::From(0, 0, 1)),
98+
// If turntable nav is being turned on, align view so Y is vertical
99+
SS.GW.AnimateOnto(Quaternion::From(Vector::From(-1, 0, 0), Vector::From(0, 1, 0)),
100100
SS.GW.offset);
101101
}
102102
}

src/graphicswin.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,13 +465,13 @@ void GraphicsWindow::AnimateOntoWorkplane() {
465465
Entity *w = SK.GetEntity(ActiveWorkplane());
466466
Quaternion quatf = w->Normal()->NormalGetNum();
467467

468-
// Get Z pointing vertical, if we're on turntable nav mode:
468+
// Get Y pointing vertical, if we're on turntable nav mode:
469469
if(SS.turntableNav) {
470470
Vector normalRight = quatf.RotationU();
471-
Vector normalUp = quatf.RotationV();
471+
Vector normalUp = quatf.RotationN();
472472
Vector normal = normalRight.Cross(normalUp);
473-
if(normalRight.z != 0) {
474-
double theta = atan2(normalUp.z, normalRight.z);
473+
if(normalRight.y != 0) {
474+
double theta = atan2(normalUp.y, normalRight.y);
475475
theta -= atan2(1, 0);
476476
normalRight = normalRight.RotatedAbout(normal, theta);
477477
normalUp = normalUp.RotatedAbout(normal, theta);

src/mouse.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ void GraphicsWindow::MouseMoved(double x, double y, bool leftDown,
141141
if(!(shiftDown || ctrlDown)) {
142142
double sign = SS.cameraNav ? -1.0 : 1.0;
143143
double s = 0.3*(PI/180)*scale*sign; // degrees per pixel
144-
if(SS.turntableNav) { // lock the Z to vertical
145-
projRight = orig.projRight.RotatedAbout(Vector::From(0, 0, 1), -s * dx);
144+
if(SS.turntableNav) { // lock the Y to vertical
145+
projRight = orig.projRight.RotatedAbout(Vector::From(0, 1, 0), -s * dx);
146146
projUp = orig.projUp.RotatedAbout(
147-
Vector::From(orig.projRight.x, orig.projRight.y, orig.projRight.y), s * dy);
147+
Vector::From(orig.projRight.x, orig.projRight.z, orig.projRight.z), s * dy);
148148
} else {
149149
projRight = orig.projRight.RotatedAbout(orig.projUp, -s * dx);
150150
projUp = orig.projUp.RotatedAbout(orig.projRight, s * dy);

0 commit comments

Comments
 (0)