dbf-halloween2015
diff src/meshgen.h @ 0:50683c78264e
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 01 Nov 2015 00:09:12 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/meshgen.h Sun Nov 01 00:09:12 2015 +0200 1.3 @@ -0,0 +1,22 @@ 1.4 +#ifndef MESHGEN_H_ 1.5 +#define MESHGEN_H_ 1.6 + 1.7 +#include "vmath/vmath.h" 1.8 + 1.9 +class Mesh; 1.10 + 1.11 +void gen_sphere(Mesh *mesh, float rad, int usub, int vsub, float urange = 1.0, float vrange = 1.0); 1.12 +void gen_torus(Mesh *mesh, float mainrad, float ringrad, int usub, int vsub, float urange = 1.0, float vrange = 1.0); 1.13 +void gen_cylinder(Mesh *mesh, float rad, float height, int usub, int vsub, int capsub = 0, float urange = 1.0, float vrange = 1.0); 1.14 +void gen_cone(Mesh *mesh, float rad, float height, int usub, int vsub, int capsub = 0, float urange = 1.0, float vrange = 1.0); 1.15 +void gen_plane(Mesh *mesh, float width, float height, int usub = 1, int vsub = 1); 1.16 +void gen_heightmap(Mesh *mesh, float width, float height, int usub, int vsub, float (*hf)(float, float, void*), void *hfdata = 0); 1.17 +void gen_box(Mesh *mesh, float xsz, float ysz, float zsz, int usub = 1, int vsub = 1); 1.18 + 1.19 +void gen_revol(Mesh *mesh, int usub, int vsub, Vector2 (*rfunc)(float, float, void*), void *cls = 0); 1.20 +void gen_revol(Mesh *mesh, int usub, int vsub, Vector2 (*rfunc)(float, float, void*), Vector2 (*nfunc)(float, float, void*), void *cls); 1.21 + 1.22 +/* callback args: (float u, float v, void *cls) -> Vector2 XZ offset u,v in [0, 1] */ 1.23 +void gen_sweep(Mesh *mesh, float height, int usub, int vsub, Vector2 (*sfunc)(float, float, void*), void *cls = 0); 1.24 + 1.25 +#endif // MESHGEN_H_