Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / shape / ShapeIcosahedron.java @ 4c2c0f44

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2022 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.shape;
11

    
12
import org.distorted.library.type.Static3D;
13
import org.distorted.library.type.Static4D;
14
import org.distorted.objectlib.main.InitData;
15
import org.distorted.objectlib.main.TwistyObject;
16

    
17
import java.io.InputStream;
18

    
19
///////////////////////////////////////////////////////////////////////////////////////////////////
20

    
21
public abstract class ShapeIcosahedron extends TwistyObject
22
{
23
  public static final Static4D DEFAULT_ROT = new Static4D(-0.63874420f, 0.25712812f, 0.358450060f, 0.63039730f);
24

    
25
  static final int ICO_1 = 0xffe191b4;
26
  static final int ICO_2 = 0xff604c94;
27
  static final int ICO_3 = 0xff472258;
28
  static final int ICO_4 = 0xff591218;
29
  static final int ICO_5 = 0xffba365b;
30
  static final int ICO_6 = 0xffe4d031;
31
  static final int ICO_7 = 0xff4a90d5;
32
  static final int ICO_8 = 0xff0e28a3;
33
  static final int ICO_9 = 0xff566069;
34
  static final int ICO_10= 0xffd7660a;
35
  static final int ICO_11= 0xff092d2b;
36
  static final int ICO_12= 0xff034d3e;
37
  static final int ICO_13= 0xff1a7516;
38
  static final int ICO_14= 0xff58b6be;
39
  static final int ICO_15= 0xffd3c49b;
40
  static final int ICO_16= 0xff0a1662;
41
  static final int ICO_17= 0xffa21a1c;
42
  static final int ICO_18= 0xffe1b410;
43
  static final int ICO_19= 0xffdadeea;
44
  static final int ICO_20= 0xff0157ba;
45

    
46
  public static final int[] FACE_COLORS = new int[]
47
         {
48
           ICO_1 , ICO_2 , ICO_3 , ICO_4 , ICO_5 ,
49
           ICO_6 , ICO_7 , ICO_8 , ICO_9 , ICO_10,
50
           ICO_11, ICO_12, ICO_13, ICO_14, ICO_15,
51
           ICO_16, ICO_17, ICO_18, ICO_19, ICO_20,
52
         };
53

    
54
  public static final int NUM_FACES = 20;
55
  public static final int FOV = 30;
56
  public static final float RATIO = 0.35f;
57

    
58
///////////////////////////////////////////////////////////////////////////////////////////////////
59

    
60
  public ShapeIcosahedron(InitData data, int meshState, int iconMode, float realSize, Static4D quat, Static3D move, float scale, InputStream stream)
61
    {
62
    super(data, meshState, iconMode, realSize, quat, move, scale, stream);
63
    }
64

    
65
///////////////////////////////////////////////////////////////////////////////////////////////////
66

    
67
  public final int getNumFaces()
68
    {
69
    return NUM_FACES;
70
    }
71

    
72
///////////////////////////////////////////////////////////////////////////////////////////////////
73

    
74
  public int getNumFaceColors()
75
    {
76
    return FACE_COLORS.length;
77
    }
78

    
79
///////////////////////////////////////////////////////////////////////////////////////////////////
80

    
81
  public int getColor(int face)
82
    {
83
    return FACE_COLORS[face];
84
    }
85

    
86
///////////////////////////////////////////////////////////////////////////////////////////////////
87

    
88
  public int getFOV()
89
    {
90
    return FOV;
91
    }
92

    
93
///////////////////////////////////////////////////////////////////////////////////////////////////
94

    
95
  public float getScreenRatio()
96
    {
97
    return RATIO;
98
    }
99
}
(4-4/6)