return false;
}
- if(!init_fs()) {
+ if(!init_fs(opt.path)) {
return false;
}
goatvr_draw_eye(i);
glMatrixMode(GL_PROJECTION);
- glLoadMatrixf(goatvr_projection_matrix(i, 0.5, 1000.0));
+ glLoadMatrixf(goatvr_projection_matrix(i, 0.1, 200.0));
view_matrix = goatvr_view_matrix(i);
view_matrix.pre_rotate_x(deg_to_rad(cam_phi));
glViewport(0, 0, x, y);
Mat4 mat;
- mat.perspective(deg_to_rad(60), win_aspect, 0.5, 500.0);
+ mat.perspective(deg_to_rad(60), win_aspect, 0.1, 200.0);
glMatrixMode(GL_PROJECTION);
glLoadMatrixf(mat[0]);
tex_grid->set_anisotropy(glcaps.max_aniso);
mesh_skydome = new Mesh;
- gen_sphere(mesh_skydome, 500.0, 32, 16, 1, 0.5);
+ gen_sphere(mesh_skydome, 100.0, 32, 16, 1, 0.5);
mesh_skydome->flip();
glClearColor(fog_color.x, fog_color.y, fog_color.z, 1.0);
#define FAT_FONT_SZ 32
-bool init_fs()
+bool init_fs(const char *path)
{
iconrend = new ShapesIcons;
if(!iconrend->init()) {
return false;
}
- cur_node = get_fsnode(0);
+ cur_node = get_fsnode(path);
cur_node->expand();
return true;
}
void draw_fs()
{
static const float row_spacing = 2.0;
- static const float radius = 5;
+ static const float radius = 0.6;
static const float umax = 0.42;
static const float max_icon_angle = M_PI * 2.0 * umax;
Mat4 base_xform;
base_xform.rotate(time_sec, 0, 0);
base_xform.rotate(0, 0, time_sec * 0.5);
- base_xform.translate(0, 2, 0);
+ base_xform.translate(0, 1.65, 0);
glUseProgram(0);
glDisable(GL_TEXTURE_2D);
glPushMatrix();
xform = Mat4::identity;
xform.translate(-dtx_string_width(node->path.get_name()) / 2.0, 0, 0);
- xform.scale(0.01);
- xform.translate(0, 1 + row * row_spacing, -radius);
+ xform.scale(0.001);
+ xform.translate(0, 1.54 + row * row_spacing, -radius);
xform.rotate_y(angle);
glMultMatrixf(xform[0]);
bool expand();
};
-bool init_fs();
+bool init_fs(const char *path = 0);
void cleanup_fs();
void draw_fs();
bool ShapesIcons::init()
{
+ const float s = 0.12;
+
for(int i=0; i<NUM_SHAPES; i++) {
priv->shape[i] = new Mesh;
}
Mat4 xform;
- gen_geosphere(priv->shape[SHAPE_SPHERE], 0.5, 0);
- gen_box(priv->shape[SHAPE_BOX], 0.7, 0.7, 0.7);
- gen_torus(priv->shape[SHAPE_TORUS], 0.4, 0.1, 12, 6);
+ gen_geosphere(priv->shape[SHAPE_SPHERE], 0.5 * s, 0);
+ gen_box(priv->shape[SHAPE_BOX], 0.7 * s, 0.7 * s, 0.7 * s);
+ gen_torus(priv->shape[SHAPE_TORUS], 0.4 * s, 0.1 * s, 12, 6);
- gen_cone(priv->shape[SHAPE_CONE], 0.5, 1.0, 8, 2, 1);
- xform.translation(0, -0.33, 0);
+ gen_cone(priv->shape[SHAPE_CONE], 0.5 * s, 1.0 * s, 8, 2, 1);
+ xform.translation(0, -0.33 * s, 0);
priv->shape[SHAPE_CONE]->apply_xform(xform, Mat4::identity);
return true;
};
static int opt_handler(optcfg *oc, int opt, void *cls);
+static int arg_handler(optcfg *oc, const char *arg, void *cls);
bool init_options(int argc, char **argv, const char *cfgfile)
{
optcfg *oc = optcfg_init(options);
optcfg_set_opt_callback(oc, opt_handler, 0);
+ optcfg_set_arg_callback(oc, arg_handler, 0);
if(cfgfile) {
optcfg_parse_config_file(oc, cfgfile);
optcfg_print_options(oc);
exit(0);
}
- return true;
+ return 0;
+}
+
+static int arg_handler(optcfg *oc, const char *arg, void *cls)
+{
+ if(opt.path) {
+ fprintf(stderr, "unexpected argument: %s\n", arg);
+ return -1;
+ }
+ opt.path = arg;
+ return 0;
}
bool vr;
bool srgb;
bool fullscreen;
+ const char *path;
};
extern Options opt;