1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-18 11:19:59 +00:00

missing push of rogueviz.h

This commit is contained in:
Zeno Rogue 2023-04-01 22:56:33 +02:00
parent f0b52b7034
commit 5a33967711

View File

@ -301,39 +301,35 @@ namespace objmodels {
void render(const shiftmatrix& V);
};
inline tf_result default_transformer(hyperpoint h) { return {0, direct_exp(h) };}
inline int default_subdivider(vector<hyperpoint>& hys) {
if(euclid) return 1;
ld maxlen = prec * max(hypot_d(3, hys[1] - hys[0]), max(hypot_d(3, hys[2] - hys[0]), hypot_d(3, hys[2] - hys[1])));
return int(ceil(maxlen));
}
#if CAP_TEXTURE
struct model {
string path, fname;
reaction_t preparer;
transformer tf;
subdivider sd;
bool is_available, av_checked;
model(string path = "", string fn = "",
transformer tf = default_transformer,
reaction_t prep = [] {},
subdivider sd = default_subdivider
) : path(path), fname(fn), preparer(prep), tf(tf), sd(sd) { av_checked = false; }
model(string path = "", string fn = "") : path(path), fname(fn) { av_checked = false; }
map<string, texture::texture_data> materials;
map<string, color_t> colors;
/* private */
void load_obj(model_data& objects);
virtual void load_obj(model_data& objects);
model_data& get();
virtual model_data& get();
void render(const shiftmatrix& V) { get().render(V); }
virtual void prepare() {}
virtual void postprocess() {}
virtual color_t read_color(ld a, ld b, ld c);
virtual hyperpoint transform(hyperpoint h);
virtual int subdivision(vector<hyperpoint>& hys);
virtual void render(const shiftmatrix& V) { get().render(V); }
virtual void process_triangle(vector<hyperpoint>& hys, vector<hyperpoint>& tot, bool textured, object *co);
bool available();
};