Project

General

Profile

« Previous | Next » 

Revision 82eb152a

Added by Leszek Koltunski over 2 years ago

JsonReader (?) finished: the creator app can now read objects from JSON files.

View differences:

src/main/java/org/distorted/objectlib/main/Twisty12.java
19 19

  
20 20
package org.distorted.objectlib.main;
21 21

  
22
import android.content.res.Resources;
22
import java.io.InputStream;
23 23

  
24
import org.distorted.library.main.DistortedEffects;
25
import org.distorted.library.main.DistortedTexture;
26
import org.distorted.library.mesh.MeshSquare;
27 24
import org.distorted.library.type.Static3D;
28 25
import org.distorted.library.type.Static4D;
29 26

  
......
51 48
           MINX_DBLUE , MINX_DYELLOW, MINX_WHITE , MINX_GREY
52 49
         };
53 50

  
51
  static final int NUM_FACES = 12;
52
  static final int FOV = 30;
53
  static final float RATIO = 0.35f;
54

  
54 55
///////////////////////////////////////////////////////////////////////////////////////////////////
55 56

  
56
  public Twisty12(int[] numLayers, float realSize, Static4D quat, Static3D move, Resources res)
57
  public Twisty12(int[] numLayers, float realSize, Static4D quat, Static3D move, InputStream stream)
57 58
    {
58
    super(numLayers, realSize, quat, move, res);
59
    super(numLayers, realSize, quat, move, stream);
59 60
    }
60 61

  
61 62
///////////////////////////////////////////////////////////////////////////////////////////////////
62 63

  
63 64
  public final int getNumFaces()
64 65
    {
65
    return 12;
66
    return NUM_FACES;
66 67
    }
67 68

  
68 69
///////////////////////////////////////////////////////////////////////////////////////////////////
69 70

  
70 71
  public int getNumFaceColors()
71 72
    {
72
    return 12;
73
    return FACE_COLORS.length;
73 74
    }
74 75

  
75 76
///////////////////////////////////////////////////////////////////////////////////////////////////
76 77

  
77
  protected int getColor(int face)
78
  public int getColor(int face)
78 79
    {
79 80
    return FACE_COLORS[face];
80 81
    }
......
83 84

  
84 85
  public int getFOV()
85 86
    {
86
    return 30;
87
    return FOV;
87 88
    }
88 89

  
89 90
///////////////////////////////////////////////////////////////////////////////////////////////////
90 91

  
91
  protected float getScreenRatio()
92
  public float getScreenRatio()
92 93
    {
93
    return 0.35f;
94
    return RATIO;
94 95
    }
95 96
}

Also available in: Unified diff