mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-09-29 22:40:41 +00:00
solv:: behind-camera optimization
This commit is contained in:
parent
3ae542b241
commit
03119d0dd5
14
graph.cpp
14
graph.cpp
@ -4490,7 +4490,7 @@ int noclipped;
|
|||||||
void make_clipping_planes() {
|
void make_clipping_planes() {
|
||||||
#if MAXMDIM >= 4
|
#if MAXMDIM >= 4
|
||||||
clipping_planes.clear();
|
clipping_planes.clear();
|
||||||
if(sphere || sol) return;
|
if(sphere) return;
|
||||||
auto add_clipping_plane = [] (ld x1, ld y1, ld x2, ld y2) {
|
auto add_clipping_plane = [] (ld x1, ld y1, ld x2, ld y2) {
|
||||||
using namespace hyperpoint_vec;
|
using namespace hyperpoint_vec;
|
||||||
ld z1 = 1, z2 = 1;
|
ld z1 = 1, z2 = 1;
|
||||||
@ -5041,7 +5041,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
|||||||
}
|
}
|
||||||
if(just_gmatrix) return;
|
if(just_gmatrix) return;
|
||||||
#if MAXMDIM >= 4
|
#if MAXMDIM >= 4
|
||||||
if(WDIM == 3 && pmodel == mdPerspective) {
|
if(pmodel == mdPerspective) {
|
||||||
using namespace hyperpoint_vec;
|
using namespace hyperpoint_vec;
|
||||||
hyperpoint H = tC0(V);
|
hyperpoint H = tC0(V);
|
||||||
for(hyperpoint& cpoint: clipping_planes) if((H|cpoint) < -sin_auto(cgi.corner_bonus)) {
|
for(hyperpoint& cpoint: clipping_planes) if((H|cpoint) < -sin_auto(cgi.corner_bonus)) {
|
||||||
@ -5050,6 +5050,16 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
|||||||
}
|
}
|
||||||
noclipped++;
|
noclipped++;
|
||||||
}
|
}
|
||||||
|
if(pmodel == mdSolPerspective) {
|
||||||
|
using namespace hyperpoint_vec;
|
||||||
|
hyperpoint H = tC0(V);
|
||||||
|
if(abs(H[0]) <= 1 && abs(H[1]) <= 1 && abs(H[2]) <= 1) ;
|
||||||
|
else {
|
||||||
|
hyperpoint H2 = solv::local_perspective * solv::inverse_exp(H, true);
|
||||||
|
for(hyperpoint& cpoint: clipping_planes) if((H2|cpoint) < -.2) return;
|
||||||
|
}
|
||||||
|
noclipped++;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CAP_SHAPES
|
#if CAP_SHAPES
|
||||||
|
Loading…
Reference in New Issue
Block a user