mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-27 09:24:53 +00:00
missing push of rogueviz.h
This commit is contained in:
parent
f0b52b7034
commit
5a33967711
@ -301,39 +301,35 @@ namespace objmodels {
|
|||||||
void render(const shiftmatrix& V);
|
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
|
#if CAP_TEXTURE
|
||||||
struct model {
|
struct model {
|
||||||
|
|
||||||
string path, fname;
|
string path, fname;
|
||||||
reaction_t preparer;
|
|
||||||
transformer tf;
|
|
||||||
subdivider sd;
|
|
||||||
|
|
||||||
bool is_available, av_checked;
|
bool is_available, av_checked;
|
||||||
|
|
||||||
model(string path = "", string fn = "",
|
model(string path = "", string fn = "") : path(path), fname(fn) { av_checked = false; }
|
||||||
transformer tf = default_transformer,
|
|
||||||
reaction_t prep = [] {},
|
|
||||||
subdivider sd = default_subdivider
|
|
||||||
) : path(path), fname(fn), preparer(prep), tf(tf), sd(sd) { av_checked = false; }
|
|
||||||
|
|
||||||
map<string, texture::texture_data> materials;
|
map<string, texture::texture_data> materials;
|
||||||
map<string, color_t> colors;
|
map<string, color_t> colors;
|
||||||
|
|
||||||
/* private */
|
/* 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();
|
bool available();
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user