Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / shape / ShapeDodecahedron.java @ b9f8919d

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 82eb152a Leszek Koltunski
import java.io.InputStream;
13 29b82486 Leszek Koltunski
14 ecf3d6e3 Leszek Koltunski
import org.distorted.library.type.Static3D;
15 29b82486 Leszek Koltunski
import org.distorted.library.type.Static4D;
16 b31249d6 Leszek Koltunski
import org.distorted.objectlib.main.InitData;
17
import org.distorted.objectlib.main.TwistyObject;
18 29b82486 Leszek Koltunski
19
///////////////////////////////////////////////////////////////////////////////////////////////////
20
21 386af988 Leszek Koltunski
public abstract class ShapeDodecahedron extends TwistyObject
22 29b82486 Leszek Koltunski
{
23 b0ec8fbd Leszek Koltunski
  public static final Static4D DEFAULT_ROT = new Static4D(-0.63874420f, 0.25712812f, 0.358450060f, 0.63039730f);
24
25 29b82486 Leszek Koltunski
  static final int MINX_LGREEN = 0xff53aa00;
26
  static final int MINX_PINK   = 0xfffd7ab7;
27
  static final int MINX_SANDY  = 0xffefd48b;
28
  static final int MINX_LBLUE  = 0xff00a2d7;
29
  static final int MINX_ORANGE = 0xffff6200;
30
  static final int MINX_VIOLET = 0xff7d59a4;
31
  static final int MINX_DGREEN = 0xff007a47;
32
  static final int MINX_DRED   = 0xffbd0000;
33
  static final int MINX_DBLUE  = 0xff1a29b2;
34
  static final int MINX_DYELLOW= 0xffffc400;
35
  static final int MINX_WHITE  = 0xffffffff;
36
  static final int MINX_GREY   = 0xff727c7b;
37
38 f9337e48 Leszek Koltunski
  public static final int[] FACE_COLORS = new int[]
39 29b82486 Leszek Koltunski
         {
40 9b1fe915 Leszek Koltunski
           MINX_DYELLOW, MINX_ORANGE , MINX_DRED  , MINX_SANDY,
41
           MINX_DBLUE  , MINX_WHITE  , MINX_GREY  , MINX_LBLUE,
42
           MINX_LGREEN , MINX_VIOLET , MINX_PINK  , MINX_DGREEN
43 29b82486 Leszek Koltunski
         };
44
45 f9337e48 Leszek Koltunski
  public static final int NUM_FACES = 12;
46 b31249d6 Leszek Koltunski
  public static final int FOV = 30;
47
  public static final float RATIO = 0.35f;
48 82eb152a Leszek Koltunski
49 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
50
51 a8295031 Leszek Koltunski
  public ShapeDodecahedron(InitData data, int meshState, int iconMode, float realSize, Static4D quat, Static3D move, float scale, InputStream stream)
52 29b82486 Leszek Koltunski
    {
53 a8295031 Leszek Koltunski
    super(data, meshState, iconMode, realSize, quat, move, scale, stream);
54 29b82486 Leszek Koltunski
    }
55
56
///////////////////////////////////////////////////////////////////////////////////////////////////
57
58 2289cab1 Leszek Koltunski
  public final int getNumFaces()
59 29b82486 Leszek Koltunski
    {
60 82eb152a Leszek Koltunski
    return NUM_FACES;
61 29b82486 Leszek Koltunski
    }
62
63
///////////////////////////////////////////////////////////////////////////////////////////////////
64
65 a75ae1ee Leszek Koltunski
  public int getNumFaceColors()
66 29b82486 Leszek Koltunski
    {
67 82eb152a Leszek Koltunski
    return FACE_COLORS.length;
68 29b82486 Leszek Koltunski
    }
69
70 2289cab1 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
71
72 82eb152a Leszek Koltunski
  public int getColor(int face)
73 2289cab1 Leszek Koltunski
    {
74
    return FACE_COLORS[face];
75
    }
76
77 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
78
79 7ba38dd4 Leszek Koltunski
  public int getFOV()
80 29b82486 Leszek Koltunski
    {
81 82eb152a Leszek Koltunski
    return FOV;
82 29b82486 Leszek Koltunski
    }
83
84
///////////////////////////////////////////////////////////////////////////////////////////////////
85
86 82eb152a Leszek Koltunski
  public float getScreenRatio()
87 29b82486 Leszek Koltunski
    {
88 82eb152a Leszek Koltunski
    return RATIO;
89 29b82486 Leszek Koltunski
    }
90
}