fixed scale in VR
[vrfileman] / src / icon.cc
index 502333c..b6cefff 100644 (file)
@@ -45,18 +45,20 @@ ShapesIcons::~ShapesIcons()
 
 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], 1, 1, 1);
-       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;
@@ -72,11 +74,11 @@ void ShapesIcons::shutdown()
 static int fstype_shape(FSNodeType type)
 {
        switch(type) {
-       case FSNODE_FILE:
+       case FSTYPE_FILE:
                return SHAPE_SPHERE;
-       case FSNODE_DIR:
+       case FSTYPE_DIR:
                return SHAPE_BOX;
-       case FSNODE_DEV:
+       case FSTYPE_DEV:
                return SHAPE_TORUS;
        default:
                break;
@@ -87,5 +89,5 @@ static int fstype_shape(FSNodeType type)
 void ShapesIcons::draw(FSNode *node) const
 {
        int s = fstype_shape(node->type);
-       priv->shape[s]->draw();
+       priv->shape[s]->draw_wire();
 }