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 ShapeOctahedron extends TwistyObject
|
22
|
{
|
23
|
public static final Static4D DEFAULT_ROT = new Static4D(-0.31521368f, 0.36868167f, -0.6488994f, 0.5862124f);
|
24
|
|
25
|
public static final int[] FACE_COLORS = new int[]
|
26
|
{
|
27
|
COLOR_VIOLET, COLOR_GREY ,
|
28
|
COLOR_BLUE , COLOR_RED ,
|
29
|
COLOR_ORANGE, COLOR_GREEN ,
|
30
|
COLOR_WHITE , COLOR_YELLOW
|
31
|
};
|
32
|
|
33
|
public static final int NUM_FACES = 8;
|
34
|
public static final int FOV = 40;
|
35
|
public static final float RATIO = 0.68f;
|
36
|
|
37
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
38
|
|
39
|
public ShapeOctahedron(InitData data, int meshState, int iconMode, float realSize, Static4D quat, Static3D move, float scale, InputStream stream)
|
40
|
{
|
41
|
super(data, meshState, iconMode, realSize, quat, move, scale, stream);
|
42
|
}
|
43
|
|
44
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
45
|
|
46
|
public final int getNumFaces()
|
47
|
{
|
48
|
return NUM_FACES;
|
49
|
}
|
50
|
|
51
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
52
|
|
53
|
public int getNumFaceColors()
|
54
|
{
|
55
|
return FACE_COLORS.length;
|
56
|
}
|
57
|
|
58
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
59
|
|
60
|
public int getColor(int face)
|
61
|
{
|
62
|
return FACE_COLORS[face];
|
63
|
}
|
64
|
|
65
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
66
|
|
67
|
public int getFOV()
|
68
|
{
|
69
|
return FOV;
|
70
|
}
|
71
|
|
72
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
73
|
|
74
|
public float getScreenRatio()
|
75
|
{
|
76
|
return RATIO;
|
77
|
}
|
78
|
}
|