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.shape;
|
11
|
|
12
|
import java.io.InputStream;
|
13
|
|
14
|
import org.distorted.library.type.Static3D;
|
15
|
import org.distorted.library.type.Static4D;
|
16
|
import org.distorted.objectlib.main.InitData;
|
17
|
import org.distorted.objectlib.main.TwistyObject;
|
18
|
|
19
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
20
|
|
21
|
public abstract class ShapeHexahedron extends TwistyObject
|
22
|
{
|
23
|
public static final Static4D DEFAULT_ROT = new Static4D(-0.23377287f, 0.39656782f, 0.029073188f, 0.88726600f);
|
24
|
|
25
|
public static final int[] FACE_COLORS = new int[]
|
26
|
{
|
27
|
COLOR_YELLOW, COLOR_WHITE,
|
28
|
COLOR_BLUE , COLOR_GREEN,
|
29
|
COLOR_RED , COLOR_ORANGE
|
30
|
};
|
31
|
|
32
|
public static final int NUM_FACES = 6;
|
33
|
public static final int FOV = 40;
|
34
|
public static final float RATIO = 0.50f;
|
35
|
|
36
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
37
|
|
38
|
public ShapeHexahedron(InitData data, int meshState, int iconMode, float realSize, Static4D quat, Static3D move, float scale, InputStream stream)
|
39
|
{
|
40
|
super(data, meshState, iconMode, realSize, quat, move, scale, stream);
|
41
|
}
|
42
|
|
43
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
44
|
|
45
|
public final int getNumFaces()
|
46
|
{
|
47
|
return NUM_FACES;
|
48
|
}
|
49
|
|
50
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
51
|
|
52
|
public int getNumFaceColors()
|
53
|
{
|
54
|
return FACE_COLORS.length;
|
55
|
}
|
56
|
|
57
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
58
|
|
59
|
public int getColor(int face)
|
60
|
{
|
61
|
return FACE_COLORS[face];
|
62
|
}
|
63
|
|
64
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
65
|
|
66
|
public int getFOV()
|
67
|
{
|
68
|
return FOV;
|
69
|
}
|
70
|
|
71
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
72
|
|
73
|
public float getScreenRatio()
|
74
|
{
|
75
|
return RATIO;
|
76
|
}
|
77
|
}
|