1
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2
|
// Copyright 2021 Leszek Koltunski //
|
3
|
// //
|
4
|
// This file is part of Magic Cube. //
|
5
|
// //
|
6
|
// Magic Cube is free software: you can redistribute it and/or modify //
|
7
|
// it under the terms of the GNU General Public License as published by //
|
8
|
// the Free Software Foundation, either version 2 of the License, or //
|
9
|
// (at your option) any later version. //
|
10
|
// //
|
11
|
// Magic Cube is distributed in the hope that it will be useful, //
|
12
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
13
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
14
|
// GNU General Public License for more details. //
|
15
|
// //
|
16
|
// You should have received a copy of the GNU General Public License //
|
17
|
// along with Magic Cube. If not, see <http://www.gnu.org/licenses/>. //
|
18
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
19
|
|
20
|
package org.distorted.objectlib.objects;
|
21
|
|
22
|
import org.distorted.library.type.Static3D;
|
23
|
import org.distorted.library.type.Static4D;
|
24
|
|
25
|
import java.io.InputStream;
|
26
|
|
27
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
28
|
|
29
|
public class TwistyBandagedGeneric extends TwistyBandagedAbstract
|
30
|
{
|
31
|
private static float[][] POS;
|
32
|
private long mSignature = -1;
|
33
|
|
34
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
35
|
|
36
|
public TwistyBandagedGeneric(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
37
|
{
|
38
|
super(numL, meshState, iconMode, quat, move, scale, stream);
|
39
|
}
|
40
|
|
41
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
42
|
|
43
|
public TwistyBandagedGeneric()
|
44
|
{
|
45
|
super( new int[] {3,3,3}, MESH_NICE, MODE_NORM, new Static4D(0,0,0,1), new Static3D(0,0,0), 1.0f, null);
|
46
|
}
|
47
|
|
48
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
49
|
|
50
|
public static void setPositions(float[][] positions)
|
51
|
{
|
52
|
POS = positions;
|
53
|
}
|
54
|
|
55
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
56
|
|
57
|
float[][] getPositions()
|
58
|
{
|
59
|
if( POS==null )
|
60
|
{
|
61
|
POS = new float[][]
|
62
|
{
|
63
|
|
64
|
{-1.0f, +1.0f, +1.0f,
|
65
|
-1.0f, +1.0f, +0.0f,
|
66
|
-1.0f, +1.0f, -1.0f,
|
67
|
-1.0f, 0.0f, +1.0f,
|
68
|
-1.0f, 0.0f, +0.0f,
|
69
|
-1.0f, 0.0f, -1.0f },
|
70
|
|
71
|
{-1.0f, -1.0f, +1.0f,
|
72
|
-1.0f, -1.0f, +0.0f,
|
73
|
-1.0f, -1.0f, -1.0f,
|
74
|
0.0f, -1.0f, +1.0f,
|
75
|
0.0f, -1.0f, +0.0f},
|
76
|
|
77
|
{ 0.0f, +1.0f, +1.0f},
|
78
|
{ 0.0f, +1.0f, +0.0f},
|
79
|
{ 0.0f, +1.0f, -1.0f},
|
80
|
{ 0.0f, 0.0f, +1.0f},
|
81
|
{ 0.0f, 0.0f, -1.0f},
|
82
|
|
83
|
{ 1.0f, +1.0f, +1.0f},
|
84
|
{ 1.0f, +1.0f, +0.0f},
|
85
|
{ 1.0f, +1.0f, -1.0f},
|
86
|
{ 1.0f, 0.0f, +1.0f},
|
87
|
{ 1.0f, 0.0f, +0.0f},
|
88
|
{ 1.0f, -1.0f, +1.0f},
|
89
|
|
90
|
{ 1.0f, 0.0f, -1.0f,
|
91
|
1.0f, -1.0f, -1.0f,
|
92
|
1.0f, -1.0f, +0.0f,
|
93
|
0.0f, -1.0f, -1.0f },
|
94
|
};
|
95
|
}
|
96
|
return POS;
|
97
|
}
|
98
|
|
99
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
100
|
// PUBLIC APi
|
101
|
|
102
|
public String getShortName()
|
103
|
{
|
104
|
if( mSignature<0 ) mSignature = getSignature();
|
105
|
return ""+mSignature;
|
106
|
}
|
107
|
|
108
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
109
|
|
110
|
public long getSignature()
|
111
|
{
|
112
|
if( mSignature<0 )
|
113
|
{
|
114
|
mSignature = 0;
|
115
|
for(float[] pos : POS ) mSignature = markConnections(mSignature,pos);
|
116
|
}
|
117
|
|
118
|
return mSignature;
|
119
|
}
|
120
|
|
121
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
122
|
|
123
|
public String getObjectName()
|
124
|
{
|
125
|
return "";
|
126
|
}
|
127
|
|
128
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
129
|
|
130
|
public String getInventor()
|
131
|
{
|
132
|
return "??";
|
133
|
}
|
134
|
|
135
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
136
|
|
137
|
public int getYearOfInvention()
|
138
|
{
|
139
|
return 0;
|
140
|
}
|
141
|
|
142
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
143
|
|
144
|
public int getComplexity()
|
145
|
{
|
146
|
return 4;
|
147
|
}
|
148
|
|
149
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
150
|
|
151
|
public String[][] getTutorials()
|
152
|
{
|
153
|
return null;
|
154
|
}
|
155
|
}
|