refactored all the operations on View

This commit is contained in:
Zeno Rogue committed 2019-09-12 22:50:15 +02:00
1 parent 65ce70cb2c
commit 96d7496043
8 files changed
+189 -153

No files matched your search

+6 -11
View File
@@ -1114,9 +1114,7 @@ namespace mapeditor {
unsigned gridcolor = 0xC0C0C040;
hyperpoint in_front_dist(ld d) {
hyperpoint h = prod ? product::direct_exp( inverse(nisot::local_perspective) * zforward_dir(d) ) : zpush0(d);
if(nonisotropic && nisot::geodesic_movement) h = nisot::get_exp(inverse(nisot::local_perspective) * h, 100);
return h;
return direct_exp(lp_iapply(ztangent(d)), 100);
}
hyperpoint find_mouseh3() {
@@ -1131,7 +1129,7 @@ namespace mapeditor {
ld d1 = front_edit;
hyperpoint h1 = in_front_dist(d);
if(front_config == eFront::sphere_center)
d1 = nisot::geo_dist(drawtrans * C0, h1, nisot::iTable);
d1 = geo_dist(drawtrans * C0, h1, iTable);
if(front_config == eFront::equidistants) {
hyperpoint h = idt * in_front_dist(d);
d1 = asin_auto(h[2]);
@@ -1174,9 +1172,7 @@ namespace mapeditor {
}
if(front_config == eFront::sphere_center) for(int i=0; i<4; i+=2) {
auto pt = [&] (ld a, ld b) {
hyperpoint h = dir_to_point(spin(a*degree) * cspin(0, 2, b*degree) * forward_dir(front_edit));
if(nonisotropic && nisot::geodesic_movement) return d2 * nisot::get_exp(h, 100);
return d2 * h;
return d2 * direct_exp(spin(a*degree) * cspin(0, 2, b*degree) * xtangent(front_edit), 100);
};
for(int ai=0; ai<parallels; ai++) {
ld a = ai * 360 / parallels;
@@ -1197,7 +1193,7 @@ namespace mapeditor {
for(int i=0; i<4; i+=2) {
for(int u=2; u<=20; u++) {
PRING(d) {
curvepoint(d2 * T * xspinpush(M_PI*d/cgi.S42, u/20.) * zpush(front_edit) * C0);
curvepoint(d2 * T * xspinpush(M_PI*d/cgi.S42, u/20.) * zpush0(front_edit));
}
queuecurve(cols[i + (u%5 != 0)], 0, i < 2 ? PPR::LINE : PPR::SUPERLINE);
}
@@ -1454,9 +1450,8 @@ namespace mapeditor {
displayfr(vid.xres-8, vid.yres-8-fs*5, 2, vid.fsize, XLAT("z: %1", fts(mh[2],4)), 0xC0C0C0, 16);
if(MDIM == 4)
displayfr(vid.xres-8, vid.yres-8-fs*4, 2, vid.fsize, XLAT("w: %1", fts(mh[3],4)), 0xC0C0C0, 16);
if(prod) mh = product::inverse_exp(mh);
else if(nonisotropic) mh = nisot::inverse_exp(mh, nisot::iTable, false);
displayfr(vid.xres-8, vid.yres-8-fs*3, 2, vid.fsize, XLAT("r: %1", fts(prod ? hypot_d(3, mh) : hdist0(mh),4)), 0xC0C0C0, 16);
mh = inverse_exp(mh, iTable, false);
displayfr(vid.xres-8, vid.yres-8-fs*3, 2, vid.fsize, XLAT("r: %1", fts(hypot_d(3, mh),4)), 0xC0C0C0, 16);
if(GDIM == 3) {
displayfr(vid.xres-8, vid.yres-8-fs, 2, vid.fsize, XLAT("ϕ: %1°", fts(-atan2(mh[2], hypot_d(2, mh)) / degree,4)), 0xC0C0C0, 16);
displayfr(vid.xres-8, vid.yres-8-fs*2, 2, vid.fsize, XLAT("λ: %1°", fts(-atan2(mh[1], mh[0]) / degree,4)), 0xC0C0C0, 16);