Project

General

Profile

Download (2.63 KB) Statistics
| Branch: | Revision:

distorted-objectlib / src / main / java / org / distorted / objectlib / main / ShapeHexahedron.java @ b3b79e9b

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2019 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is proprietary software licensed under an EULA which you should have received      //
7
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
8
///////////////////////////////////////////////////////////////////////////////////////////////////
9

    
10
package org.distorted.objectlib.main;
11

    
12
import java.io.InputStream;
13

    
14
import org.distorted.library.type.Static3D;
15
import org.distorted.library.type.Static4D;
16

    
17
///////////////////////////////////////////////////////////////////////////////////////////////////
18

    
19
public abstract class ShapeHexahedron extends TwistyObject
20
{
21
  public static final Static4D DEFAULT_ROT = new Static4D(-0.23377287f, 0.39656782f, 0.029073188f, 0.88726600f);
22

    
23
  static final int[] FACE_COLORS = new int[]
24
         {
25
           COLOR_YELLOW, COLOR_WHITE,
26
           COLOR_BLUE  , COLOR_GREEN,
27
           COLOR_RED   , COLOR_ORANGE
28
         };
29

    
30
  static final int NUM_FACES = 6;
31
  static final int FOV = 40;
32
  static final float RATIO = 0.50f;
33

    
34
///////////////////////////////////////////////////////////////////////////////////////////////////
35

    
36
  public ShapeHexahedron(InitData data, int meshState, int iconMode, float realSize, Static4D quat, Static3D move, float scale, InputStream stream)
37
    {
38
    super(data, meshState, iconMode, realSize, quat, move, scale, stream);
39
    }
40

    
41
///////////////////////////////////////////////////////////////////////////////////////////////////
42

    
43
  public final int getNumFaces()
44
    {
45
    return NUM_FACES;
46
    }
47

    
48
///////////////////////////////////////////////////////////////////////////////////////////////////
49

    
50
  public int getNumFaceColors()
51
    {
52
    return FACE_COLORS.length;
53
    }
54

    
55
///////////////////////////////////////////////////////////////////////////////////////////////////
56

    
57
  public int getColor(int face)
58
    {
59
    return FACE_COLORS[face];
60
    }
61

    
62
///////////////////////////////////////////////////////////////////////////////////////////////////
63

    
64
  public int getFOV()
65
    {
66
    return FOV;
67
    }
68

    
69
///////////////////////////////////////////////////////////////////////////////////////////////////
70

    
71
  public float getScreenRatio()
72
    {
73
    return RATIO;
74
    }
75
}
(8-8/13)