some more hooks, to add extra models

This commit is contained in:
Zeno Rogue committed 2026-05-21 11:20:40 +02:00
1 parent 4596fc0e50
commit c42211215f
2 files changed
+18 -1

No files matched your search

+11
View File
@@ -310,12 +310,15 @@ bool knowgood;
hyperpoint goodpoint;
vector<pair<int, hyperpoint>> tofix;
EX hookset<int()> hooks_two_sided_model;
EX bool two_sided_model() {
#if CAP_VR
bool in_vr = vrhr::rendering();
#else
constexpr bool in_vr = false;
#endif
auto i = callhandlers(0, hooks_two_sided_model); if(i) return i > 0;
if(GDIM == 3) return false;
if(in_vr_sphere) return true;
if(pmodel == mdHemisphere || pmodel == mdHyperboloid) return !in_vr;
@@ -328,7 +331,11 @@ EX bool two_sided_model() {
return false;
}
EX hookset<int(const hyperpoint& H)> hooks_get_side;
EX int get_side(const hyperpoint& H) {
int i = callhandlers(0, hooks_get_side, H);
if(i) return i;
#if CAP_VR
if(in_vr_sphere) {
hyperpoint Hscr;
@@ -2462,8 +2469,12 @@ EX void set_vr_sphere() {
EX int hemi_side = 0;
EX hookset<bool()> hooks_draw_main;
EX void draw_main() {
DEBBI(debug_graph, ("draw_main"));
if(callhandlers(false, hooks_draw_main)) return;
if(pconf.back_and_front == 1 && vid.consider_shader_projection) {
dynamicval<int> pa(pconf.back_and_front);
+7 -1
View File
@@ -2874,15 +2874,17 @@ void queuestraight(hyperpoint X, int style, color_t lc, color_t fc, PPR p) {
} */
}
#if HDR
/** ball is written as cspin(0, 1, alpha) * cspin(2, 1, beta) * cspin(0, 2, gamma) */
struct ball_deconstruct {
ld alpha, beta, gamma;
transmatrix talpha, tbeta, tgamma, igamma;
ld cos_beta, sin_beta;
};
#endif
/** create a ball_deconstruct object */
ball_deconstruct deconstruct_ball() {
EX ball_deconstruct deconstruct_ball() {
// (0,1,0) -> (0, cos beta, sin beta) -> (sin alpha, cos beta * cos alpha, sin beta)
hyperpoint h = pconf.ball() * point3(0, 1, 0);
ball_deconstruct d;
@@ -2901,8 +2903,12 @@ ball_deconstruct deconstruct_ball() {
return d;
}
EX hookset<bool(int)> hooks_draw_boundary;
EX void draw_boundary(int w) {
if(callhandlers(false, hooks_draw_boundary, w)) return;
if((nonisotropic || gproduct) && pmodel == mdDisk) {
queuecircle(current_display->xcenter, current_display->ycenter, current_display->radius, ringcolor, PPR::OUTCIRCLE, modelcolor);
return;