Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / shape / ShapeHexahedron.java @ cf93ea4e

1 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2019 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6 4c87f159 Leszek Koltunski
// 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 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
9
10 b31249d6 Leszek Koltunski
package org.distorted.objectlib.shape;
11 29b82486 Leszek Koltunski
12 ecf3d6e3 Leszek Koltunski
import org.distorted.library.type.Static3D;
13 29b82486 Leszek Koltunski
import org.distorted.library.type.Static4D;
14 cf93ea4e Leszek Koltunski
import org.distorted.objectlib.main.InitAssets;
15 b31249d6 Leszek Koltunski
import org.distorted.objectlib.main.InitData;
16
import org.distorted.objectlib.main.TwistyObject;
17 29b82486 Leszek Koltunski
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19
20 386af988 Leszek Koltunski
public abstract class ShapeHexahedron extends TwistyObject
21 29b82486 Leszek Koltunski
{
22 b0ec8fbd Leszek Koltunski
  public static final Static4D DEFAULT_ROT = new Static4D(-0.23377287f, 0.39656782f, 0.029073188f, 0.88726600f);
23
24 f9337e48 Leszek Koltunski
  public static final int[] FACE_COLORS = new int[]
25 29b82486 Leszek Koltunski
         {
26
           COLOR_YELLOW, COLOR_WHITE,
27
           COLOR_BLUE  , COLOR_GREEN,
28
           COLOR_RED   , COLOR_ORANGE
29
         };
30
31 f9337e48 Leszek Koltunski
  public static final int NUM_FACES = 6;
32 b31249d6 Leszek Koltunski
  public static final int FOV = 40;
33
  public static final float RATIO = 0.50f;
34 82eb152a Leszek Koltunski
35 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
36
37 cf93ea4e Leszek Koltunski
  public ShapeHexahedron(int meshState, int iconMode, float realSize, Static4D quat, Static3D move, float scale, InitData data, InitAssets asset)
38 29b82486 Leszek Koltunski
    {
39 cf93ea4e Leszek Koltunski
    super(meshState, iconMode, realSize, quat, move, scale, data, asset);
40 29b82486 Leszek Koltunski
    }
41
42
///////////////////////////////////////////////////////////////////////////////////////////////////
43
44 2289cab1 Leszek Koltunski
  public final int getNumFaces()
45 29b82486 Leszek Koltunski
    {
46 82eb152a Leszek Koltunski
    return NUM_FACES;
47 29b82486 Leszek Koltunski
    }
48
49
///////////////////////////////////////////////////////////////////////////////////////////////////
50
51 a75ae1ee Leszek Koltunski
  public int getNumFaceColors()
52 29b82486 Leszek Koltunski
    {
53 82eb152a Leszek Koltunski
    return FACE_COLORS.length;
54 29b82486 Leszek Koltunski
    }
55
56 2289cab1 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
57
58 82eb152a Leszek Koltunski
  public int getColor(int face)
59 2289cab1 Leszek Koltunski
    {
60
    return FACE_COLORS[face];
61
    }
62
63 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
64
65 7ba38dd4 Leszek Koltunski
  public int getFOV()
66 29b82486 Leszek Koltunski
    {
67 82eb152a Leszek Koltunski
    return FOV;
68 29b82486 Leszek Koltunski
    }
69
70
///////////////////////////////////////////////////////////////////////////////////////////////////
71
72 82eb152a Leszek Koltunski
  public float getScreenRatio()
73 29b82486 Leszek Koltunski
    {
74 82eb152a Leszek Koltunski
    return RATIO;
75 29b82486 Leszek Koltunski
    }
76
}